Implementing TRR/XTC support
Currently Biotite requires MDTraj as additional dependency only for reading coordinates from trajectory files. However, MDTraj does not support NumPy 2.0, yet, but Biotite 1.0 will require NumPy 2.0. Therefore we could think about removing the dependency by implementing at least the common trajectory file formats .trr and .xtc. Lowering the number of dependencies would also make Biotite more lightweight.
To resolve this issue,
- the
TrajectoryFileclasses need to be removed, - new trajectory file classes need to be added implementing
.trrand.xtc(maybe instructure.io.trr?) and - the consistency tests checking against MDTraj need to be removed (could be solved by checking against a fixed CSV file obtained once from MDTraj).
~Taking verbatim code from https://github.com/mdtraj/mdtraj is not possible due to the incompatible license.~
As the xdrfile C-library is also GPL licensed, the entire Trajectory code would need to go into a separate extension package, if we decide to drop the MDTraj dependency.
I reached out to the MDTraj developers, asking them about their NumPy 2.0 migration plans: https://github.com/mdtraj/mdtraj/issues/1873#issuecomment-2197294604
#529 temporarily disables trajectory functionalites: https://github.com/biotite-dev/biotite/pull/529/commits/d6ea5069454dbdf2f64b7f49dc0eeb5448889b86
After implementation if this issue, they need to be reenabled.
Additionally, the two other common trajectory formats, netCDF and DCD, are also supported now with biotraj. I would change the PR title ("Implementing trajectory I/O support without MDTraj" perhaps?), if you're fine with this.
Biotraj will directly work as a "drop-in replacement" for MDTraj in Biotite, so changes should remain limited to the documentation, tests and the specific py-files for these formats.
@JHKru Could you comment in https://github.com/conda-forge/staged-recipes/pull/27312, that I can add you as Conda package maintainer?
Closed via #627