-
Notifications
You must be signed in to change notification settings - Fork 18
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
Conversation
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
aiidalab_widgets_base/viewers.py
Outdated
cell_labels = { | ||
1: ["length", "Å"], | ||
2: ["area", "Ų"], | ||
3: ["volume", "ų"], | ||
} | ||
cell_label = cell_labels.get(dimension_data["dim"]) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Minor comment.
Fix #652 .
Add volume information in the cell tab, the text depends on the periodic boundary condtion.
As suggested by @cpignedoli , we use the function from
orm.StructureData
directly. Note, the cell tab is inside class_StructureDataBaseViewer
, which usesase.Atoms
to store the structure, so we can not useStructureData.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.