Skip to content

Commit

Permalink
Convert numpy arrays to ASCII strings
Browse files Browse the repository at this point in the history
  • Loading branch information
brryan committed Oct 12, 2023
1 parent 8b8ab7f commit 0a86636
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion external/Catch2
Submodule Catch2 updated 137 files
2 changes: 1 addition & 1 deletion external/Kokkos
Submodule Kokkos updated 1241 files
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ def __init__(self, filename):
else:
self.Params = None

# If strings are converted to numpy arrays of ASCII values, convert back to
# strings
for key in self.Params.keys():
val = self.Params[key]
if type(val) is type(np.zeros(0)):
val_str = ''.join([chr(c) for c in val])
self.Params[key] = val_str

# Read in coordinates
def load_coord(coord_i):
coord_name = ["x", "y", "z"][coord_i]
Expand Down

0 comments on commit 0a86636

Please sign in to comment.