Problem opening intake catalog

Hi all,

I tried to load data using intake catalog for the first time (I am a member of xp65):

Unfortunately, this error occurred:

FileNotFoundError                         Traceback (most recent call last)
Cell In[18], line 1
----> 1 catalog = intake.cat.access_nri

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/base.py:402, in Catalog.__getattr__(self, item)
    399 if not item.startswith("_"):
    400     # Fall back to __getitem__.
    401     try:
--> 402         return self[item]  # triggers reload_on_change
    403     except KeyError as e:
    404         raise AttributeError(item) from e

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/base.py:447, in Catalog.__getitem__(self, key)
    438 """Return a catalog entry by name.
    439 
    440 Can also use attribute syntax, like ``cat.entry_name``, or
   (...)
    443 cat['name1', 'name2']
    444 """
    445 if not isinstance(key, list) and key in self:
    446     # triggers reload_on_change
--> 447     s = self._get_entry(key)
    448     if s.container == "catalog":
    449         s.name = key

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/utils.py:45, in reload_on_change.<locals>.wrapper(self, *args, **kwargs)
     42 @functools.wraps(f)
     43 def wrapper(self, *args, **kwargs):
     44     self.reload()
---> 45     return f(self, *args, **kwargs)

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/base.py:333, in Catalog._get_entry(self, name)
    331 ups = [up for name, up in self.user_parameters.items() if name not in up_names]
    332 entry._user_parameters = ups + (entry._user_parameters or [])
--> 333 return entry()

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/local.py:823, in EntrypointEntry.__call__(self, **kwargs)
    821 def __call__(self, **kwargs):
    822     """Instantiate the DataSource for the given parameters"""
--> 823     source = self._entrypoint.load()
    824     if kwargs:
    825         source = source.configure_new(**kwargs)

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/entrypoints.py:79, in EntryPoint.load(self)
     76 def load(self):
     77     """Load the object to which this entry point refers.
     78     """
---> 79     mod = import_module(self.module_name)
     80     obj = mod
     81     if self.object_name:

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/importlib/__init__.py:126, in import_module(name, package)
    124             break
    125         level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)

File <frozen importlib._bootstrap>:1050, in _gcd_import(name, package, level)

File <frozen importlib._bootstrap>:1027, in _find_and_load(name, import_)

File <frozen importlib._bootstrap>:1006, in _find_and_load_unlocked(name, import_)

File <frozen importlib._bootstrap>:688, in _load_unlocked(spec)

File <frozen importlib._bootstrap_external>:883, in exec_module(self, module)

File <frozen importlib._bootstrap>:241, in _call_with_frames_removed(f, *args, **kwds)

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/access_nri_intake/data/__init__.py:9
      6 import intake
      8 _here = os.path.abspath(os.path.dirname(__file__))
----> 9 data = intake.open_catalog(os.path.join(_here, "catalog.yaml")).access_nri

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/base.py:402, in Catalog.__getattr__(self, item)
    399 if not item.startswith("_"):
    400     # Fall back to __getitem__.
    401     try:
--> 402         return self[item]  # triggers reload_on_change
    403     except KeyError as e:
    404         raise AttributeError(item) from e

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/base.py:447, in Catalog.__getitem__(self, key)
    438 """Return a catalog entry by name.
    439 
    440 Can also use attribute syntax, like ``cat.entry_name``, or
   (...)
    443 cat['name1', 'name2']
    444 """
    445 if not isinstance(key, list) and key in self:
    446     # triggers reload_on_change
--> 447     s = self._get_entry(key)
    448     if s.container == "catalog":
    449         s.name = key

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/utils.py:45, in reload_on_change.<locals>.wrapper(self, *args, **kwargs)
     42 @functools.wraps(f)
     43 def wrapper(self, *args, **kwargs):
     44     self.reload()
---> 45     return f(self, *args, **kwargs)

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/base.py:333, in Catalog._get_entry(self, name)
    331 ups = [up for name, up in self.user_parameters.items() if name not in up_names]
    332 entry._user_parameters = ups + (entry._user_parameters or [])
--> 333 return entry()

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/entry.py:79, in CatalogEntry.__call__(self, persist, **kwargs)
     77     raise ValueError("Persist value (%s) not understood" % persist)
     78 persist = persist or self._pmode
---> 79 s = self.get(**kwargs)
     80 if persist != "never" and isinstance(s, PersistMixin) and s.has_been_persisted:
     81     from ..container.persist import store

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/local.py:273, in LocalCatalogEntry.get(self, **user_parameters)
    270     return self._default_source
    272 plugin, open_args = self._create_open_args(user_parameters)
--> 273 data_source = plugin(**open_args)
    274 data_source.catalog_object = self._catalog
    275 data_source.name = self.name

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake_dataframe_catalog/core.py:112, in DfFileCatalog.__init__(self, path, yaml_column, name_column, mode, columns_with_iterables, storage_options, read_kwargs, **intake_kwargs)
    109 if self.mode in ["w", "x", "a", "r+"]:
    110     self._allow_write = True
--> 112 super().__init__(storage_options=self.storage_options, **self._intake_kwargs)

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/base.py:121, in Catalog.__init__(self, entries, name, description, metadata, ttl, getenv, getshell, persist_mode, storage_options, user_parameters)
    119 self.updated = time.time()
    120 self._entries = entries if entries is not None else self._make_entries_container()
--> 121 self.force_reload()

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake/catalog/base.py:179, in Catalog.force_reload(self)
    177 """Imperative reload data now"""
    178 self.updated = time.time()
--> 179 self._load()

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/intake_dataframe_catalog/core.py:126, in DfFileCatalog._load(self)
    123         pass
    124         # self._df.to_csv(fobj)
    125 else:
--> 126     with fsspec.open(self.path, **self.storage_options) as fobj:
    127         self._df = pd.read_csv(fobj, **self._read_kwargs)
    128     if self.yaml_column not in self.df.columns:

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/fsspec/core.py:105, in OpenFile.__enter__(self)
    102 mode = self.mode.replace("t", "").replace("b", "") + "b"
    104 try:
--> 105     f = self.fs.open(self.path, mode=mode)
    106 except FileNotFoundError as e:
    107     if has_magic(self.path):

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/fsspec/spec.py:1303, in AbstractFileSystem.open(self, path, mode, block_size, cache_options, compression, **kwargs)
   1301 else:
   1302     ac = kwargs.pop("autocommit", not self._intrans)
-> 1303     f = self._open(
   1304         path,
   1305         mode=mode,
   1306         block_size=block_size,
   1307         autocommit=ac,
   1308         cache_options=cache_options,
   1309         **kwargs,
   1310     )
   1311     if compression is not None:
   1312         from fsspec.compression import compr

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/fsspec/implementations/local.py:191, in LocalFileSystem._open(self, path, mode, block_size, **kwargs)
    189 if self.auto_mkdir and "w" in mode:
    190     self.makedirs(self._parent(path), exist_ok=True)
--> 191 return LocalFileOpener(path, mode, fs=self, **kwargs)

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/fsspec/implementations/local.py:355, in LocalFileOpener.__init__(self, path, mode, autocommit, fs, compression, **kwargs)
    353 self.compression = get_compression(path, compression)
    354 self.blocksize = io.DEFAULT_BUFFER_SIZE
--> 355 self._open()

File /g/data/hh5/public/apps/miniconda3/envs/analysis3-24.04/lib/python3.10/site-packages/fsspec/implementations/local.py:360, in LocalFileOpener._open(self)
    358 if self.f is None or self.f.closed:
    359     if self.autocommit or "w" not in self.mode:
--> 360         self.f = open(self.path, mode=self.mode)
    361         if self.compression:
    362             compress = compr[self.compression]

FileNotFoundError: [Errno 2] No such file or directory: '/g/data/xp65/public/apps/access-nri-intake-catalog/v0.1.3/metacatalog.csv'

I’d appreciate if anyone could point out what I do wrong or look into the issue with catalog.

Hi @polinash. Did you add gdata/xp65 to the list of projects under Storage when you configured your ARE session?

1 Like

Good point! I didn’t :grimacing: will fix it!

1 Like

Note, you’ll also need to add any of the projects containing the data you want to access through the Intake catalog.