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

Use int minval instead -1 for invalid telescope ids in SubarrayDescription.tel_index_array, improve docstrings #2376

Merged
merged 3 commits into from Sep 8, 2023

Conversation

maxnoe
Copy link
Member

@maxnoe maxnoe commented Jul 5, 2023

-1 is a dangerous index for "invalid" since it will silently result in using the last element when used as index.

Replaced by using int minval, which will result in an IndexError and can be easily filtered by checking index >= 0.

Copy link
Contributor

@Tobychev Tobychev left a comment

Choose a reason for hiding this comment

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

A bit surprised you can change the sentinel value for missing data and not have to update any tests...

ctapipe/instrument/subarray.py Outdated Show resolved Hide resolved
@maxnoe
Copy link
Member Author

maxnoe commented Jul 7, 2023

@Tobychev the tests are failing currently....

@Tobychev
Copy link
Contributor

Tobychev commented Jul 7, 2023

@Tobychev the tests are failing currently....

Yeah, but it doesn't look like the failures are related to the changes? At least many look to be of the type "column 'ExtraTreesRegressor_energy' not found", but that looks unrelated to your changes?

@maxnoe maxnoe added this to the v0.20.0 milestone Sep 8, 2023
@maxnoe maxnoe merged commit e81ada3 into main Sep 8, 2023
12 checks passed
@maxnoe maxnoe deleted the missing_docs branch September 8, 2023 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants