Skip to content

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
HKaras:BugFix_Pmodel_freezing
Open

Fix issue with frozen Pmodels not being preserved by dipolarmodel.py and dd_* and bg_* imports are now copies#511
HKaras wants to merge 5 commits intoJeschkeLab:mainfrom
HKaras:BugFix_Pmodel_freezing

Conversation

@HKaras
Copy link
Copy Markdown
Member

@HKaras HKaras commented Apr 13, 2026

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

@HKaras HKaras self-assigned this Apr 13, 2026
@HKaras HKaras added the bugfix Patches something that isn't working label Apr 13, 2026
@HKaras HKaras requested a review from stestoll April 13, 2026 16:08
@HKaras HKaras marked this pull request as draft April 14, 2026 05:37
@HKaras HKaras removed the request for review from stestoll April 14, 2026 05:37
@HKaras HKaras added the fundamental An issue with fundamental concepts or problems label Apr 14, 2026
@HKaras HKaras changed the title Fix issue with frozen Pmodels not being preserved by dipolarmodel.py Fix issue with frozen Pmodels not being preserved by dipolarmodel.py and dd_* and bg_* imports are now copies Apr 14, 2026
@HKaras HKaras marked this pull request as ready for review April 14, 2026 06:00
@HKaras HKaras requested a review from stestoll April 14, 2026 06:00
@HKaras HKaras added this to the v1.2 milestone Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Patches something that isn't working fundamental An issue with fundamental concepts or problems

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameter freezing not working with dd_gauss

2 participants