materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
105 stars 34 forks source link

Lazy loading and caching #842

Closed munrojm closed 10 months ago

munrojm commented 10 months ago

Adds lazy loading of resters alongside some caching to greatly speed up instantiation of MPRester.

codecov-commenter commented 10 months ago

Codecov Report

Patch coverage: 91.66% and project coverage change: +0.45% :tada:

Comparison is base (7109a44) 69.90% compared to head (40464e1) 70.36%. Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #842 +/- ## ========================================== + Coverage 69.90% 70.36% +0.45% ========================================== Files 51 51 Lines 2429 2480 +51 ========================================== + Hits 1698 1745 +47 - Misses 731 735 +4 ``` | [Files Changed](https://app.codecov.io/gh/materialsproject/api/pull/842?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject) | Coverage Δ | | |---|---|---| | [mp\_api/client/routes/materials/\_\_init\_\_.py](https://app.codecov.io/gh/materialsproject/api/pull/842?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-bXBfYXBpL2NsaWVudC9yb3V0ZXMvbWF0ZXJpYWxzL19faW5pdF9fLnB5) | `88.23% <ø> (-0.34%)` | :arrow_down: | | [mp\_api/client/mprester.py](https://app.codecov.io/gh/materialsproject/api/pull/842?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-bXBfYXBpL2NsaWVudC9tcHJlc3Rlci5weQ==) | `65.74% <87.50%> (+0.68%)` | :arrow_up: | | [mp\_api/client/routes/materials/materials.py](https://app.codecov.io/gh/materialsproject/api/pull/842?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-bXBfYXBpL2NsaWVudC9yb3V0ZXMvbWF0ZXJpYWxzL21hdGVyaWFscy5weQ==) | `77.66% <96.96%> (+9.09%)` | :arrow_up: | | [mp\_api/client/core/client.py](https://app.codecov.io/gh/materialsproject/api/pull/842?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-bXBfYXBpL2NsaWVudC9jb3JlL2NsaWVudC5weQ==) | `82.79% <100.00%> (ø)` | | | [mp\_api/client/core/utils.py](https://app.codecov.io/gh/materialsproject/api/pull/842?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-bXBfYXBpL2NsaWVudC9jb3JlL3V0aWxzLnB5) | `61.81% <100.00%> (+1.44%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.