Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions opgee/built_ins/run_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def addArgs(self, parser):
parser.add_argument(
"-n",
"--no-default-model",
action="store_true",
action="store_const",
help="""Don't load the built-in opgee.xml model definition.""",
)

Expand Down Expand Up @@ -251,7 +251,7 @@ def run(self, args, tool):
start_with = args.start_with
trial_nums = None
trials = args.trials
use_default_model = not args.no_default_model
use_default_model = not args.no_default_model if args.no_default_model is not None else None

# TBD: conceptual problem: XML model merging doesn't happen until after we look for
# analyses and fields in the model XML. Might want to do XML-level merging before
Expand Down Expand Up @@ -290,6 +290,8 @@ def run(self, args, tool):
raise CommandlineError(
"No model to run: the --model-file option was not used and --no-default-model was specified."
)
if use_default_model is not None:
setParam("OPGEE.UseDefaultModel", str(use_default_model))

# TBD: unclear if this is necessary
setParam(
Expand Down
13 changes: 9 additions & 4 deletions opgee/etc/system.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ OPGEE.ModelFile = etc/opgee.xml
# are assumed to be within the opgee package.
OPGEE.AttributesFile = etc/attributes.xml

# Whether to load the default model file before merging additional input models
# NOTE: overridden by `--no-default-model` cli option
OPGEE.UseDefaultModel = True

# Where to find user's attributes.xml files (optional)
OPGEE.UserAttributesFile =

Expand Down Expand Up @@ -80,6 +84,11 @@ OPGEE.LogFile = %(OPGEE.LogDir)s/opgee.log
OPGEE.LogFileFormat = %%(asctime)s %%(levelname)s %%(name)s:%%(lineno)d %%(message)s
OPGEE.LogConsoleFormat = %%(levelname)s %%(name)s: %%(message)s

# AuditLevel: Controls the level of attribute auditing.
# Options: None (default, no audit), Field (audit field-level attributes), Processes (show process graph only), All
# Note: Processes auditing (as well as "All") has a bug currently
OPGEE.AuditLevel = None

# Where to create temporary files
OPGEE.TempDir = /tmp

Expand Down Expand Up @@ -147,7 +156,3 @@ SLURM.Interface =
# Which shell to use for the sbatch script
SLURM.Shell = /usr/bin/bash

# AuditLevel: Controls the level of attribute auditing.
# Options: None (default, no audit), Field (audit field-level attributes), Processes (show process graph only), All
# Note: Processes auditing (as well as "All") has a bug currently
OPGEE.AuditLevel = None
4 changes: 3 additions & 1 deletion opgee/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,12 @@ def run_serial(model_xml_file, analysis_name, field_names, result_type=DETAILED_

results = []

use_default_model = getParam("OPGEE.UseDefaultModel") or "False"

# even though we pass 10 field names by default, each is passed singularly to `_run_field`
for field_name, xml_string in extract_model(model_xml_file, analysis_name,
field_names):
result = _run_field(analysis_name, field_name, xml_string, result_type)
result = _run_field(analysis_name, field_name, xml_string, result_type, use_default_model == str(True))
if result.error:
_logger.error(f"Failed: {result}")

Expand Down
Loading