cta-observatory / pyirf

Python IRF builder
https://pyirf.readthedocs.io/en/stable/
MIT License
15 stars 25 forks source link

Fix nearest simplex finding #240

Closed RuneDominik closed 1 year ago

RuneDominik commented 1 year ago

With this PR, the nearest simplex is computed geometrically instead of using scipy.spatial.Delaunay.plane_distance. I've put the functions for this into pyirf.interpolation.utils. This was just a first thought, if they are better suited to lay inside pyirf.interpolation.nearest_simplex_extrapolator I'll happily change this. Some of these functions can be reused later for an extrapolator that blends over visible edges.

Fixes #238

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.18 :tada:

Comparison is base (46349ad) 94.33% compared to head (0937c94) 94.51%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #240 +/- ## ========================================== + Coverage 94.33% 94.51% +0.18% ========================================== Files 58 60 +2 Lines 2736 2827 +91 ========================================== + Hits 2581 2672 +91 Misses 155 155 ``` | [Impacted Files](https://app.codecov.io/gh/cta-observatory/pyirf/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory) | Coverage Δ | | |---|---|---| | [...yirf/interpolation/nearest\_simplex\_extrapolator.py](https://app.codecov.io/gh/cta-observatory/pyirf/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory#diff-cHlpcmYvaW50ZXJwb2xhdGlvbi9uZWFyZXN0X3NpbXBsZXhfZXh0cmFwb2xhdG9yLnB5) | `100.00% <100.00%> (ø)` | | | [pyirf/interpolation/tests/test\_utils.py](https://app.codecov.io/gh/cta-observatory/pyirf/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory#diff-cHlpcmYvaW50ZXJwb2xhdGlvbi90ZXN0cy90ZXN0X3V0aWxzLnB5) | `100.00% <100.00%> (ø)` | | | [pyirf/interpolation/utils.py](https://app.codecov.io/gh/cta-observatory/pyirf/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory#diff-cHlpcmYvaW50ZXJwb2xhdGlvbi91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.