bids-specification icon indicating copy to clipboard operation
bids-specification copied to clipboard

[BUG] unable to get schema path in bidsschematools in 1.0.7

Open nbeliy opened this issue 6 months ago • 8 comments
trafficstars

Describe your problem in detail.

Starting from version 1.0.7, I'm unable to get the path to the schema using get_bundled_schema_path function. I got the following error:

from bidsschematools.utils import get_bundled_schema_path

get_bundled_schema_path()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 get_bundled_schema_path()

File ~/.virtualenvs/test.3.10/lib/python3.10/site-packages/bidsschematools/utils.py:18, in get_bundled_schema_path()
     10 def get_bundled_schema_path():
     11     """Get the path to the schema directory.
     12 
     13     Returns
   (...)
     16         Absolute path to the directory containing schema-related files.
     17     """
---> 18     return str(data.load_resource("schema"))

AttributeError: module 'bidsschematools.data' has no attribute 'load_resource'

This error appears in versions 1.07, 1.0.8, 1.0,9

Describe what you expected.

In version 1.0.5 schema path is returned normally:

from bidsschematools.utils import get_bundled_schema_path

print(get_bundled_schema_path())
/home/beliy/.virtualenvs/test.3.10/lib/python3.10/site-packages/bidsschematools/data/schema

BIDS specification section

https://bids-specification.readthedocs.io/en/latest/...

nbeliy avatar May 23 '25 14:05 nbeliy