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

Refactor overlays to be classes instead of dicts #1141

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

psavery
Copy link
Collaborator

@psavery psavery commented Jan 26, 2022

The overlay dicts have become more and more complicated as time has
gone on, and new synchronizations between their values and other
parts of the program (such as the image series) have made them even
more complicated to maintain.

As such, it has become a good time to convert them to be classes
instead of dicts, where the classes can internally keep up with any
synchronizations that are needed.

This will also hopefully fix a bug we were encountering where an
overlay was being modified to have a refinements list from another
overlay. This shouldn't be possible with objects.

There is a new format for serializing the overlays, but backward
compatible readers are also now used so that the transition is
seamless.

Since the overlays are used in many, many parts of the code, we
really need to do some thorough testing to find and fix any bugs
this refactoring may cause.

@psavery psavery force-pushed the overlay-refactor branch 2 times, most recently from bf9fe9d to 9602782 Compare January 31, 2022 21:50
@psavery
Copy link
Collaborator Author

psavery commented Jan 31, 2022

I've tested several different workflows with this PR, and so far, things seem to be working fine.

I think it will be ready for merging after our next release (don't want to merge it before the next release in case it introduces new bugs).

The overlay dicts have become more and more complicated as time has
gone on, and new synchronizations between their values and other
parts of the program (such as the image series) have made them even
more complicated to maintain.

As such, it has become a good time to convert them to be classes
instead of dicts, where the classes can internally keep up with any
synchronizations that are needed.

This will also hopefully fix a bug we were encountering where an
overlay was being modified to have a refinements list from another
overlay. This shouldn't be possible with objects.

There is a new format for serializing the overlays, but backward
compatible readers are also now used so that the transition is
seamless.

Since the overlays are used in many, many parts of the code, we
really need to do some thorough testing to find and fix any bugs
this refactoring may cause.

Signed-off-by: Patrick Avery <[email protected]>
@psavery psavery marked this pull request as ready for review February 3, 2022 20:20
@psavery
Copy link
Collaborator Author

psavery commented Feb 3, 2022

This is ready as long as the last hexrdgui release is in good shape.

@joelvbernier joelvbernier self-requested a review February 4, 2022 21:54
@joelvbernier joelvbernier merged commit bd5d98b into HEXRD:master Feb 4, 2022
@psavery psavery deleted the overlay-refactor branch February 11, 2022 17:26
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.

2 participants