This could be in a model post-init pydantic validator for qcio objects with numpy arrays or perhaps could get set as a SerializableNDArray annotation?
Describe the solution you'd like
# Make numpy arrays immutable
>>> import numpy as np
>>> a = np.array([1,2,3])
>>> a.flags.writeable = False
>>> a[1] = 3
Traceback (most recent call last):
File "<python-input-7>", line 1, in <module>
a[1] = 3
~^^^
ValueError: assignment destination is read-only
This could be in a model post-init pydantic validator for qcio objects with numpy arrays or perhaps could get set as a
SerializableNDArrayannotation?Describe the solution you'd like