Skip to content

FIX: Reject negative unit cell lengths - #5544

Open
mrunalC27 wants to merge 1 commit into
MDAnalysis:developfrom
mrunalC27:fix-negative-timestep-dimensions
Open

mrunalC27 wants to merge 1 commit into
MDAnalysis:developfrom
mrunalC27:fix-negative-timestep-dimensions

Conversation

@mrunalC27

Copy link
Copy Markdown

Fixes #5536

Changes made in this Pull Request:

  • Reject negative unit-cell lengths when setting Timestep.dimensions.
  • Validate the dimensions array before modifying the existing unit cell.
  • Add regression tests covering negative lengths, negative infinity, and preservation of previous dimensions after invalid input.

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: yes

PR Checklist

Developers Certificate of Origin

I certify that I can submit this code contribution as described in the [Developer Certificate of Origin](https://developercertificate.org/), under the MDAnalysis [LICENSE](https://github.com/MDAnalysis/mdanalysis/blob/develop/LICENSE).

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 MDAnalysis | 🛠️ Build #35778933 | 📁 Comparing c466015 against latest (bd5aa91)

  🔍 Preview build  

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

@orbeckst orbeckst 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.

As I said in the issue report, checking input validity for dimensions is low priority. It's likely that reviewers will look at other PRs first.

If we want to consider input checks then we probably would want to address all related issues in one go.

There's also an ongoing discussion about typing #5543 that may be relevant and possibly solve some of the listed issues.

This branch has not been deployed

No deployments
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