Skip to content

Commit c49cd56

Browse files
authored
Add g4org export options and ORANGE stats (#11)
* Add new models and update environment variables * Fix default move-negated-join * Add orange stats and sizes * Use dynamic settings * Add type annotation * Split model into submodules * Export submodules * Delete dead file, update comment
1 parent 6862d24 commit c49cd56

File tree

13 files changed

+513
-240
lines changed

13 files changed

+513
-240
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
> **Warning**
22
This repository is experimental and bare-bones at the moment. It's not ready
3-
for use, but discussions and contributions are welcome!
3+
for general use, but discussions and contributions are welcome!
44

55
# Celeritas Python interface
66

celerpy/conf/settings.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44
from typing import Optional
55

6-
from pydantic import DirectoryPath
6+
from pydantic import DirectoryPath, FilePath
77
from pydantic_settings import BaseSettings, SettingsConfigDict
88

99
from celerpy.model import LogLevel
@@ -24,26 +24,32 @@ class Settings(BaseSettings):
2424
use_attribute_docstrings=True,
2525
)
2626

27+
prefix_path: Optional[DirectoryPath] = None
28+
"Path to the Celeritas build/install directory"
29+
30+
# CELER_ environment variables
31+
2732
color: bool = True
2833
"Enable colorized terminal output"
2934

3035
disable_device: bool = False
3136
"Disable GPU execution even if available"
3237

33-
g4org_export: Optional[str] = None
34-
"Filename base to export converted Geant4 geometry"
35-
36-
g4org_verbose: bool = False
37-
"Filename base to export converted Geant4 geometry"
38-
3938
log: LogLevel = LogLevel.INFO
4039
"World log level"
4140

4241
log_local: LogLevel = LogLevel.WARNING
4342
"Self log level"
4443

45-
prefix_path: Optional[DirectoryPath] = None
46-
"Path to the Celeritas build/install directory"
47-
4844
profiling: bool = False
4945
"Enable NVTX/ROCTX/Perfetto profiling"
46+
47+
# Geant4->ORANGE conversion
48+
49+
g4org_options: Optional[FilePath] = None
50+
"JSON file with conversion options"
51+
52+
# Geant4 configuration
53+
54+
g4_geo_optimize: bool = True
55+
"Build Geant4 tracking acceleration structures"

celerpy/model.py

Lines changed: 0 additions & 174 deletions
This file was deleted.

celerpy/model/__init__.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
2+
# See the top-level LICENSE file for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
"""Manage models used for JSON I/O with Celeritas.
5+
6+
This module re-exports all models from the individual modules for backward
7+
compatibility. For new code, prefer importing from the specific modules:
8+
- celerpy.types: Base types, enums, and type aliases
9+
- celerpy.input: Command and input models
10+
- celerpy.output: Output and result models
11+
"""
12+
13+
from . import input, output, types
14+
from .input import (
15+
ImageInput,
16+
ModelSetup,
17+
OrangeConversionOptions,
18+
TraceInput,
19+
TraceSetup,
20+
)
21+
from .types import (
22+
GeometryEngine,
23+
LogLevel,
24+
MemSpace,
25+
UnitSystem,
26+
)
27+
28+
__all__ = [
29+
"input",
30+
"output",
31+
"types",
32+
"ImageInput",
33+
"ModelSetup",
34+
"OrangeConversionOptions",
35+
"TraceInput",
36+
"TraceSetup",
37+
"GeometryEngine",
38+
"LogLevel",
39+
"MemSpace",
40+
"UnitSystem",
41+
]

0 commit comments

Comments
 (0)