-
Notifications
You must be signed in to change notification settings - Fork 3
Overwrite parameters in model utils #1960
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
base: main
Are you sure you want to change the base?
Conversation
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
|
Following updates:
|
|
Note that this type of repetitive changes is what we want do avoid in future using the general settings configuration. I will implement this in a follow-up PR - should remove the many passed on parameters. |
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.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
src/simtools/model/model_utils.py:40
- The docstring for
initialize_simulation_modelsis missing documentation for the newoverwrite_model_parametersparameter. Please add a description of this parameter to the Parameters section of the docstring, including its type and purpose.
def initialize_simulation_models(
label,
model_version,
site,
telescope_name,
calibration_device_name=None,
overwrite_model_parameters=None,
):
"""
Initialize simulation models for a single telescope, site, and calibration device model.
Parameters
----------
label: str
Label for the simulation.
model_version: str
Version of the simulation model
site: str
Name of the site.
telescope_name: str
Name of the telescope.
calibration_device_name: str, optional
Name of the calibration device.
Returns
-------
Tuple
Tuple containing the telescope site, (optional) calibration device model.
"""
src/simtools/applications/validate_cumulative_psf.py:140
- This call to
overwrite_parameters_from_fileappears to be redundant. TheModelParameterbase class (whichTelescopeModelinherits from) automatically callsoverwrite_parameters_from_filein_load_parameters_from_dbifoverwrite_model_parametersis provided during initialization. Sincetel_modelis initialized withoverwrite_model_parametersat line 136, the parameters should already be overwritten.
if app_context.args.get("overwrite_model_parameters"):
tel_model.overwrite_parameters_from_file(app_context.args["overwrite_model_parameters"])
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
GernotMaier
left a comment
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.
Not worried about the missing coverage in the plotting routines.
|
@orelgueta - I cannot add you as a reviewer (as you opened the PR) - please have a look. |


This PR is just a working example for overwriting parameters also when using
model_utilsto setup a model, in particular in the context of validate optics. It is clearly not complete, but I needed these changes to get it to work. Adding a couple of tests should be enough I think.In addition to that change, also the propagation of the model version into the plot of incidence angle snuck in to this PR. That is not a necessity, it was needed just to make the plot comparison easier in a different study. If you don't find it useful, please feel free to remove it.