Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add volume information in the cell tab #653

Merged
merged 3 commits into from
Dec 23, 2024

Conversation

superstar54
Copy link
Member

@superstar54 superstar54 commented Dec 23, 2024

Fix #652 .

Add volume information in the cell tab, the text depends on the periodic boundary condtion.

  • xyz -> Cell volume (ang^3)
  • xy -> Cell area (ang^2)
  • x -> Cell length (and)

As suggested by @cpignedoli , we use the function from orm.StructureData directly. Note, the cell tab is inside class _StructureDataBaseViewer, which uses ase.Atoms to store the structure, so we can not use StructureData.get_dimensionality directly, but use the private function _get_dimensionality. Even though it's a private function, I decided to use it so we get updated in the future automatically and do not re-write duplicate code.

@superstar54 superstar54 linked an issue Dec 23, 2024 that may be closed by this pull request
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.48%. Comparing base (0542daa) to head (3a9cf85).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
aiidalab_widgets_base/viewers.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #653   +/-   ##
=======================================
  Coverage   83.47%   83.48%           
=======================================
  Files          17       17           
  Lines        3558     3566    +8     
=======================================
+ Hits         2970     2977    +7     
- Misses        588      589    +1     
Flag Coverage Δ
python-3.11 83.48% <87.50%> (+<0.01%) ⬆️
python-3.9 83.52% <87.50%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Comment on lines 717 to 722
cell_labels = {
1: ["length", "Å"],
2: ["area", "Ų"],
3: ["volume", "ų"],
}
cell_label = cell_labels.get(dimension_data["dim"])
Copy link
Member

Choose a reason for hiding this comment

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

Consider defining CELL_LABELS outside to avoid redefining them

Copy link
Member

@edan-bainglass edan-bainglass left a comment

Choose a reason for hiding this comment

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

LGTM! Minor comment.

@superstar54 superstar54 merged commit 4bd8e2a into master Dec 23, 2024
11 checks passed
@superstar54 superstar54 deleted the feature/add_volume_in_cell_tab branch December 23, 2024 11:20
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.

Add volume in Å^3 in the cell tab
2 participants