Skip to content

Commit

Permalink
[pre-commit.ci] Automatic python and c++ formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 13, 2024
1 parent 1f45b1a commit 1e7d1de
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 9 deletions.
4 changes: 3 additions & 1 deletion opengate/tests/src/test010_generic_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from scipy.spatial.transform import Rotation

if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "gate_test010_generic_source", output_folder="test010")
paths = utility.get_default_test_paths(
__file__, "gate_test010_generic_source", output_folder="test010"
)

# create the simulation
sim = gate.Simulation()
Expand Down
4 changes: 3 additions & 1 deletion opengate/tests/src/test012_mt_dose_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "gate_test008_dose_actor", output_folder="test012")
paths = utility.get_default_test_paths(
__file__, "gate_test008_dose_actor", output_folder="test012"
)

# create the simulation
sim = gate.Simulation()
Expand Down
4 changes: 3 additions & 1 deletion opengate/tests/src/test050_let_actor_letd_mt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

if __name__ == "__main__":
do_debug = False
paths = utility.get_default_test_paths(__file__, "test050_let_actor_letd", "test050")
paths = utility.get_default_test_paths(
__file__, "test050_let_actor_letd", "test050"
)
ref_path = paths.output_ref

# create the simulation
Expand Down
4 changes: 3 additions & 1 deletion opengate/tests/src/test059_tpsource_abs_dose.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
from opengate.tests.utility import plot_img_axis

if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "gate_test044_pbs", output_folder="test059")
paths = utility.get_default_test_paths(
__file__, "gate_test044_pbs", output_folder="test059"
)
output_path = paths.output
ref_path = paths.output_ref

Expand Down
4 changes: 3 additions & 1 deletion opengate/tests/src/test059_tpsource_flat_generation_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def calculate_mean_unc(edep_arr, unc_arr, edep_thresh_rel=0.7):


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "gate_test044_pbs", output_folder="test059")
paths = utility.get_default_test_paths(
__file__, "gate_test044_pbs", output_folder="test059"
)
output_path = paths.output
ref_path = paths.output_ref

Expand Down
4 changes: 3 additions & 1 deletion opengate/tests/src/test059_tpsource_optics_vbl.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

if __name__ == "__main__":
# ------ INITIALIZE SIMULATION ENVIRONMENT ----------
paths = utility.get_default_test_paths(__file__, "gate_test044_pbs", output_folder="test059")
paths = utility.get_default_test_paths(
__file__, "gate_test044_pbs", output_folder="test059"
)
output_path = paths.output
ref_path = paths.output_ref

Expand Down
10 changes: 7 additions & 3 deletions opengate/tests/src/test059_tpsource_range_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
from opengate.tests.utility import print_test

if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "gate_test044_pbs", output_folder="test059")
paths = utility.get_default_test_paths(
__file__, "gate_test044_pbs", output_folder="test059"
)
output_path = paths.output
ref_path = paths.output_ref

Expand Down Expand Up @@ -137,7 +139,7 @@
# read output and ref
print("Compare ", dose_path)
img_mhd_out = itk.imread(dose_path)
#data = np.flip(itk.GetArrayViewFromImage(img_mhd_out), axis=0)
# data = np.flip(itk.GetArrayViewFromImage(img_mhd_out), axis=0)
data = itk.GetArrayViewFromImage(img_mhd_out)
spacing = np.array(img_mhd_out.GetSpacing())
print(data.shape, spacing)
Expand All @@ -152,6 +154,8 @@
print(f"range80_gate9_E120MeV = {range80_gate9_E120MeV}")
if abs(range_opengate - range80_gate9_E120MeV) > thresh:
ok = False
print_test(ok, f"Compare ranges {range_opengate} and {range80_gate9_E120MeV} >? {thresh}")
print_test(
ok, f"Compare ranges {range_opengate} and {range80_gate9_E120MeV} >? {thresh}"
)

utility.test_ok(ok)

0 comments on commit 1e7d1de

Please sign in to comment.