Closed hendzeld closed 8 months ago
Current results runmc --jobs 1 --out-type plot -w . proton.inp
Where proton.inp is https://github.com/DataMedSci/pymchelper/blob/7919273be1c881d2ffca8d36b3e3147f32bf02ae/tests/res/fluka/proton.inp
I will create tests to check these results :
Current results
runmc --jobs 1 --out-type plot -w . proton.inp
Where proton.inp is https://github.com/DataMedSci/pymchelper/blob/7919273be1c881d2ffca8d36b3e3147f32bf02ae/tests/res/fluka/proton.inpI will create tests to check these results :
- generate Fluka output files
- use FlukaReader to generate estimators
- test expected values in estimators
As for now it looks good !
I see another issue: the results from SHIELD-HIT12A may be inconsistent with Fluka due to different units used. Maybe in subsequent PR we can introduce some postprocessing to adjust units to common measure. I suspect that may be a better task for backend code
AI-Generated Summary: This pull request includes modifications to the fluka.py and test_fluka_minimal.py files. Some refactoring was done to improve code clarity and readability. The most important changes include the addition of the get_particle_from_db
, UsrbinScoring
, and verify_axis
functions, as well as the modification of the parse_usrbin
, parse_usrbdx
and parse_usrtrack
functions in fluka.py. Methods for getting specific scoring and units were added, and exception handling was improved.
AI-Generated Summary: This pull request introduces several changes to the pymchelper/readers/fluka.py
file of the PyMC helper library, a Python support library for Monte Carlo particle radiation transport simulations. Changes include:
The import of Optional
from typing
and Particle
from pymchelper.flair.Input
.
Addition of docstrings and comments for improved readability and understanding of the code.
Numerous changes to the FlukaReaderFactory
, parse_usrbin
, parse_usrbdx
, parse_usrtrack
, and read_data
methods in the form of renaming of variables, updates to the methods logic, formatting improvements and more informative comments.
A significant addition is the creation of two new classes, UsrbinScoring
and get_particle_from_db
. The former contains constant lists representing various scoring types used in the USRBIN estimator and a method to get the unit for a given scoring name. The latter queries Flair's database for a particle by its id.
In tests/mock/test_fluka_minimal.py
, several changes were also made:
The expected results in the expected_results
method have been updated to include more detailed information.
An additional import of MeshAxis
from pymchelper.axis
has been added.
A new verification method, verify_axis
, is created to compare the Axis of the generated FLUKA file with expected values.
The pull request provides comprehensive and diligent changes that improve the clarity, readability, and functionality of the involved code while enhancing the testing and verification process.
Update handling of Fluka's USRBIN scoring card.
Update description of axis with Particles/scorings and units