Skip to content

Reject negative unit-cell lengths in Timestep - #5537

Closed
swf1996120 wants to merge 1 commit into
MDAnalysis:developfrom
swf1996120:reject-negative-unitcell
Closed

swf1996120 wants to merge 1 commit into
MDAnalysis:developfrom
swf1996120:reject-negative-unitcell

Conversation

@swf1996120

Copy link
Copy Markdown

Problem

This fixes #5536. Timestep.dimensions accepted a negative unit-cell length. The stored dimensions then produced a zero triclinic matrix and zero volume, silently turning invalid periodic geometry into a degenerate box.

Fix

Normalize the input to a six-element float array and reject negative values in the first three length fields. The existing all-zero no-unit-cell sentinel remains supported.

Tests

Added regression coverage for negative finite and negative-infinite lengths. Existing zero-box behavior remains unchanged.

This was found during a chemical-repository testing study using physical unit-cell validity as the domain-specific invariant.

@read-the-docs-community

read-the-docs-community Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 MDAnalysis | 🛠️ Build #35508107 | 📁 Comparing d5e73e0 against latest (ae9ff4b)

  🔍 Preview build  

2 files changed
± index.html
± documentation_pages/analysis/wbridge_analysis.html

@swf1996120
swf1996120 force-pushed the reject-negative-unitcell branch from 03aaed8 to d5e73e0 Compare October 29, 2026 20:20
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.91%. Comparing base (ae9ff4b) to head (d5e73e0).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5537      +/-   ##
===========================================
- Coverage    93.92%   93.91%   -0.01%     
===========================================
  Files          184      184              
  Lines        22661    22661              
  Branches      3223     3223              
===========================================
- Hits         21284    21283       -1     
- Misses         917      918       +1     
  Partials       460      460              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@IAlibay IAlibay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swf1996120 - we require everyone to fill in the PR template especially the AI use section and having the developer certificate of origin declaration.

The former is made clear in our AI policy: https://github.com/MDAnalysis/mdanalysis/blob/develop/AI_POLICY.md#0-ai-usage-must-always-be-declared

Given this failure to follow policy, and your excessive pull requests across the open source ecosystem (e.g. openmm/openmm#5559 (comment)), I am going to block and close this PR.

@IAlibay IAlibay closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timestep.dimensions accepts negative unit-cell lengths

2 participants