Skip to content

Fix validation of model parameters using schemas. #1302

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

Merged
merged 5 commits into from
Jan 9, 2025

Conversation

GernotMaier
Copy link
Contributor

The validation of model parameters using schema generates several errors (see #1301).

This PR fixes those:

  • correct handling of "value": null cases (values are None)
  • correct handling of booleans (values where wrongly converted to int along the way in the code)
  • incomplete effective focal length schema description (added 4 additional columns)
  • fix getting of column type description for cases where the schema file has one single entry to describe several entries of identical type (as e.g., in nsb_pixel_rate)

Closes #1301

@GernotMaier GernotMaier requested a review from Copilot January 9, 2025 15:52
@GernotMaier GernotMaier self-assigned this Jan 9, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/simtools/data_model/validate_data.py:199

  • Returning [None] in case of TypeError might mask other issues. Consider handling the error more specifically.
return [None], target_unit

This comment has been minimized.

1 similar comment
Copy link

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage 83.30% Coverage (93.20% Estimated after merge)
  • Duplications 0.00% Duplicated Code (0.00% Estimated after merge)

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

@GernotMaier GernotMaier marked this pull request as ready for review January 9, 2025 16:50
- description: |-
Any displacement along x in the focal plane from asymmetric PSF behavior.
type: double
unit: cm
Copy link
Collaborator

Choose a reason for hiding this comment

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

should here and in the following be a allowed range?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the displacement does not have a limit (there is obviously a limit given by the size of the telescopes).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok all good then, thanks!

@GernotMaier
Copy link
Contributor Author

Thanks @tobiaskleiner !

@GernotMaier GernotMaier merged commit b2074a4 into main Jan 9, 2025
15 of 16 checks passed
@GernotMaier GernotMaier deleted the validate-model-parameters-from-directory branch January 9, 2025 18:19
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.

Validation of model parameters using schema broken
2 participants