Skip to content

Commit

Permalink
Merge pull request #1258 from nipreps/fix/do-not-write-some-configs
Browse files Browse the repository at this point in the history
ENH: Mechanism to protect config's fields and write out config
  • Loading branch information
oesteban committed Apr 11, 2024
2 parents 998ed85 + 7f0f221 commit 93cd6e6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .circleci/circle_T1w.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dataset_description.json
group_T1w.html
group_T1w.tsv
logs
logs/mriqcconfig.toml
logs/mriqc.log
sub-50137
sub-50137/anat
Expand Down
1 change: 1 addition & 0 deletions .circleci/circle_bold.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dataset_description.json
group_bold.html
group_bold.tsv
logs
logs/mriqcconfig.toml
logs/mriqc.log
sub-ds205s03
sub-ds205s03/figures
Expand Down
1 change: 1 addition & 0 deletions mriqc/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def main():
'%Hh %Mmin %Ss',
time.gmtime(time.time() - config.settings.start_time))
))
config.to_filename(config.execution.log_dir / 'mriqcconfig.toml')
sys.exit(exitcode)


Expand Down
7 changes: 7 additions & 0 deletions mriqc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class _Config:
"""An abstract class forbidding instantiation."""

_paths = ()
_hidden = ()

def __init__(self):
"""Avert instantiation."""
Expand Down Expand Up @@ -247,6 +248,8 @@ def get(cls):
for k, v in cls.__dict__.items():
if k.startswith('_') or v is None:
continue
if k in cls._hidden:
continue
if callable(getattr(cls, k)):
continue
if k in cls._paths:
Expand Down Expand Up @@ -454,6 +457,10 @@ class execution(_Config):
'work_dir',
)

_hidden = (
'webapi_token',
)

@classmethod
def init(cls):
"""Create a new BIDS Layout accessible with :attr:`~execution.layout`."""
Expand Down

0 comments on commit 93cd6e6

Please sign in to comment.