Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation #19

Merged
merged 15 commits into from
Feb 17, 2021
Merged

Add documentation #19

merged 15 commits into from
Feb 17, 2021

Conversation

andersy005
Copy link
Member

@andersy005 andersy005 commented Feb 16, 2021

This is still work in progress ...

@andersy005 andersy005 mentioned this pull request Feb 16, 2021
@andersy005 andersy005 marked this pull request as ready for review February 17, 2021 01:14
@andersy005
Copy link
Member Author

andersy005 commented Feb 17, 2021

@martindurant, @aaronspring this is ready for review when you get a moment. Let me know if the tutorial notebook is missing anything or contains unclear explanations :). You can view the rendered version from https://intake-thredds--19.org.readthedocs.build/en/19/

@aaronspring
Copy link
Collaborator

can we give this a nicer name instead of name not found?
image

@aaronspring
Copy link
Collaborator

aaronspring commented Feb 17, 2021

I would also add section in the tutorial about the different drivers and simplecache. Should I add this?

I am thinking of:

Under the hood intake-thredds opens the driver='opendap' from intake-xarray by default. You can also choose driver='netcdf' in combination with fsspec to cache files by appending simplecache:: to the url, see https://filesystem-spec.readthedocs.io/en/latest/features.html#remote-write-caching.

import os
import fsspec
fsspec.config.conf['simplecache'] = {'cache_storage': 'my_caching_folder', 'same_names': True}

cat_url = 'https://psl.noaa.gov/thredds/catalog.xml'
source = intake.open_thredds_merged(
    f'simplecache::{cat_url}',
    path=['Datasets', 'ncep.reanalysis.dailyavgs', 'surface', 'air.sig995.194*.nc'],
    driver='netcdf'
)
print(source)
ds = source.to_dask()
assert os.path.exists('my_caching_folder/air.sig995.1949.nc')

see #20

tests/test_source.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@aaronspring aaronspring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really nice this new documentation, see #20 for additional section

@martindurant
Copy link
Member

Great improvements throughout.
The notebook doesn't show that well on github, but maybe that doesn't matter.

@andersy005
Copy link
Member Author

andersy005 commented Feb 17, 2021

can we give this a nicer name instead of name not found?
image

I thought I could just do

catalog = intake.open_thredds_cat(cat_url, name='noaa-ersst-catalog')

and intake would take care of the rest in https://github.com/NCAR/intake-thredds/blob/3d5e08c3d784f235f8139b8b1228629138da0eea/intake_thredds/cat.py#L8-L11

For some reason, the name argument doesn't get propagated to the base class and self.name stays None no matter what. @martindurant, Am I missing anything here?

@martindurant
Copy link
Member

Yes, you can pass name= to Catalog, and intake.open_thredds_cat is intake_thredds.cat.ThreddsCatalog.
Is this line resetting the value?

@andersy005
Copy link
Member Author

Yes, you can pass name= to Catalog, and intake.open_thredds_cat is intake_thredds.cat.ThreddsCatalog.
Is this line resetting the value?

👍🏽 Good catch. Thanks! Should be fixed now

@andersy005
Copy link
Member Author

andersy005 commented Feb 17, 2021

Not sure what's causing the ModuleNotFoundError: No module named 'msgpack' error on RTD. It wasn't happening before and I just started seeing it a few minutes ago. Will look into this later today.

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/intake-thredds/envs/19/lib/python3.7/site-packages/sphinx/config.py", line 327, in eval_config_file
    execfile_(filename, namespace)
  File "/home/docs/checkouts/readthedocs.org/user_builds/intake-thredds/envs/19/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 88, in execfile_
    exec(code, _globals)
  File "/home/docs/checkouts/readthedocs.org/user_builds/intake-thredds/checkouts/19/docs/source/conf.py", line 17, in <module>
    import intake_thredds
  File "/home/docs/checkouts/readthedocs.org/user_builds/intake-thredds/envs/19/lib/python3.7/site-packages/intake_thredds-0.0.post56-py3.7.egg/intake_thredds/__init__.py", line 8, in <module>
    from .source import THREDDSMergedSource  # noqa: F401
  File "/home/docs/checkouts/readthedocs.org/user_builds/intake-thredds/envs/19/lib/python3.7/site-packages/intake_thredds-0.0.post56-py3.7.egg/intake_thredds/source.py", line 3, in <module>
    from intake_xarray.base import DataSourceMixin
  File "/home/docs/checkouts/readthedocs.org/user_builds/intake-thredds/envs/19/lib/python3.7/site-packages/intake_xarray/__init__.py", line 6, in <module>
    from intake.container import register_container
  File "/home/docs/checkouts/readthedocs.org/user_builds/intake-thredds/envs/19/lib/python3.7/site-packages/intake/container/__init__.py", line 8, in <module>
    from .dataframe import RemoteDataFrame
  File "/home/docs/checkouts/readthedocs.org/user_builds/intake-thredds/envs/19/lib/python3.7/site-packages/intake/container/dataframe.py", line 11, in <module>
    from .base import RemoteSource, get_partition
  File "/home/docs/checkouts/readthedocs.org/user_builds/intake-thredds/envs/19/lib/python3.7/site-packages/intake/container/base.py", line 8, in <module>
    import msgpack
ModuleNotFoundError: No module named 'msgpack'

@andersy005 andersy005 merged commit 0ea8f47 into main Feb 17, 2021
@andersy005 andersy005 deleted the add-docs branch February 17, 2021 19:05
@andersy005 andersy005 restored the add-docs branch February 17, 2021 19:07
@andersy005 andersy005 deleted the add-docs branch February 17, 2021 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants