nipoppy.config¶
User/pipeline configurations.
Submodules¶
Package Contents¶
- class nipoppy.config.BasePipelineConfig(/, **data)¶
Bases:
nipoppy.config.container.SchemaWithContainerConfig,abc.ABCBase schema for processing/BIDS pipeline configuration.
- Parameters:
data (Any)
- CONTAINER_INFO: nipoppy.config.container.ContainerInfo¶
- STEPS: list[nipoppy.config.pipeline_step.ProcPipelineStepConfig | nipoppy.config.pipeline_step.BidsPipelineStepConfig]¶
- get_descriptor_file(step_name=None)¶
Return the path to the descriptor file for the given step.
If step is None, return the descriptor file for the first step.
- Parameters:
step_name (Optional[str])
- Return type:
pathlib.Path | None
- get_fpath_container()¶
Return the path to the pipeline’s container.
- Return type:
- get_invocation_file(step_name=None)¶
Return the path to the invocation file for the given step.
Is step is None, return the invocation file for the first step.
- Parameters:
step_name (Optional[str])
- Return type:
pathlib.Path | None
- get_step_config(step_name=None)¶
Return the configuration for the given step.
If step_name is None, return the configuration for the first step.
- Parameters:
step_name (Optional[str])
- Return type:
- validate_after()¶
Validate the pipeline configuration after creation.
Specifically: - If STEPS has more than one item, make sure that each step has a unique name.
- class nipoppy.config.BasePipelineStepConfig(/, **data)¶
Bases:
nipoppy.config.container.SchemaWithContainerConfig,abc.ABCSchema for processing pipeline step configuration.
- Parameters:
data (Any)
- DESCRIPTOR_FILE: pathlib.Path | None¶
- INVOCATION_FILE: pathlib.Path | None¶
- class nipoppy.config.BidsPipelineConfig(/, **data)¶
Bases:
BasePipelineConfigSchema for BIDS pipeline configuration.
- Parameters:
data (Any)
- model_config¶
- get_update_doughnut(step_name=None)¶
Return the update doughnut flag for the given step.
If step is None, return the flag for the first step.
- Parameters:
step_name (Optional[str])
- Return type:
pathlib.Path | None
- class nipoppy.config.BidsPipelineStepConfig(/, **data)¶
Bases:
BasePipelineStepConfigSchema for BIDS pipeline step configuration.
- Parameters:
data (Any)
- model_config¶
- class nipoppy.config.BoutiquesConfig(/, **data)¶
Bases:
nipoppy.config.container.SchemaWithContainerConfigSchema for custom configuration within a Boutiques descriptor.
- Parameters:
data (Any)
- model_config¶
- class nipoppy.config.Config(/, **data)¶
Bases:
nipoppy.config.container.SchemaWithContainerConfigSchema for dataset configuration.
- Parameters:
data (Any)
- BIDS_PIPELINES: list[nipoppy.config.pipeline.BidsPipelineConfig]¶
- DICOM_DIR_MAP_FILE: pathlib.Path | None¶
- PROC_PIPELINES: list[nipoppy.config.pipeline.ProcPipelineConfig]¶
- model_config¶
- apply_substitutions_to_json(json_obj)¶
Apply substitutions to a JSON object.
- classmethod check_input(data)¶
Validate the raw input.
Specifically: - If session_ids is not given, set to be the same as visit_ids
- Parameters:
data (Any)
- get_pipeline_config(pipeline_name, pipeline_version)¶
Get the config for a BIDS or processing pipeline.
- Parameters:
- Return type:
- get_pipeline_version(pipeline_name)¶
Get the first version associated with a pipeline.
- classmethod load(path, apply_substitutions=True)¶
Load a dataset configuration from a file.
- Parameters:
path (nipoppy.env.StrOrPathLike)
- Return type:
typing_extensions.Self
- propagate_container_config()¶
Propagate the container config to all pipelines.
- Return type:
typing_extensions.Self
- save(fpath, **kwargs)¶
Save the config to a JSON file.
- Parameters:
fpath (nipoppy.env.StrOrPathLike) – Path to the JSON file to write
- validate_and_process()¶
Validate and process the configuration.
- Return type:
typing_extensions.Self
- class nipoppy.config.ContainerConfig(/, **data)¶
Bases:
pydantic.BaseModelSchema for container configuration.
Does not include information about the container image.
- Parameters:
data (Any)
- model_config¶
- add_bind_path(path_local, path_inside_container=None, mode='rw')¶
Add a bind path.
- Parameters:
path_local (nipoppy.env.StrOrPathLike)
path_inside_container (Optional[nipoppy.env.StrOrPathLike])
mode (str)
- merge(other, overwrite_command=False)¶
Combine with another ContainerConfig instance.
By default this only changes arguments and environment variables, and no information is overwritten: - Arguments from other are appended to arguments of the current instance - Environment variables from other do not overwrite those of the current instance
If overwrite_command is True, the command of the current instance is replaced with that of the other instance.
- Parameters:
other (Any)
- class nipoppy.config.ProcPipelineConfig(/, **data)¶
Bases:
BasePipelineConfigSchema for processing pipeline configuration.
- Parameters:
data (Any)
- TRACKER_CONFIG_FILE: pathlib.Path | None¶
- model_config¶
- get_pybids_ignore_file(step_name=None)¶
Return the list of regex patterns to ignore when building the PyBIDS layout.
If step is None, return the patterns for the first step.
- Parameters:
step_name (Optional[str])
- Return type:
pathlib.Path | None
- class nipoppy.config.ProcPipelineStepConfig(/, **data)¶
Bases:
BasePipelineStepConfigSchema for processing pipeline step configuration.
- Parameters:
data (Any)
- PYBIDS_IGNORE_FILE: pathlib.Path | None¶
- model_config¶
- class nipoppy.config.TrackerConfig(/, **data)¶
Bases:
pydantic.BaseModelSchema for tracker configuration.
- Parameters:
data (Any)
- PATHS: list[pathlib.Path]¶
- model_config¶
- validate_after()¶
Validate the configuration after instantiation.
Specifically: - Make sure PATHS is not an empty list