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

StoredDict is alternative to PersistentDict #30

Merged
merged 12 commits into from
Dec 5, 2024

Conversation

prjemian
Copy link
Collaborator

@qzhang234 : Your bug report pushed this along!

@prjemian prjemian added the bug Something isn't working label Nov 28, 2024
@prjemian prjemian self-assigned this Nov 28, 2024
@coveralls
Copy link

coveralls commented Nov 28, 2024

Pull Request Test Coverage Report for Build 12182630881

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 170 of 174 (97.7%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+4.5%) to 83.939%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/instrument/utils/stored_dict.py 83 84 98.81%
src/instrument/core/run_engine_init.py 5 8 62.5%
Files with Coverage Reduction New Missed Lines %
src/instrument/core/run_engine_init.py 1 85.0%
Totals Coverage Status
Change from base Build 11960738048: 4.5%
Covered Lines: 601
Relevant Lines: 716

💛 - Coveralls

Comment on lines 25 to 26
# MD_STORAGE_HANDLER: PersistentDict
# MD_PATH: HOME/.config/Bluesky_RunEngine_md'
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's go ahead and remove this if we don't need it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, we'll drop this as an alternative.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

see commit 96657d2

Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is just a test file should it not live inside the tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like it's there now.

except Exception as e:
handler = {
"PersistentDict": bluesky.utils.PersistentDict,
"StoredDict": StoredDict,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like we are instantiating the StoredDict class exclusively in this dictionary, however at no point are we passing arguments or using the class to do anything. Am I missing something

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here, the StoredDict replaces the default RE.md structure:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This commit 96657d2 makes this more obvious.

Make StoredDict the default.

Keep the code that handles PersistentDict as an option, in case someone wants to use it.

Add usage documentation about the MD_PATH.
@prjemian prjemian requested a review from MDecarabas December 5, 2024 15:15
@prjemian
Copy link
Collaborator Author

prjemian commented Dec 5, 2024

@MDecarabas All your review comments are addressed. Please review again.

@prjemian prjemian merged commit fb2890b into main Dec 5, 2024
5 checks passed
@prjemian prjemian deleted the 14-PersistentDict-alternative branch December 5, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider alternatives to PersistentDict
3 participants