Skip to content

Commit

Permalink
Fixed string format error for snapshots (#1277)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjarrett authored May 31, 2023
1 parent e58819c commit 147008e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions armi/operators/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,9 @@ def snapshotRequest(self, cycle, node):
if "rzmflx" in fileName:
pathTools.copyOrWarn("rzmflx for snapshot", fileName, newFolder)

isoFName = "ISOTXS-c{0}n{0}".format(cycle, node)
isoFName = f"ISOTXS-c{cycle}n{node}"
if not os.path.exists(isoFName):
isoFName = "ISOTXS-c{0}".format(cycle)
isoFName = f"ISOTXS-c{cycle}"
pathTools.copyOrWarn(
"ISOTXS for snapshot", isoFName, pathTools.armiAbsPath(newFolder, "ISOTXS")
)
Expand Down
10 changes: 9 additions & 1 deletion armi/operators/tests/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,15 @@ def test_setStateToDefault(self):

def test_snapshotRequest(self):
with TemporaryDirectoryChanger():
self.o.snapshotRequest(0, 1)
with mockRunLogs.BufferLog() as mock:
self.o.snapshotRequest(0, 1)
self.assertIn("ISOTXS-c0", mock.getStdout())
self.assertIn("DIF3D output for snapshot", mock.getStdout())
self.assertIn("Shuffle logic for snapshot", mock.getStdout())
self.assertIn("Geometry file for snapshot", mock.getStdout())
self.assertIn("Loading definition for snapshot", mock.getStdout())
self.assertIn("Flow history for snapshot", mock.getStdout())
self.assertIn("Pressure history for snapshot", mock.getStdout())
self.assertTrue(os.path.exists("snapShot0_1"))


Expand Down
2 changes: 1 addition & 1 deletion doc/release/0.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ What's new in ARMI

Bug fixes
---------
#. TBD
#. Fixed a bug in the ISOTXS file name used for snapshots. (`PR#1277 <https://github.com/terrapower/armi/pull/1277>`_)


ARMI v0.2.7
Expand Down

0 comments on commit 147008e

Please sign in to comment.