Functional testing
Lessons learned
Numpy copy=False
Problems resulting in ValueError: Unable to avoid copy while creating an array as requested.
In general replace numpy copy=False with copy=None or remove it. Or else replace with np.asarray(...). See https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.
np.in1d is deprecated
Replace np.in1d with np.isin.
change in np.broadcast_arrays
The return type of np.broadcast_arrays used to be a list, and in numpy 2 it is a tuple. One fix is to just cast the output to a list.
change in numpy repr
repr() now includes the numpy type in the output string for numpy types.
Functional testing
Lessons learned
Numpy
copy=FalseProblems resulting in
ValueError: Unable to avoid copy while creating an array as requested.In general replace numpy
copy=Falsewithcopy=Noneor remove it. Or else replace withnp.asarray(...). See https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.np.in1d is deprecated
Replace np.in1d with np.isin.
change in np.broadcast_arrays
The return type of np.broadcast_arrays used to be a list, and in numpy 2 it is a tuple. One fix is to just cast the output to a list.
change in numpy repr
repr() now includes the numpy type in the output string for numpy types.