Skip to content

Commit

Permalink
fix most tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dudiiiiiiii committed Jan 1, 2025
1 parent fee1e90 commit 4c1a1ed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions tests/fluka/expected_fluka_output/fl_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@
ASSIGNMA WATER world
ASSIGNMA BLCKHOLE boundary
* generated scoring cards
USRBIN 10.0 ALL-PART -21.0 0.05 5.0 6.0Fluence
USRBIN 10.0 ALL-PART -21.0 0.05 5.0 6.0Fluence_21
USRBIN -0.05 -5.0 -6.0 1.0 100.0 120.0&
AUXSCORE USRBIN -100100.0 1.0 1.0 1.0
* random number generator settings
RANDOMIZ 137
* number of particles to simulate
START 10000.0
STOP
"""
"""
36 changes: 19 additions & 17 deletions tests/fluka/test_scoring_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def detectors_json_4(project4_fluka_json: dict) -> dict:
def expected_card() -> str:
"""Returns expected Fluka scoring card sets"""
lines = """
USRBIN 10.0 ALL-PART -21.0 0.05 5.0 6.0Fluence
USRBIN 10.0 ALL-PART -21.0 0.05 5.0 6.0Fluence_21
USRBIN -0.05 -5.0 -6.0 1.0 100.0 120.0&
AUXSCORE USRBIN -100100.0 1.0 1.0 1.0
"""
Expand All @@ -59,7 +59,7 @@ def expected_card() -> str:
def expected_scores() -> str:
"""Returns expected Fluka scoring card sets"""
lines = """
USRBIN 10.0 ALL-PART -21.0 0.05 5.0 6.0Fluence
USRBIN 10.0 ALL-PART -21.0 0.05 5.0 6.0Fluence_21
USRBIN -0.05 -5.0 -6.0 1.0 100.0 120.0&
AUXSCORE USRBIN -100100.0 1.0 1.0 1.0
"""
Expand All @@ -71,10 +71,10 @@ def expected_scores() -> str:
def expected_scores_2() -> str:
"""Returns expected Fluka scoring card sets"""
lines = """
USRBIN 10.0 ALL-PART -21.0 0.05 5.0 6.0Fluence
USRBIN 10.0 ALL-PART -21.0 0.05 5.0 6.0Fluence_21
USRBIN -0.05 -5.0 -6.0 1.0 100.0 120.0&
AUXSCORE USRBIN -100100.0 1.0 1.0 1.0
USRBIN 10.0 DOSE -22.0 12.5 25.0 37.5MyDose
USRBIN 10.0 DOSE -22.0 12.5 25.0 37.5MyDose_22
USRBIN 7.5 15.0 22.5 10.0 100.0 150.0&
AUXSCORE USRBIN NEUTRON 2.0 2.0 1.0
"""
Expand All @@ -86,7 +86,7 @@ def expected_scores_2() -> str:
def expected_scores_cylinder() -> str:
"""Returns expected Fluka scoring card sets"""
lines = """
USRBIN 11.0 DOSE -21.0 3.0 0.0 21.0Dose1
USRBIN 11.0 DOSE -21.0 3.0 0.0 21.0Dose1_21
USRBIN 0.0 0.0 3.0 1.0 1.0 100.0&
"""

Expand All @@ -97,36 +97,36 @@ def expected_scores_cylinder() -> str:
def expected_scores_4() -> str:
"""Returns expected Fluka scoring card sets"""
lines = """
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_Total
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_Total_21
USRBIN -2.5 -2.5 3.0 1.0 1.0 100.0&
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_Proton
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_Proton_21
USRBIN -2.5 -2.5 3.0 1.0 1.0 100.0&
AUXSCORE USRBIN PROTON 2.0 2.0 1.0
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_He3
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_He3_21
USRBIN -2.5 -2.5 3.0 1.0 1.0 100.0&
AUXSCORE USRBIN 3-HELIUM 3.0 3.0 1.0
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_C_Cus
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_C_Cus_21
USRBIN -2.5 -2.5 3.0 1.0 1.0 100.0&
AUXSCORE USRBIN-1200600.0 4.0 4.0 1.0
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_He_Cus
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_He_Cus_21
USRBIN -2.5 -2.5 3.0 1.0 1.0 100.0&
AUXSCORE USRBIN -400200.0 5.0 5.0 1.0
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_B_Cus
USRBIN 10.0 DOSE -21.0 2.5 2.5 21.0D_B_Cus_21
USRBIN -2.5 -2.5 3.0 1.0 1.0 100.0&
AUXSCORE USRBIN -900400.0 6.0 6.0 1.0
USRBIN 11.0 ALL-PART -22.0 2.5 0.0 21.0F_Total
USRBIN 11.0 ALL-PART -22.0 2.5 0.0 21.0F_Total_22
USRBIN 0.0 0.0 3.0 1.0 1.0 100.0&
USRBIN 11.0 PROTON -22.0 2.5 0.0 21.0F_Proton
USRBIN 11.0 PROTON -22.0 2.5 0.0 21.0F_Proton_22
USRBIN 0.0 0.0 3.0 1.0 1.0 100.0&
USRBIN 11.0 3-HELIUM -22.0 2.5 0.0 21.0F_He3
USRBIN 11.0 3-HELIUM -22.0 2.5 0.0 21.0F_He3_22
USRBIN 0.0 0.0 3.0 1.0 1.0 100.0&
USRBIN 11.0 ALL-PART -22.0 2.5 0.0 21.0F_C_Cus
USRBIN 11.0 ALL-PART -22.0 2.5 0.0 21.0F_C_Cus_22
USRBIN 0.0 0.0 3.0 1.0 1.0 100.0&
AUXSCORE USRBIN-1200600.0 10.0 10.0 1.0
USRBIN 11.0 ALL-PART -22.0 2.5 0.0 21.0F_He_Cus
USRBIN 11.0 ALL-PART -22.0 2.5 0.0 21.0F_He_Cus_22
USRBIN 0.0 0.0 3.0 1.0 1.0 100.0&
AUXSCORE USRBIN -400200.0 11.0 11.0 1.0
USRBIN 11.0 ALL-PART -22.0 2.5 0.0 21.0F_B_Cus
USRBIN 11.0 ALL-PART -22.0 2.5 0.0 21.0F_B_Cus_22
USRBIN 0.0 0.0 3.0 1.0 1.0 100.0&
AUXSCORE USRBIN -900400.0 12.0 12.0 1.0
"""
Expand Down Expand Up @@ -160,5 +160,7 @@ def test_scoring_dose_and_fluence_with_two_detectors(detectors_json_4: dict, sco
expected_scores_4: str) -> None:
scorings = parse_scorings(detectors_json_4, scorings_json_4)
scorings_card = ScoringsCard(scorings)
print(expected_scores_4)
print(scorings_card)

assert str(scorings_card) == expected_scores_4

0 comments on commit 4c1a1ed

Please sign in to comment.