Skip to content

Commit 1f1cb12

Browse files
committed
Add option to strictly track MFiles
1 parent e8ee138 commit 1f1cb12

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
@@ -44,6 +44,7 @@ def tracking(arguments):
4444
database=arguments.db,
4545
message=arguments.commit,
4646
hashid=arguments.hash,
47+
strict=arguments.strict,
4748
)
4849

4950
copied_mfile = shutil.copy(mfile_path, Path(arguments.db) / mfile_path.name)
@@ -67,6 +68,7 @@ def tracking(arguments):
6768
subparser_trk.add_argument("db", type=str)
6869
subparser_trk.add_argument("commit", type=str)
6970
subparser_trk.add_argument("hash", type=str)
71+
subparser_trk.add_argument("--strict", action="store_true", default=False)
7072

7173
arguments = parser.parse_args()
7274

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
database: str | None = None,
169169
message: str | None = None,
170170
hashid: str | 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
self._generate_data()

0 commit comments

Comments
 (0)