You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Timestep.dimensions accepts NaN and infinity unit-cell values #5534
Chemical repository testing study: Timestep.dimensions accepts non-finite unit cells
I am testing MDAnalysis as part of a chemical repository testing study. The scenario-conditioned test assigns boundary unit-cell values and checks that periodic trajectory operations receive a valid six-parameter unit cell.
All three assignments are accepted. u.dimensions retains the non-finite value and periodic wrapping proceeds with an invalid box (for example, an infinite edge produces coordinates containing NaN).
Expected behavior
Assigning a unit cell with NaN or infinity should raise ValueError immediately. The existing None/all-zero representation for an absent box and finite lower-dimensional behavior remain unaffected.
I searched existing MDAnalysis issues for NaN, infinite, and non-finite unit-cell dimensions and did not find a matching report. A focused Cython setter patch and regression tests are included in the companion pull request.
Setting dimensions is typically only done in specific circumstances so I am honestly not overly worried if in these cases users are doing crazy things. Internally, dimensions should always be set with legal values.
I'll leave the issue open for documentation purposes but it really is not a priority to address until users report that it's a problem.
Activity
mrunalC27 commentedon Nov 9, 2026
Can I work on this issue?
orbeckst commentedon Nov 13, 2026
Setting dimensions is typically only done in specific circumstances so I am honestly not overly worried if in these cases users are doing crazy things. Internally, dimensions should always be set with legal values.
I'll leave the issue open for documentation purposes but it really is not a priority to address until users report that it's a problem.