-
Notifications
You must be signed in to change notification settings - Fork 4
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
implement distance to surface and add the surface types to HPGe object #51
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
==========================================
- Coverage 79.74% 77.86% -1.88%
==========================================
Files 14 16 +2
Lines 548 768 +220
==========================================
+ Hits 437 598 +161
- Misses 111 170 +59 ☔ View full report in Codecov by Sentry. |
just an idea: maybe it would make sense to split utils into two parts; one that creates geometry (i.e. helpers for contacts, maybe spherical segments later on) and one for consuming geometry (i.e. calculating distances)? |
Yes probably you are right |
Another thing to take care of: I think that because of finite numerical precision some hits could be found outside the detector by a tiny amount -> we should push them back in |
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.
just some minor stuff I found while looking at the docs
This is not necessarily so trivial, need to compute if a point is inside vs outside, i.e. attach a sign to the distance. |
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.
I left some comments.
All of this can be very easily sped up with Numba, let's do that.
Now done. |
Any more issues? Can we merge this ? |
for me it looks fine, we can always iterate later if we need to. |
Should have now fixed your last comments @gipert |
I have removed the pre-commit commits and pushed some cosmetic stuff, getting ready to merge |
updates: - [github.com/adamchainz/blacken-docs: 1.18.0 → 1.19.1](adamchainz/blacken-docs@1.18.0...1.19.1) - [github.com/astral-sh/ruff-pre-commit: v0.6.9 → v0.7.2](astral-sh/ruff-pre-commit@v0.6.9...v0.7.2) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.13.0](pre-commit/mirrors-mypy@v1.11.2...v1.13.0) - [github.com/abravalheri/validate-pyproject: v0.20.2 → v0.22](abravalheri/validate-pyproject@v0.20.2...v0.22) - [github.com/python-jsonschema/check-jsonschema: 0.29.3 → 0.29.4](python-jsonschema/check-jsonschema@0.29.3...0.29.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This implements a calculation of the distance between points and the surface.
Also slightly refactors definitions of the surface for some detector types so that if there is no groove the p+ surface is still always separate from the others.
We should also add.
But these could be added later since the correct exceptions are raised in these cases currently.