Skip to content

Add trajectory appending to Universe #3875

@orbeckst

Description

@orbeckst

Is your feature request related to a problem?

At the moment, one can only load trajectory data

  1. when creating the Universe
  2. with Universe.load_new() which replaces the current trajectory data

Describe the solution you'd like

u.load_append(FILENAME)

to extend the current trajectory with the one in FILENAME. (Or load_next() for better grammar.)

This would perhaps change u.trajectory to a ChainReader. Special care would need to be taken for MemoryReader (in-memory trajectories). Auxiliaries would also require an appending mechanism.

Describe alternatives you've considered

Make a new Universe

u2 = Universe(u.filename, [u.trajectory.filename, FILENAME])

It is not clear how important appending functionality is in practice. The alternative is feasible but not obvious, especially when users are presented with Universe.load_new(), they may naturally ask where load_next() or load_append() is.

Additional context

Somewhat related to #3861

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions