Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Commit

Permalink
ENH: Look for configuration in working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
hoechenberger committed Oct 8, 2018
1 parent 24df54c commit 73c9026
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pyqmix/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,24 @@ def set_qmix_config(config_name, configs_dir=None):
----------
config_name : string
The name of a Qmix configuration. Assumed to be stored at the default directory.
configs_dir : string
configs_dir : string or None
The parent directory containing the Qmix configurations.
If ``None``, we will look for the Qmix configuration in the current
directory; if not found, move on to look in the Qmix default
directory.
Raises
------
ValueError
If the specified configuration could not be found.
"""

if configs_dir is None:
configs_dir = DEFAULT_CONFIGS_DIR
if os.path.exists(config_name):
configs_dir = os.path.abspath('.')
else:
configs_dir = DEFAULT_CONFIGS_DIR

config_dir = os.path.join(configs_dir, config_name)

Expand Down

0 comments on commit 73c9026

Please sign in to comment.