Skip to content
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

Merged
merged 9 commits into from
Dec 3, 2023

Conversation

hendzeld
Copy link
Contributor

@hendzeld hendzeld commented Nov 29, 2023

Update USRBIN 3D cylindrical scoring for Fluka

@reviewpad reviewpad bot added the small Pull request is small label Nov 29, 2023
@hendzeld hendzeld mentioned this pull request Nov 29, 2023
7 tasks
@hendzeld
Copy link
Contributor Author

Results
obraz

@hendzeld hendzeld marked this pull request as ready for review December 2, 2023 17:12
Copy link
Contributor

reviewpad bot commented Dec 2, 2023

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>
Copy link
Contributor

reviewpad bot commented Dec 2, 2023

AI-Generated Summary: This pull request contains eight patches that primarily focused on enhancing the pymchelper/readers/fluka.py file. The patches introduce additional functionalities and make code style fixes. Here's a patch-by-patch breakdown:

  1. Patch one updates the 3D cylindrical USBIN for Fluka, changing the names and units for the positional coordinates based on specific detector types.

  2. The second patch addresses minor style issues such as spacing and indentation.

  3. The third patch moves the details of axes to a new class, making the code more structured and easy to manage.

  4. Patch four continues with the style optimizations, fixing formatting issues for consistent code style.

  5. The fifth patch addresses type annotations, improving readability and preventing potential bugs.

  6. Patch six is a significant refactor moving AxisDescription from fluka.py to axis.py. It also simplifies axis descriptions handling in UsrbinScoring class.

  7. The seventh patch folds too long lines to meet the style guidelines.

  8. The final patch makes a minor change in the comment of the get_axes_description method for improved clarity.

Please review these changes for potential merge.

Copy link
Contributor

reviewpad bot commented Dec 2, 2023

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'.

@grzanka grzanka merged commit d189208 into master Dec 3, 2023
@grzanka grzanka deleted the 1254-fluka-output-usrbin-cylindrical branch December 3, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants