JuliaPhysics / JuliaPhysics/SolidStateDetectors.jl
phi intervals with from > to silently produce empty geometry
- Dominant language
- Julia
- Stars
- 178
- Forks
- 59
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 4
Description
(Draft from the 2026-07 code review; posted on behalf of the review.)
A primitive with
```yaml
phi:
from: 350°
to: 10°
```
does not error and does not wrap through 0° — it yields an empty angular
interval, so the primitive silently contributes nothing to the detector. A
config typo (or a genuine attempt to describe a wedge crossing φ = 0) produces a
detector that simulates, converges and looks plausible while missing a part.
Two possible semantics:
1. **Wrap around**: interpret `350° → 10°` as the 20° wedge crossing zero. This
matches geometric intuition and makes the syntax more expressive; today such
a wedge cannot be written as a single primitive at all.
2. **Reject**: raise a `ConfigFileError` with a clear message, requiring users
to split the wedge into two primitives explicitly.
Either is better than the current silent empty set. Wrap-around touches the
`_in_angular_interval` machinery (which currently assumes ordered intervals and
applies tolerances asymmetrically — see also the related tolerance-asymmetry
smell from the review), so the reject option is the cheap immediate guard even
if wrap-around is the long-term goal.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the `_in_angular_interval` machinery and the related tolerance handling described in the issue. Decide whether reversed intervals should wrap or raise `ConfigFileError`, then add coverage for `from: 350°` and `to: 10°` that verifies the chosen behavior and prevents a silent empty geometry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100