materialsproject / maggma

MongoDB aggregation machine
https://materialsproject.github.io/maggma/
Other
38 stars 31 forks source link

MongograntStore: make optional dependency, prepare for removal #950

Closed rkingsbury closed 3 months ago

rkingsbury commented 4 months ago

Summary

As discussed in #928

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 81.25%. Comparing base (1fc0e33) to head (dba6cbe). Report is 11 commits behind head on main.

:exclamation: Current head dba6cbe differs from pull request most recent head 4b62290

Please upload reports for the commit 4b62290 to get more accurate results.

Files Patch % Lines
src/maggma/stores/advanced_stores.py 71.42% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #950 +/- ## ========================================== - Coverage 81.33% 81.25% -0.09% ========================================== Files 46 46 Lines 3971 3974 +3 ========================================== - Hits 3230 3229 -1 - Misses 741 745 +4 ```

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

rkingsbury commented 4 months ago

Does this look OK to you @munrojm ? I agree with your comment that we should probably remove MongograntStore eventually. This will pave the way.

rkingsbury commented 3 months ago

@munrojm I think this is good to go. In my local testing both warnings behave as expected. I'll probably merge later today unless you have objections.

>>> from maggma.stores import MongograntStore
>>> mgs=MongograntStore()
<stdin>:1: FutureWarning: MongograntStore is deprecated; use MongoStore in maggma.stores.mongolike instead.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ryan/miniconda3/envs/skagit2/lib/python3.10/site-packages/monty/dev.py", line 132, in new_init
    original_init(self, *args, **kwargs)
  File "/home/ryan/miniconda3/envs/skagit2/lib/python3.10/site-packages/monty/dev.py", line 199, in decorated
    raise self.err_cls(self.message)
RuntimeError: mongogrant is required to use MongoGrantStore. Please run `pip install maggma[mongogrant]
>>>