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

Clean up dependencies #666

Merged
merged 14 commits into from
Sep 9, 2022
Merged

Clean up dependencies #666

merged 14 commits into from
Sep 9, 2022

Conversation

munrojm
Copy link
Member

@munrojm munrojm commented Sep 1, 2022

  • custodian, mpcontribs-client, boto3, and emmet-core[all] made optional dependencies
  • AlloyRester import altered with warning to handle when pymatgen-analysis-alloys is not installed via emmet-core

@munrojm munrojm added the release:minor Minor release bump label Sep 1, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2022

Codecov Report

Merging #666 (f00c427) into main (9ec0a9d) will decrease coverage by 1.37%.
The diff coverage is 55.88%.

@@            Coverage Diff             @@
##             main     #666      +/-   ##
==========================================
- Coverage   87.10%   85.73%   -1.38%     
==========================================
  Files          37       37              
  Lines        1559     1619      +60     
==========================================
+ Hits         1358     1388      +30     
- Misses        201      231      +30     
Impacted Files Coverage Δ
mp_api/client/routes/alloys.py 58.82% <ø> (-2.29%) ⬇️
mp_api/client/core/utils.py 57.69% <53.33%> (-29.81%) ⬇️
mp_api/client/client.py 68.55% <58.33%> (-0.57%) ⬇️
mp_api/client/routes/__init__.py 88.88% <60.00%> (-11.12%) ⬇️
mp_api/client/core/client.py 88.66% <100.00%> (-0.04%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@munrojm
Copy link
Member Author

munrojm commented Sep 2, 2022

@mkhorton and @tschaume, I have added these warnings on instantiation should boto3 and pymatgen-analysis-alloys not be installed:

 UserWarning: Alloy addon package not installed. To query alloy data install the pymatgen-analysis-alloys package.
 UserWarning: boto3 not installed. To query charge density data install the boto3 package.

I also raise an MPRestError with the get_charge_density_from_material_id method if it is called without having boto3.

Furthermore, I have added a custom __getattr__ method which is called when python cannot resolve an attribute (e.g. MPRester.alloys and MPRester.charge_density), and have included the same warning messages above as MPRestError exceptions.

Want to make sure we are on the same page before I merge anything. Let me know if you have any thoughts.

Copy link
Member

@tschaume tschaume left a comment

Choose a reason for hiding this comment

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

@munrojm looks good overall. Left a few minor comments for your consideration.

mp_api/client/client.py Show resolved Hide resolved
mp_api/client/client.py Show resolved Hide resolved
mp_api/client/routes/__init__.py Outdated Show resolved Hide resolved
mp_api/client/routes/__init__.py Outdated Show resolved Hide resolved
@munrojm
Copy link
Member Author

munrojm commented Sep 7, 2022

@mkhorton, I am going to merge this unless you have an issue with anything.

@munrojm munrojm merged commit 7b9b3e1 into main Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:minor Minor release bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants