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

Moved to ordered collections #936

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Moved to ordered collections #936

merged 2 commits into from
Apr 11, 2024

Conversation

nucleosynthesis
Copy link
Contributor

Main fix needed is in ModelTools

setNuisPdf = set(setNuisPdf) -> setNuisPdf = list(dict.fromkeys((setNuisPdf)))

Nick Wardle added 2 commits April 11, 2024 12:05
Main fix needed is in ModelTools

`setNuisPdf = set(setNuisPdf)` -> `setNuisPdf = list(dict.fromkeys((setNuisPdf)))`
@anigamova anigamova merged commit b7dc99d into main Apr 11, 2024
6 checks passed
@nsmith-
Copy link
Collaborator

nsmith- commented Apr 11, 2024

FYI this will noticeably slow down text2workspace for large models, as the errline dictionary is very large. This was also seen in #791 as we tried to reduce the memory footprint.

@nsmith-
Copy link
Collaborator

nsmith- commented Apr 11, 2024

Also relevant is #759 (review)

@nucleosynthesis
Copy link
Contributor Author

nucleosynthesis commented Apr 11, 2024 via email

@nsmith-
Copy link
Collaborator

nsmith- commented Apr 11, 2024

I think that's a good plan, but perhaps more holistic solution is to refactor the parser along the lines of #818

@@ -808,7 +810,7 @@ def doFillNuisPdfsAndSets(self):
if p != "constr":
nuisVars.add(self.out.var(c_param_name))
setNuisPdf.append(c_param_name)
setNuisPdf = set(setNuisPdf)
setNuisPdf = list(dict.fromkeys((setNuisPdf)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I did a few tests, and it seems that this line (and line 826 below) changing the sets to an ordered type are enough for exact reproducibility of the fit values on the datacards where we saw the issue when recreating the workspace. Though it may be worth understanding this more clearly.

-- On the broader point I agree with your suggestion, @nsmith- it would be nice to make those kinds of changes.

@nucleosynthesis
Copy link
Contributor Author

nucleosynthesis commented Apr 12, 2024 via email

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.

4 participants