DataMedSci / pymchelper

Python toolkit for SHIELD-HIT12A and FLUKA
http://datamedsci.github.io/pymchelper/
14 stars 7 forks source link

1254 Unify output units #702

Closed hendzeld closed 6 months ago

reviewpad[bot] commented 6 months ago

AI-Generated Summary: This pull request consists of several patches, it introduces rescaling factor for units and applies it in the code. The method get_unit_for_scoring has been replaced with the method get_unit_and_factor_for_scoring that returns both the unit and the rescaling factor. Multiple units such as doses and energy have been rescaled and the changes are tested and updated in test cases. The pull request also includes some docstring updates for clarity. In the final patch, units for DOSE scoring are rescaled from Gy to MeV/g.

reviewpad[bot] commented 6 months ago

AI-Generated Summary: This pull request introduces several changes involving unit rescaling and test updates in the FLUKA reader of the pymchelper code repository. The main body of changes include updates to the scoring unit return functions, incorporating a rescaling factor to adjust the units accordingly. Certain energies expressed in GeV are rescaled to MeV and Dose from GeV/g to MeV/g and Gy. Additionally, a new utilization of this rescaling factor is introduced in the parse_usrbin function.

Additionally, updates were made to the docstring for better clarity and readability. Test files were also updated to reflect the changes introduced in this patch and maintained the current working integrity of the system.

The docstrings of various methods were improved for clarity, the declaration of axes descriptions for binning types was simplified, and the unit for DOSE was also updated. The fluence scoring was rescaled from GeV/cm^3 to MeV/cm^3. In summary, this is a comprehensive improvement and update to the handling of units and scaling within the pymchelper FLUKA reader.