Skip to content

Fix the problem when have negative number of points (Fix #273)#282

Merged
FanwangM merged 4 commits intotheochem:masterfrom
FanwangM:fix_cube2
Dec 8, 2025
Merged

Fix the problem when have negative number of points (Fix #273)#282
FanwangM merged 4 commits intotheochem:masterfrom
FanwangM:fix_cube2

Conversation

@FanwangM
Copy link
Copy Markdown
Contributor

@FanwangM FanwangM commented Dec 8, 2025

When the number of points is negative, it indicates the coordinate units are Bohr instead of Angstroms, https://gaussian.com/cubegen/. Therefore, I added this to the metadata and fixed the cube generation.

@FanwangM FanwangM requested review from Copilot and marco-2023 and removed request for Copilot December 8, 2025 05:01
@FanwangM FanwangM mentioned this pull request Dec 8, 2025
Copilot AI review requested due to automatic review settings December 8, 2025 13:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the handling of cube files with negative point numbers, which according to the Gaussian cube file format specification indicates that coordinates are in Bohr units rather than Angstroms. The implementation detects the unit system based on the sign of the shape values and adds this information to the returned metadata.

  • Adds logic to detect coordinate units (Bohr vs Angstrom) based on negative shape values
  • Takes absolute values of shape parameters to handle negative numbers correctly
  • Includes unit information in the returned cube_data dictionary

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@marco-2023 marco-2023 left a comment

Choose a reason for hiding this comment

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

@marco-2023 marco-2023 self-requested a review December 8, 2025 22:06
@FanwangM
Copy link
Copy Markdown
Contributor Author

FanwangM commented Dec 8, 2025

Thanks! @marco-2023

@FanwangM FanwangM merged commit a746f9f into theochem:master Dec 8, 2025
11 checks passed
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.

3 participants