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

Store.connect: fix force_reset kwarg implementations #879

Merged
merged 5 commits into from
Nov 4, 2023

Conversation

rkingsbury
Copy link
Collaborator

@rkingsbury rkingsbury commented Oct 31, 2023

Summary

This PR increases the consistency of force_reset kwarg in Store.connect() across Store classes. It was motivated by an observation that on systems with slow storage, connecting to a JSONStore can take a long time. If one has already connected to the Store, a subsequent call to connect (with force_reset=False) should not cause the entire connection process to repeat.

This PR enforces the paradigm that we don't need to re-instantiate clients, reset ssh tunnels, or re-read data files if a store has already connected and force_reset=False.

Checklist

  • Google format doc strings added.
  • Code linted with ruff. (For guidance in fixing rule violates, see rule list)
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.

@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (09f75e2) 87.78% compared to head (2bd123f) 87.76%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #879      +/-   ##
==========================================
- Coverage   87.78%   87.76%   -0.03%     
==========================================
  Files          44       44              
  Lines        3610     3612       +2     
==========================================
+ Hits         3169     3170       +1     
- Misses        441      442       +1     
Files Coverage Δ
src/maggma/stores/compound_stores.py 81.46% <100.00%> (+0.10%) ⬆️
src/maggma/stores/file_store.py 97.40% <100.00%> (ø)
src/maggma/stores/mongolike.py 87.40% <100.00%> (-0.24%) ⬇️
src/maggma/stores/shared_stores.py 94.11% <ø> (ø)
src/maggma/stores/gridfs.py 94.11% <66.66%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rkingsbury rkingsbury changed the title JSONStore: fix force_reset implementation; docstring Store.connect: fix force_reset kwarg implementations Nov 4, 2023
@rkingsbury rkingsbury merged commit 62e6a2e into materialsproject:main Nov 4, 2023
9 of 10 checks passed
@rkingsbury rkingsbury deleted the reset branch November 4, 2023 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant