Fix issue with frozen Pmodels not being preserved by dipolarmodel.py and dd_* and bg_* imports are now copies#511
Open
HKaras wants to merge 5 commits intoJeschkeLab:mainfrom
Open
Conversation
stestoll
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was reported in #499 that, there seemed to be a bug that when a Pmodel with a frozen parameter is passed to dipolarmodel it is forgotten. However, by fixing this issue we cause problems as the base dd_* (bg_*) models are globals so the freezing the PModel affects the global not the local instance. In my opinion this is bad implementation.
To resolve this further problem I have modified how dd_* and bg_* models are imported so they now import as copies of the global. Resolving this issue, with no wider effects.
Closes #499