Skip to content

Commit dc4b32f

Browse files
committed
Add option to strictly track MFiles
1 parent 09699de commit dc4b32f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tracking/run_tracking_inputs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def tracking(arguments):
4545
message=arguments.commit,
4646
hashid=arguments.hash,
4747
tracking_variables_file=arguments.tracking_variables_file,
48+
strict=arguments.strict,
4849
)
4950

5051
copied_mfile = shutil.copy(mfile_path, Path(arguments.db) / mfile_path.name)
@@ -75,6 +76,7 @@ def tracking(arguments):
7576
help="A JSON file containing a list of variables to track."
7677
"See the description of DEFAULT_TRACKING_VARIABLES for details on formatting the strings in the list.",
7778
)
79+
subparser_trk.add_argument("--strict", action="store_true", default=False)
7880

7981
arguments = parser.parse_args()
8082

tracking/tracking_data.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def __init__(
168168
message: str | None = None,
169169
hashid: str | None = None,
170170
tracking_variables_file: pathlib.Path | None = None,
171+
strict: bool = False,
171172
) -> None:
172173
"""Drive the creation of tracking JSON files.
173174
@@ -178,6 +179,10 @@ def __init__(
178179
:type database: str
179180
"""
180181
self.mfile = mf.MFile(mfile)
182+
183+
if strict and (ifail := self.mfile.data["ifail"].get_scan(-1) != 1):
184+
raise RuntimeError(f"{ifail = } indicates PROCESS has failed to converge.")
185+
181186
self.tracking_file = TrackingFile()
182187

183188
if tracking_variables_file is None:

0 commit comments

Comments
 (0)