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

DM-25016: Fix reading of QuantumGraph from pickle file #54

Merged
merged 1 commit into from May 24, 2020

Conversation

andy-slac
Copy link
Collaborator

When reading QuantumGraph from pickle DimensionUniverse instance must be
initialized, this fix makes registry instance before un-pickling which
creates all necessary instances. This trivial fix exposed an issue with
my dumb unit test that also needed proper fix.

Registry configuration for initialized registry database.
"""
with makeTmpFile() as filename:
uri = f"sqlite:///{filename}"
Copy link
Member

Choose a reason for hiding this comment

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

Does this have to be a file? Can't it be an in-memory sqlite?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In-memory does not work in this case, there is a discussion on JIRA about this issue. Basically if you want to open registry in read-only mode then you can't use in-memory because every session for in-memory sqlite makes it's own database which cannot be shared, and read-only database cannot be initialized with all the stuff that we need.

When reading QuantumGraph from pickle DimensionUniverse instance must be
initialized, this fix makes registry instance before un-pickling which
creates all necessary instances. This trivial fix exposed an issue with
my dumb unit test that also needed proper fix.
@andy-slac andy-slac merged commit ab3bd24 into master May 24, 2020
@andy-slac andy-slac deleted the tickets/DM-25016 branch September 11, 2020 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants