-
Notifications
You must be signed in to change notification settings - Fork 13
Reading lockfiles if specified in the runcard #818
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1068,7 +1068,11 @@ def produce_rules( | |||||||||||||||||||||||
| if use_cuts is not CutsPolicy.INTERNAL: | ||||||||||||||||||||||||
| return None | ||||||||||||||||||||||||
| if default_filter_rules_recorded_spec_ is not None: | ||||||||||||||||||||||||
| # For when using a lockfile as a runcard | ||||||||||||||||||||||||
| filter_rules = default_filter_rules_recorded_spec_[default_filter_rules] | ||||||||||||||||||||||||
| elif default_filter_rules is not None: | ||||||||||||||||||||||||
| # For when a rules spec is specified | ||||||||||||||||||||||||
| filter_rules = self.load_default_default_filter_rules(default_filter_rules) | ||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||
| filter_rules = default_filter_rules_input() | ||||||||||||||||||||||||
|
Comment on lines
+1069
to
1073
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Am I right in thinking that these filter rules in if so I really think this block should be (please double check indents are correct, editing on github is horrible):
Suggested change
If the defaults are not the same then make a legacy defaults lockfile and read that instead. That way if the defaults ever get changed then the lockfile still contains a record of what they were at the time.Also in the future we can change the default to be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean The way I thought it was meant to be was that we have a copy of the 3.1 rules, but the current iteration of the rules is always in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it? I did a hasty print and they looked slightly different but I didn't bother working out how (the prints were different lengths). I don't see the advantage to have some defaults loaded outside of the lockfile system when you have implemented the lockfile system. If I run a report where I use cuts internal but don't specify the set of defaults to use then it falls back on this. But those defaults never get saved to the lockfile for that particular report. So in the future if anybody ever edits Also if you use lockfiles to load the fallback option then you can even change what the fallback option is (now it's 3.1 maybe but in the future could be something else) but all lockfiles will still tell you exactly what set of rules were used at the time.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yes they're actually different because some datasets were being added as we moved towards 4.0. Okay I'll commit this suggestion, my heads a bit of a spin with the amount of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah makes sense. Where should we specify the fallback default then? Some sort of global variable?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, when would
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ugh this quickly gets messy and confusing and my suggestion above still isn't the right way to do things. I think the best demonstration of how to do the fallback is with the
Just to reiterate, the defaults associated with the fallback value of A minor comment is that the files from which the defaults are being loaded from i.e
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @Zaharid |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -1148,12 +1152,17 @@ def produce_defaults( | |||||||||||||||||||||||
| raise ConfigError("w2min defined multiple times with different values") | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if default_filter_settings_recorded_spec_ is not None: | ||||||||||||||||||||||||
| # If running on a lockfile | ||||||||||||||||||||||||
| filter_defaults = default_filter_settings_recorded_spec_[ | ||||||||||||||||||||||||
| default_filter_settings | ||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||
| # If we find recorded specs return immediately and don't read q2min and w2min | ||||||||||||||||||||||||
| # from runcard | ||||||||||||||||||||||||
| return filter_defaults | ||||||||||||||||||||||||
| elif default_filter_settings is not None: | ||||||||||||||||||||||||
| # If the user requests to read from a pre existing settings lockfile | ||||||||||||||||||||||||
| filter_defaults = self.load_default_default_filter_settings(default_filter_settings) | ||||||||||||||||||||||||
| defaults_loaded = True | ||||||||||||||||||||||||
| elif not filter_defaults: | ||||||||||||||||||||||||
| filter_defaults = default_filter_settings_input() | ||||||||||||||||||||||||
| defaults_loaded = True | ||||||||||||||||||||||||
|
Comment on lines
+1166
to
1172
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise. Let's keep a record of all the defaults. |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.