bids.layout.Config¶
-
class
Config
(name, entities=None, default_path_patterns=None, session=None)[source]¶ Container for BIDS configuration information.
- Parameters
name (str) – The name to give the Config (e.g., ‘bids’).
entities (list) – A list of dictionaries containing entity configuration information.
default_path_patterns (list) – Optional list of patterns used to build new paths.
session (
sqlalchemy.orm.session.Session
or None) – An optional SQLAlchemy session. If passed, the session is used to update the database with any newly created Entity objects. If None, no database update occurs.
- Attributes
- entities
- name
Methods
load
(config[, session])Load a Config instance from the passed configuration data.
-
__init__
(self, name, entities=None, default_path_patterns=None, session=None)¶
Methods
__init__
(self, name[, entities, …])load
(config[, session])Load a Config instance from the passed configuration data.
Attributes
entities
metadata
name
-
classmethod
load
(config, session=None)[source]¶ Load a Config instance from the passed configuration data.
- Parameters
config (str or dict) –
A string or dict containing configuration information. Must be one of: * A string giving the name of a predefined config file
(e.g., ‘bids’ or ‘derivatives’)
A path to a JSON file containing config information
A dictionary containing config information
session (
sqlalchemy.orm.session.Session
or None) – An optional SQLAlchemy Session instance. If passed, the session is used to check the database for (and return) an existing Config with name defined in config[‘name’].
- Returns
- Return type
A Config instance.