Skip to content

Timestep.dimensions accepts impossible or non-finite unit-cell angles #5538

Open

Description

@swf1996120

Chemical repository testing study: this report was found by an LLM-assisted boundary and invariant-testing pass over MDAnalysis unit-cell geometry. I reproduced and minimized the behavior locally and searched existing issues before filing.

Summary

Timestep.dimensions accepts impossible or non-finite triclinic angles. Values such as 0°, 180°, or NaN are stored without validation; converting the box to triclinic vectors then produces NaN/invalid geometry.

Reproducer

import MDAnalysis as mda
import numpy as np

u = mda.Universe.empty(1, trajectory=True)
for angles in ([0, 90, 90], [180, 90, 90], [np.nan, 90, 90]):
    u.trajectory.ts.dimensions = [10, 10, 10, *angles]
    print(angles, u.trajectory.ts.dimensions,
          u.trajectory.ts.triclinic_dimensions)

Observed with MDAnalysis 2.11.0: all inputs are accepted; invalid angles propagate into the computed triclinic cell. A unit-cell angle must be strictly between 0° and 180° and finite.

Expected behavior

Raise ValueError when any of the three unit-cell angles is non-finite or outside (0, 180).

Validation

A focused patch and regression tests are available on branch reject-invalid-unitcell-angles in my fork.

Activity

  1. RitikaSen27 commented on Nov 2, 2026

    @RitikaSen27

    @swf1996120 hello,can i work on this issue?

  2. orbeckst commented on Nov 13, 2026

    @orbeckst
    Member

    See my comments on related issues #5536 and #5534 — until we get real user reports that this is a problem, we won't use resources to address it.

    I'll leave the issue open for documentation purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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