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

Module not found error for intake=2.0.1 #141

Open
roxyboy opened this issue Feb 26, 2024 · 6 comments
Open

Module not found error for intake=2.0.1 #141

roxyboy opened this issue Feb 26, 2024 · 6 comments

Comments

@roxyboy
Copy link

roxyboy commented Feb 26, 2024

Hi intake_xarray developers,

I've encountered an error when the version of intake is 2.0.1 where intake_xarray doesn't seem to recognize intake. When I reverted to intake=0.6.8, everything seemed to work fine again.

@martindurant
Copy link
Member

Intake >2 is a major rewrite of intake, so you are welcome to pin to an earlier version. However, we still aim for backward compatibility, so if you could please specify in what manner intake is not recognised. Do you have an exception/stack-trace?

@johnkit
Copy link

johnkit commented Mar 6, 2024

Here is an example that works with intake 0.7 but not 2.0. Is it possible there's an issue with the yaml file itself?

Source:

import intake
print(f'intake version: {intake.__version__}')
import intake_xarray
print(f'intake_xarray version: {intake_xarray.__version__}')
cat_url = 'https://raw.githubusercontent.com/pangeo-data/pangeo-datastore/master/intake-catalogs/ocean.yaml'
cat = intake.open_catalog(cat_url)

Output:

intake version: 2.0.3
intake_xarray version: 0.7.0
Traceback (most recent call last):
  File "/home/local/KHQ/john.tourtellott/projects/pan3d/git/pan3d/example.py", line 7, in <module>
    cat = intake.open_catalog(cat_url)
  File "/home/local/KHQ/john.tourtellott/.py3-venv/pan3d/lib/python3.9/site-packages/intake/__init__.py", line 184, in open_catalog
    return registry[driver](uri, **kwargs)
  File "/home/local/KHQ/john.tourtellott/.py3-venv/pan3d/lib/python3.9/site-packages/intake/catalog/local.py", line 613, in __init__
    super(YAMLFileCatalog, self).__init__(**kwargs)
  File "/home/local/KHQ/john.tourtellott/.py3-venv/pan3d/lib/python3.9/site-packages/intake/catalog/base.py", line 128, in __init__
    self.force_reload()
  File "/home/local/KHQ/john.tourtellott/.py3-venv/pan3d/lib/python3.9/site-packages/intake/catalog/base.py", line 186, in force_reload
    self._load()
  File "/home/local/KHQ/john.tourtellott/.py3-venv/pan3d/lib/python3.9/site-packages/intake/catalog/local.py", line 648, in _load
    self.parse(text)
  File "/home/local/KHQ/john.tourtellott/.py3-venv/pan3d/lib/python3.9/site-packages/intake/catalog/local.py", line 728, in parse
    raise exceptions.ValidationError(
intake.catalog.exceptions.ValidationError: Catalog 'https://raw.githubusercontent.com/pangeo-data/pangeo-datastore/master/intake-catalogs/ocean.yaml' has validation errors:

("missing 'module'", {'module': 'intake_xarray'})

@martindurant
Copy link
Member

This should be fixed on intake master, if you wouldn't mind checking

@johnkit
Copy link

johnkit commented Mar 6, 2024

Yes - I confirmed that intake:master can now read that catalog. Many thanks.

So after loading that catalog, I was expecting to find attributes cat.data, cat.entries, cat.aliases, cat.user_parameters, but they aren't there. I am new to intake so perhaps I misunderstand the user docs?

@martindurant
Copy link
Member

This is a V1 catalog, and we don't yet have a conversion utility. However the entries are function I think:

list(cat)  # names of datasets
cat.sea_surface_height.to_dask()  # open one of them

@johnkit
Copy link

johnkit commented Mar 6, 2024

Oh, right. I was applying v2 docs to V1 catalog. Thanks again. I really appreciate your quick response on this.

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

No branches or pull requests

3 participants