Skip to content

Commit

Permalink
First read the path to the config file from the environment (Github i…
Browse files Browse the repository at this point in the history
…ssue #226)
  • Loading branch information
marcelzwiers committed Feb 13, 2024
1 parent 8ed9a53 commit 684e293
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions bidscoin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@
schemafolder = bidscoinroot/'schema'
pluginfolder = bidscoinroot/'plugins'

# Get the BIDSCOIN_DEBUG environment variable to set the log-messages and logging level, etc
DEBUG = platform.os.getenv('BIDSCOIN_DEBUG','').upper() in ('1', 'TRUE', 'Y', 'YES')

# Create a BIDScoin user configuration directory if needed and load the BIDScoin user settings
configfile = Path.home()/'.bidscoin'/__version__/'config.toml'
configfile = platform.os.getenv('BIDSCOIN_CONFIG', Path.home()/'.bidscoin'/__version__/'config.toml')
templatefolder = configfile.parent/'templates'
templatefolder.mkdir(parents=True, exist_ok=True)
if not configfile.is_file():
Expand All @@ -77,9 +80,6 @@
if not bidsmap_template.is_file():
warnings.warn(f"Missing template bidsmap: {bidsmap_template} (see {configfile})", RuntimeWarning)

# Get the BIDSCOIN_DEBUG environment variable to set the log-messages and logging level, etc
DEBUG = platform.os.getenv('BIDSCOIN_DEBUG','').upper() in ('1', 'TRUE', 'Y', 'YES')

# Register the BIDScoin citation
due.cite(Doi('10.3389/fninf.2021.770608'), description='A versatile toolkit to convert source data to the Brain Imaging Data Structure (BIDS)',
path='bidscoin', version=__version__, cite_module=True, tags=['reference-implementation'])
Expand Down
3 changes: 2 additions & 1 deletion bidscoin/cli/_bcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
Default settings and template bidsmaps are stored in the ".bidscoin" folder in your home directory
(you can modify them to your needs with any plain text editor)
Set the environment variable BIDSCOIN_DEBUG=TRUE to run BIDScoin in a more verbose logging mode.
Set the environment variable BIDSCOIN_DEBUG=TRUE to run BIDScoin in a more verbose logging mode and
BIDSCOIN_CONFIG=/writable/path/to/config.toml if you like to use a different config file.
Citation reports can be generated with the help of duecredit (https://github.com/duecredit/duecredit)
For more documentation see: https://bidscoin.readthedocs.io
Expand Down

0 comments on commit 684e293

Please sign in to comment.