Skip to content

Multi-file trajectory paths not handled during save/load relativization #1113

@BradyAJohnston

Description

@BradyAJohnston

MDAnalysis supports universes created with multiple coordinate files (e.g. mda.Universe(top, [traj1.xtc, traj2.xtc, traj3.xtc])). The current path relativization in session.py only converts traj.universe.trajectory.filename (singular), so only one file path gets relativized during save. Any additional trajectory files would retain absolute paths and break when the folder is moved.

This isn't an issue for the GUI today since it only supports loading a single trajectory file, but it affects API users who create multi-file universes.

Expected behavior

All coordinate file paths associated with a trajectory should be relativized on save and restored to absolute on load.

Context

Flagged by @PardhavMaradani during the #1088 discussion. Low priority since the GUI doesn't expose multi-file trajectories, but worth tracking for API completeness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIRelated to internal and external APIbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions