Skip to content

Commit

Permalink
Adjust ecm_packages guidance, restrict active list additions
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlangevin committed Oct 14, 2024
1 parent 373f3d2 commit 5a34185
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/config_readable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ecm_prep:
ecm_packages: (array) Specify ECM packages; values must correspond
with package_ecms.json package names in the ECM directory.
If no list or an empty list is provided, no packages will
be used. Include an astrisk (["*"]) in the list to prepare
be used. Include an asterisk ("*") in the list to prepare
all packages present in package_ecms.json. Contributing ECMs
for specified packages will automatically be prepared regardless
of their presence in the `ecm_directory`, `ecm_files`, and/or
Expand Down
4 changes: 3 additions & 1 deletion scout/ecm_prep_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def translate_inputs(opts: argparse.NameSpace) -> argparse.NameSpace: # noqa: F
"""

# Set ECMs if subset is provided
ecm_dir_files = [file.stem for file in fp.ECM_DEF.iterdir() if file.is_file()]
ecm_dir_files = [
file.stem for file in fp.ECM_DEF.iterdir() if file.is_file() and
file.suffix == '.json' and file.stem != 'package_ecms']
missing_ecms = []
if opts.ecm_files is not None:
missing_ecms = [ecm for ecm in opts.ecm_files if ecm not in ecm_dir_files]
Expand Down
2 changes: 1 addition & 1 deletion scout/supporting_data/config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ properties:
ecm_packages:
type: "array"
default: []
description: Specify ECM packages; values must correspond with package_ecms.json package names in the ECM directory. If no list or an empty list is provided, no packages will be used. Include an astrisk (["*"]) in the list to prepare all packages present in package_ecms.json. Contributing ECMs for specified packages will automatically be prepared regardless of their presence in the `ecm_directory`, `ecm_files`, and/or `ecm_files_regex` arguments.
description: Specify ECM packages; values must correspond with package_ecms.json package names in the ECM directory. If no list or an empty list is provided, no packages will be used. Include an asterisk ("*") in the list to prepare all packages present in package_ecms.json. Contributing ECMs for specified packages will automatically be prepared regardless of their presence in the `ecm_directory`, `ecm_files`, and/or `ecm_files_regex` arguments.

site_energy:
type: boolean
Expand Down
4 changes: 3 additions & 1 deletion tests/arguments_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ class TestECMPrepArgsTranslate(unittest.TestCase, Utils):
# test_files/default_config.yml
default_translated = {
"ecm_directory": None,
"ecm_files": [file.stem for file in fp.ECM_DEF.iterdir() if file.is_file()],
"ecm_files": [
file.stem for file in fp.ECM_DEF.iterdir() if file.is_file() and
file.suffix == '.json' and file.stem != 'package_ecms'],
"ecm_files_regex": [],
"ecm_packages": [],
"site_energy": False,
Expand Down

0 comments on commit 5a34185

Please sign in to comment.