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

Unable to get aggregation_control.groupby_attrs a #665

Open
aradhakrishnanGFDL opened this issue May 7, 2024 · 0 comments
Open

Unable to get aggregation_control.groupby_attrs a #665

aradhakrishnanGFDL opened this issue May 7, 2024 · 0 comments

Comments

@aradhakrishnanGFDL
Copy link

Description

Following [intake-esm doc](https://intake-esm.readthedocs.io/en/stable/how-to/understand-keys-and-how-to-change-them.html) to print aggregation columns and get more info on the keys
 1) catalog.esmcat.aggregation_control.groupby_attrs and 2) keys_info(), but running into errors. User error not ruled out, please point me in the right direction. 

Background being - I want to get the aggregate columns (and vocabulary url!) from the json and see if we can validate and provide additional info to users regarding the catalog correctness and expected structure before it is used in the analysis. 

What I Did

cat = intake.open_esm_datastore(col)

>>> cat.keys_info()
Traceback (most recent call last):
  File "/nbhome/Aparna.Radhakrishnan/conda/envs/intake/lib/python3.7/site-packages/intake_esm/core.py", line 239, in __getitem__
    return self._entries[key]
KeyError: 'keys_info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nbhome/Aparna.Radhakrishnan/conda/envs/intake/lib/python3.7/site-packages/intake/catalog/base.py", line 339, in __getattr__
    return self[item]  # triggers reload_on_change
  File "/nbhome/Aparna.Radhakrishnan/conda/envs/intake/lib/python3.7/site-packages/intake_esm/core.py", line 246, in __getitem__
    raise KeyError(key)
KeyError: 'keys_info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nbhome/Aparna.Radhakrishnan/conda/envs/intake/lib/python3.7/site-packages/intake/catalog/base.py", line 341, in __getattr__
    raise AttributeError(item)
AttributeError: keys_info

cat.esmcat.aggregation_control.groupby_attrs
AttributeError: esmcat
>>> type(cat)
<class 'intake_esm.core.esm_datastore'>
>>> catalog.esmcat.aggregation_control.groupby_attrs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'catalog' is not defined
>>> cat.esmcat.aggregation_control.groupby_attrs
Traceback (most recent call last):
  File "/nbhome/Aparna.Radhakrishnan/conda/envs/intake/lib/python3.7/site-packages/intake_esm/core.py", line 239, in __getitem__
    return self._entries[key]
KeyError: 'esmcat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nbhome/Aparna.Radhakrishnan/conda/envs/intake/lib/python3.7/site-packages/intake/catalog/base.py", line 339, in __getattr__
    return self[item]  # triggers reload_on_change
  File "/nbhome/Aparna.Radhakrishnan/conda/envs/intake/lib/python3.7/site-packages/intake_esm/core.py", line 246, in __getitem__
    raise KeyError(key)
KeyError: 'esmcat'

Version information: output of intake_esm.show_versions()

The files in csv are NetCDF files that are internal to GFDL.
This is a template of what was used

https://github.com/aradhakrishnanGFDL/CatalogBuilder/blob/main/cats/gfdl_test1.json
and https://github.com/aradhakrishnanGFDL/CatalogBuilder/blob/main/cats/gfdl_test1.csv

intake_esm.version
'2020.6.11'

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

1 participant