cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
62 stars 266 forks source link

Add a note to CameraGeometry docs about from_name() #2485

Closed kosack closed 3 months ago

kosack commented 6 months ago

Note that from_name() is not guaranteed to correspond with event data.

Closes #2484

maxnoe commented 6 months ago

camera_types is a set, you can't Index it

maxnoe commented 6 months ago

Can we (also?) raise an actual code warning?

i.e.:

warnings.warn(".from_name methods use pre-defined data that is likely different from the data being analyzed. Access instrument information via the SubarrayDescription instead.")
maxnoe commented 5 months ago

The docs failure here is real and due to the changes made

maxnoe commented 3 months ago

@kosack, I added the actual warning now to those methods and made it fail the CI if it occurs unexpectedly.

It's your PR, so you cannot really approve, but please have a look.

@Tobychev please review again :)

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.54%. Comparing base (163b543) to head (a9cf92f). Report is 11 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2485 +/- ## ======================================= Coverage 92.53% 92.54% ======================================= Files 235 236 +1 Lines 20063 20089 +26 ======================================= + Hits 18565 18591 +26 Misses 1498 1498 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.