Skip to content

Commit

Permalink
Set writable flag after converting to MetadataArray
Browse files Browse the repository at this point in the history
  • Loading branch information
thalassemia committed Dec 8, 2024
1 parent 053d03c commit 7c2ff81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ecoli/library/json_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def numpy_molecules(states):
dtypes = ast.literal_eval(dtypes)
unique_tuples = [tuple(mol) for mol in states["unique"][key]]
unique_arr = np.array(unique_tuples, dtype=dtypes)
unique_arr.flags.writeable = False
states["unique"][key] = MetadataArray(
unique_arr,
unique_arr["unique_index"].max() + 1,
)
states["unique"][key].flags.writeable = False
if "environment" in states:
if "exchange_data" in states["environment"]:
states["environment"]["exchange_data"]["constrained"] = {
Expand Down

0 comments on commit 7c2ff81

Please sign in to comment.