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 scoring names to be distinct for FLUKA #224

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dudiiiiiiii
Copy link
Contributor

No description provided.

@dudiiiiiiii dudiiiiiiii linked an issue Jan 1, 2025 that may be closed by this pull request
@dudiiiiiiii dudiiiiiiii self-assigned this Jan 1, 2025
@dudiiiiiiii
Copy link
Contributor Author

There is a problem with one test. After scores name is updated sometimes it get out of range (is too long max 10 characters) Should i update tests so that names with added suffixes (ex _21) will be short enough?

@@ -30,6 +30,7 @@ class Quantity:
"""Class representing Quantity"""

name: str
name_processed = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of adding name_processed I'd add here a field with output_unit and proper type (integer ?)
then instead of playing with name I'd suggest to modify this logic:

def _parse_mesh_detector(detector: MeshDetector, quantity: Quantity, quantity_to_score: str,
output_unit_in_fluka_convention: str) -> list[Card]:
"""Creates USRBIN card for mesh detector"""
first_card = Card(codewd='USRBIN')
first_card.what = [
'10.0', quantity_to_score, output_unit_in_fluka_convention, detector.x_max, detector.y_max, detector.z_max
]
first_card.sdum = short_name(quantity.name)
second_card = Card(codewd='USRBIN')
second_card.what = [
detector.x_min,
detector.y_min,
detector.z_min,
detector.x_bins,
detector.y_bins,
detector.z_bins,
]
second_card.sdum = '&'
return [first_card, second_card]

here the SDUM is written

instead of truncating name to first 10 characters I'd rather use something like:

  • first 4 characters of the name + _ + some_hash_of_name_and_output_unit_saved_on_5_characters

Comment on lines +163 to +164
print(expected_scores_4)
print(scorings_card)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(expected_scores_4)
print(scorings_card)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Each scoring card required to have distinct name for FLUKA
2 participants