Skip to content

Conversation

@sethrj
Copy link
Member

@sethrj sethrj commented Oct 22, 2025

This implements pydantic models for celeritas-project/celeritas#2018 and celeritas-project/celeritas#2036 .

@sethrj sethrj requested a review from Copilot October 22, 2025 17:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py into model/types.py, model/input.py, and model/output.py for better organization
  • Added OrangeConversionOptions, OrangeStats, and related output models (BihSizes, OrangeParamsOutput, etc.)
  • Updated settings to support g4org_options (JSON file path) and g4_geo_optimize instead of deprecated g4org_verbose and g4org_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.

@sethrj sethrj merged commit c49cd56 into celeritas-project:main Oct 23, 2025
7 checks passed
@sethrj sethrj deleted the new-models branch October 23, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant