-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update 3D cylindrical USBIN fo Fluka #693
Conversation
AI-Generated Summary: This pull request contains a series of 7 code patches committed by Dominik Hendzel. The main focus of this pull request is to update the 3D cylindrical USBIN for Fluka in a Python script 'fluka.py' and make subsequent fixes and refactoring in the same script. Patch 1 updates the naming and unit of mesh axes in the specific detector types. If the detector type is 1 or 11, the X axis will be referred to as "Radius (R)" and the Y axis' unit will be 'rad'. Otherwise, the naming and units stay as 'Position (X)' and 'cm'. Patch 2 corrects inconsistent style on the naming and unit assignments related to the detector type. Extra spaces at the assignments have been removed. Patch 3 implements a new code structure by introducing classes 'Axis', 'AxesDescription' and 'UsrbinAxes'. These classes store the names and units of axes and are used to update the corresponding attributes in the 'estimator' object. Patch 4 fixes more style issues, particularly those related to PEP8 adherence. Certain variable names have also been renamed for clarity, and some comments were added for better understanding. Patch 5 modifies the type annotations of the 'AxesDescription' class attributes from 'UsrbinAxes.Axis' to simply 'Axis'. Patch 6 is a major refactor where 'AxesDescription' and 'Axis' classes are moved to the 'axis.py' module from 'fluka.py'. A new helper class UsrbinScoring is also introduced in 'fluka.py' to manage scoring based on the 'detector.type'. Patch 7 simply refactors the method 'get_axes_description' to have more readable line lengths according to Python's style guide recommendations. In conclusion, this pull request enhances the code structure, readability, and adherence to Python's official style guide. |
Co-authored-by: Leszek Grzanka <leszek.grzanka@gmail.com>
AI-Generated Summary: This pull request contains eight patches that primarily focused on enhancing the
Please review these changes for potential merge. |
AI-Generated Summary: This pull request includes adjustments and improvements to the code in nine steps. The changes spread over the 'pymchelper/readers/fluka.py' and 'pymchelper/axis.py' files. The first patch updates the 3D cylindrical USBIN for Fluka. It makes changes to the 'Position (X)' and 'cm' units, aligning them properly for better readability. The second patch fixes several style issues in the file primarily correcting spacing around equal signs. The third patch introduces new classes for simplified attribute assignment, giving definitions to the different axes in the data. The fourth patch revisits coding style, revising namings and adding more precise annotation. The fifth patch fixes type annotations, changing 'UsrbinAxes.Axis' to 'Axis' in the 'AxesDescription' class. The sixth patch refactors the code, defining AxisDescription in 'pymchelper/axis.py' and removing unnecessary classes from 'pymchelper/readers/fluka.py’. The seventh patch folds excessively long lines to enhance readability. The eighth patch corrects a comment, specifying the 'binning type' over 'binding type'. The ninth and final patch adapts changes according to a conducted code review. It changes the 'AxisDescription' class into a data class in 'pymchelper/axis.py' and adds more explanatory comments in 'pymchelper/readers/fluka.py'. |
Update USRBIN 3D cylindrical scoring for Fluka