-
Notifications
You must be signed in to change notification settings - Fork 157
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
feat: Python TGeoDetector.create()
can read config from JSON file
#1095
Conversation
* `TGeoDetector.create(jsonFile=tgeo.json)` fills the config from the JSON file. Other settings can still be set from Python. * Fixes a small issue with the `_detector_create` adapter, which didn't recognise the `jsonFile` setter with no getter.
In principle, why not. But if you're using the python bindings anyway, I guess I would suggest just using python to construct the TGeo configuration, which should be much more readable/maintainable than the JSON version in my opinon? (see here) |
Agreed. I found this useful to load an existing ITk configuration in JSON format.
That didn't work for me, so I added this option to compare. The JSON version works for me, so this helps as a fallback and/or to debug the Python one. |
* Implemented in `ckf_tracks.py`, which previously worked just for the Generic Detector. The changes should be compatible with existing tests using `ckf_tracks.py`. * Config can be specified with command-line options. * Use `ckf_tracks.py --atlas` to select options to load config from `acts-detector-examples` (get in touch if you don't have this). * Requires acts-project#1095 to use with `--atlas` and without `--build-itk-geometry`.
Codecov Report
@@ Coverage Diff @@
## main #1095 +/- ##
=======================================
Coverage 48.58% 48.58%
=======================================
Files 341 341
Lines 17515 17515
Branches 8263 8263
=======================================
Hits 8510 8510
Misses 3232 3232
Partials 5773 5773 Continue to review full report at Codecov.
|
* Implemented in `ckf_tracks.py`, which previously worked just for the Generic Detector. The changes should be compatible with existing tests using `ckf_tracks.py`. * Config can be specified with command-line options. * Use `ckf_tracks.py --atlas` to select options to load config from `acts-detector-examples` (get in touch if you don't have this). * Requires acts-project#1095 to use with `--atlas` and without `--build-itk-geometry`.
* Implemented in `ckf_tracks.py`, which previously worked just for the Generic Detector. The changes should be compatible with existing tests using `ckf_tracks.py`. * Config can be specified with command-line options. * Use `ckf_tracks.py --atlas` to select options to load config from `acts-detector-examples` (get in touch if you don't have this). * Requires acts-project#1095 to use with `--atlas` and without `--build-itk-geometry`.
* Implemented in `ckf_tracks.py`, which previously worked just for the Generic Detector. The changes should be compatible with existing tests using `ckf_tracks.py`. * Config can be specified with command-line options. * Use `ckf_tracks.py --atlas` to select options to load config from `acts-detector-examples` (get in touch if you don't have this). * Requires acts-project#1095 to use with `--atlas` and without `--build-itk-geometry`.
TGeoDetector.create(jsonFile=tgeo.json)
fills the config from the JSON file. Other settings can still be set from Python._detector_create
adapter, which didn't recognise thejsonFile
setter with no getter.