Add g4org export options and ORANGE stats#11
Merged
sethrj merged 8 commits intoceleritas-project:mainfrom Oct 23, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Celeritas Python model structure by splitting a monolithic model.py file into modular submodules (types.py, input.py, output.py), while adding support for ORANGE statistics and Geant4-to-ORANGE conversion options.
Key changes:
- Split
model.pyintomodel/types.py,model/input.py, andmodel/output.pyfor better organization - Added
OrangeConversionOptions,OrangeStats, and related output models (BihSizes,OrangeParamsOutput, etc.) - Updated settings to support
g4org_options(JSON file path) andg4_geo_optimizeinstead of deprecatedg4org_verboseandg4org_export
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
celerpy/model.py |
Converted to a backward-compatibility wrapper that re-exports from new submodules |
celerpy/model/__init__.py |
New module init providing re-exports for backward compatibility |
celerpy/model/types.py |
Extracted base types, enums (GeometryEngine, MemSpace, UnitSystem, LogLevel), and Tolerance model |
celerpy/model/input.py |
Extracted input models including new OrangeConversionOptions, OrangeStats, and TraceSetup with _cmd field |
celerpy/model/output.py |
Extracted output models including new ORANGE-related models (BihSizes, OrangeParamsOutput, etc.) |
celerpy/visualize.py |
Updated imports to use new modular structure |
celerpy/process.py |
Updated imports and fixed iteration over settings object |
celerpy/conf/settings.py |
Replaced g4org_verbose and g4org_export with g4org_options and g4_geo_optimize |
test/test_model.py |
Updated tests for new module structure and added tests for OrangeStats and BihSizes |
test/test_visualize.py |
Updated imports and added assertion for masked array type |
test/data/options.json |
Added empty JSON file for testing |
README.md |
Minor wording correction |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements pydantic models for celeritas-project/celeritas#2018 and celeritas-project/celeritas#2036 .