Repository navigation
fix: GeoSvc requires compact files in standalone mode - #38
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The reviewer verified the full diff and surrounding context—confirming the ServiceError raise resolves and is caught correctly, the error and log messages match the tests exactly, and the detector creation reorder is sound—without finding any objective issues to flag.
No open issues 🎉
What changed in this PR
This PR fixes two latent GeoSvc bugs surfaced by the [!shouldfail] tests added in #34. When self-initializing (standalone mode, no external detector) with an empty detectors property, GeoSvc::init() previously hit a // TODO handle error branch and silently built an empty detector with no valid world volume; it now raises a ServiceError so ServiceSvc::init() correctly reports the service as uninitialized. It also fixes a logging bug where the literal string "name" was logged instead of the actual compact file name. The two corresponding tests are promoted from [!shouldfail] to regular tests.
Changes:
- Raise
ServiceErrorinstead of silently proceeding when standalone mode has no compact files, and create the detector only after that check. - Log the actual compact file name instead of the literal
"name". - Convert the two
[!shouldfail]GeoSvc tests into regular passing tests asserting the thrown error and the log output.
| File | Description |
|---|---|
| core/src/geo.cpp | Raises ServiceError on empty detectors in standalone mode and logs the real compact file name; reorders detector creation after the guard. |
| core/tests/geo.cpp | Promotes the two previously-failing tests to regular tests verifying the ServiceError type/message and the per-file log line; adds the Catch2 string matchers include. |
Review effort: Balanced
cf6d92f to
8f91293
Compare
GeoSvc::init without an external detector and with an empty 'detectors' property silently created an empty detector without a valid world volume (the "TODO handle error" branch). It now raises a ServiceError, so ServiceSvc::init reports the service as not initialized. Also log the name of each compact file that is loaded, instead of the literal string "name". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d781b8b to
35fe9e7
Compare
Stacked on #37.
Summary
GeoSvc::init()without an external detector and with an emptydetectorsproperty created an empty detector without a valid world volume (theTODO handle errorbranch). It now raises aServiceError, soServiceSvc::init()reports the service as not initialized. Initializing with an external detector, as EICrecon does, is unaffected.GeoSvc::init()logged the literalLoading compact file: name; it now logs the file name.Tests
Both
[!shouldfail]GeoSvc tests from #34 are now regular tests: the emptydetectorsproperty raises aServiceError, and the loaded compact file is logged by name.Test plan
eic_xl:nightly: 84/84 tests pass🤖 Generated with Claude Code