ISISNeutronMuon / MDANSE

MDANSE: Molecular Dynamics Analysis for Neutron Scattering Experiments
https://www.isis.stfc.ac.uk/Pages/MDANSEproject.aspx
GNU General Public License v3.0
18 stars 4 forks source link

Numpy2 cleanup #481

Closed MBartkowiakSTFC closed 2 days ago

MBartkowiakSTFC commented 3 days ago

Description of work Since the release of Numpy 2.0.0, the MDANSE unit tests have been producing large numbers of DeprecationWarnings. This PR corrects this. There are still errors output by rdkit, but they don't seem to cause immediate problems, and we expect them to be solved by rdkit developers eventually.

closes #479

Fixes

  1. Removed the __array_wrap__ from IOutputVariable.
  2. Replaced numpy.row_stack with numpy.vstack.
  3. Corrected the code in MoleculeFinder which tried to access the trajectory HDF5 file directly, and not by using the methods of the Trajectory wrapper class.

To test All tests should pass without producing warnings. Try running MoleculeFinder on a trajectory without molecule labels, to see if the InChI strings are assigned as molecule labels by rdkit.