Skip to content

Commit 9018af6

Browse files
committed
fix(cli_tools): Adjustment to fix original issue
1 parent 90dce04 commit 9018af6

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/mcsas3/__main__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,18 @@ def isMac():
113113
# replaceStdOutErr() # replace all text output with our sinks
114114

115115
adict = vars(args)
116+
# split arguments into two dictionaries, one for the optimizer and one for the histogrammer
117+
adict_optimize = [
118+
{k: v for k, v in adict.items() if k in
119+
["dataFile", "resultFile", "readConfigFile", "runConfigFile", "resultIndex", "deleteIfExists", "nThreads"]}
120+
]
121+
adict_histogram = [
122+
{k: v for k, v in adict.items() if k in
123+
["resultFile", "histConfigFile", "resultIndex"]}
124+
]
116125
try:
117-
m = McSAS3_cli_optimize(**adict)
118-
m = McSAS3_cli_histogram(**adict)
126+
m = McSAS3_cli_optimize(**adict_optimize)
127+
m = McSAS3_cli_histogram(**adict_histogram)
119128
except TypeError as e: # for wrong cmdline arguments supplied
120129
print(f"{type(e).__name__}: {str(e)}\n", file=sys.stderr)
121130
parser.print_help()

src/mcsas3/cli_tools.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def checkConfig(self, attribute, value):
6969
assert value.exists(), f"configuration file {value} must exist"
7070
assert value.suffix == ".yaml", "configuration file must be a yaml file (and end in .yaml)"
7171

72-
dataFile: Path = field(kw_only=True) # dummy
7372
resultFile: Path = field(kw_only=True, validator=validators.instance_of(Path))
7473
histConfigFile: Path = field(
7574
kw_only=True, validator=[validators.instance_of(Path), checkConfig]

0 commit comments

Comments
 (0)