Skip to content

Commit 35f754e

Browse files
authored
Numpy 2.3 fix (tostring -> tobytes) (#793)
1 parent 271f0b0 commit 35f754e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openmmtools/multistate/multistatereporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ def read_dict(self, path: str) -> Union[dict, Any]:
10911091
if nc_element.dtype == 'S1':
10921092
# Handle variables stored in fixed_dimensions
10931093
data_chars = nc_element[:]
1094-
data_str = data_chars.tostring().decode()
1094+
data_str = data_chars.tobytes().decode()
10951095
else:
10961096
data_str = str(nc_element[0])
10971097
data = yaml.load(data_str, Loader=_DictYamlLoader)

openmmtools/tests/test_sampling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def decompact_state_variable(variable):
584584
if variable.dtype == "S1":
585585
# Handle variables stored in fixed_dimensions
586586
data_chars = variable[:]
587-
data_str = data_chars.tostring().decode()
587+
data_str = data_chars.tobytes().decode()
588588
else:
589589
data_str = str(variable[0])
590590
return data_str

0 commit comments

Comments
 (0)