Skip to content

Commit

Permalink
found some spots to force int so we don't end up with np.int64 in a s…
Browse files Browse the repository at this point in the history
…tring
  • Loading branch information
opotowsky committed Dec 31, 2024
1 parent d0c3642 commit e89d08b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions armi/bookkeeping/db/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,8 +1394,9 @@ def getHistories(
# current time step and something has created the group to store aux data
continue

cycle = h5TimeNodeGroup.attrs["cycle"]
timeNode = h5TimeNodeGroup.attrs["timeNode"]
# might save as int or np.int64, so forcing int keeps things predictable
cycle = int(h5TimeNodeGroup.attrs["cycle"])
timeNode = int(h5TimeNodeGroup.attrs["timeNode"])
layout = Layout(
(self.versionMajor, self.versionMinor), h5group=h5TimeNodeGroup
)
Expand Down
3 changes: 2 additions & 1 deletion armi/bookkeeping/db/databaseInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ def getHistory(
if nowRequested:
for param in params or history.keys():
if param == "location":
history[param][now] = tuple(comp.spatialLocator.indices)
# might save as int or np.int64, so forcing int keeps things predictable
history[param][now] = tuple(int(i) for i in comp.spatialLocator.indices)
else:
history[param][now] = comp.p[param]

Expand Down

0 comments on commit e89d08b

Please sign in to comment.