-
Notifications
You must be signed in to change notification settings - Fork 40
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
Update client.py #418
Update client.py #418
Conversation
For materials with no valid charge density task_id like `mp-1104953` the current version gets an empty list at line 756 then errors out at the sorting step. This change should fix that. Also, I think it makes sense to return `None` here since we are not guaranteeing every single charge density.
Codecov Report
@@ Coverage Diff @@
## main #418 +/- ##
==========================================
- Coverage 92.61% 92.56% -0.05%
==========================================
Files 63 63
Lines 2031 2032 +1
==========================================
Hits 1881 1881
- Misses 150 151 +1
Continue to review full report at Codecov.
|
@@ -755,11 +761,16 @@ def get_charge_density_from_material_id(self, material_id: str) -> Optional[Chgc | |||
) | |||
results = self.charge_density.search(task_ids=task_ids) |
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.
This can return empty sometimes
d8598f1
to
bb24955
Compare
Thanks @jmmshn ! |
Thanks! Sorry missed the review request until now |
For materials with no valid charge density task_id like
mp-1104953
the current version gets an empty list at line 756 then errors out at the sorting step.This change should fix that. Also, I think it makes sense to return
None
here since we are not guaranteeing every single charge density.