-
Notifications
You must be signed in to change notification settings - Fork 18
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
Making n sub intervals a config class parameter #1090
base: main
Are you sure you want to change the base?
Making n sub intervals a config class parameter #1090
Conversation
Made n_sub_intervals an attribute for simulationConfigs and updated unit tests to include it.
@@ -111,6 +114,7 @@ def _validate_simulation_configs(self): | |||
self.ar_fov_buffer = cast_as_float(self.ar_fov_buffer, "ar_fov_buffer") | |||
self.ar_picket = cast_as_int(self.ar_picket, "ar_picket") | |||
self.ar_healpix_order = cast_as_int(self.ar_healpix_order, "ar_healpix_order") | |||
self.n_sub_intervals = cast_as_int_or_set_default(self.n_sub_intervals, "n_sub_intervals", 101) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't you just do
self.n_sub_intervals = 101 # we set this to a default 101?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthewholman any particular reason we hide the n_sub_intervals from the configuration file but all the healpix order to be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the latest updates we can expose to the user which is how @Little-Ryugu is implementing it but it would default to 101? If we keep it this way, @Little-Ryugu I don't think you need a new function is there a way to use cast_as_int or check if it's none (like the trailing loss flag which is only sometimes used) and then set the value to the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no reason to hide that from the user, as long as there is a default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this parameter so I can add it to the documentation @matthewholman ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was afraid you would ask. That is the number of sub-intervals used in evaluating a Lagrange interpolation function to make sure fast-movers are not missed. It's pretty arbitrary.
@@ -111,6 +114,7 @@ def _validate_simulation_configs(self): | |||
self.ar_fov_buffer = cast_as_float(self.ar_fov_buffer, "ar_fov_buffer") | |||
self.ar_picket = cast_as_int(self.ar_picket, "ar_picket") | |||
self.ar_healpix_order = cast_as_int(self.ar_healpix_order, "ar_healpix_order") | |||
self.n_sub_intervals = cast_as_int_or_set_default(self.n_sub_intervals, "n_sub_intervals", 101) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep the same format. I'd make the variable ar_n_sub_intervals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(edited above to fix my typo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions depending on what @matthewholman prefers
Renamed n_sub_intervals to ar_n_sub_intervals and set it's default value at the start instead of None. Also added the parameter to the log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Fixes #1079.
Changed n_sub_intervals in simulation_driver.py to be a config class parameter in simulationConfigs
Review Checklist for Source Code Changes