Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: trailing-whitespace
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
rev: 26.1.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-clang-format
Expand Down
1 change: 0 additions & 1 deletion opengate/contrib/phantoms/necr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from opengate.utility import g4_units


# colors (similar to the ones of Gate)
red = [1, 0, 0, 1]
blue = [0, 0, 1, 1]
Expand Down
1 change: 1 addition & 0 deletions opengate/data/PhotonAttenuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Adaptation of the Matlab PhotonAttenuation package written by Jarek Tuszynski.
@author: vilches
"""

import numpy as np
from scipy.interpolate import interp1d, pchip_interpolate
import re
Expand Down
1 change: 0 additions & 1 deletion opengate/geometry/solids.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from .utility import ensure_is_g4_rotation, ensure_is_g4_translation, vec_np_as_g4


logger = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion opengate/sources/gansources.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from ..utility import LazyModuleLoader
from ..base import process_cls


#
torch = LazyModuleLoader("torch")
gaga = LazyModuleLoader("gaga_phsp")
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/actors/test008_dose_actor_mt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from scipy.spatial.transform import Rotation


if __name__ == "__main__":
paths = utility.get_default_test_paths(
__file__, "gate_test008_dose_actor", output_folder="test012"
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/actors/test023_filters_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import opengate as gate
from opengate.tests import utility


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "", "test023")

Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/actors/test036_adder_depth_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import test036_adder_depth_helpers as t036
from opengate.tests import utility


if __name__ == "__main__":
paths = utility.get_default_test_paths(
__file__, "gate_test036_adder_depth", "test036"
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/actors/test043_garf_analog_wip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import test043_garf_helpers as test43
from opengate.tests import utility


if __name__ == "__main__":
# create the simulation
sim = gate.Simulation()
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/actors/test049_pet_digit_blurring_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import test049_pet_digit_blurring_helpers as t49
from opengate.tests import utility


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "gate_test049_pet_blur", "test049")

Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/actors/test050_let_actor_letd_mt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import opengate as gate
from opengate.tests import utility


if __name__ == "__main__":
do_debug = False
paths = utility.get_default_test_paths(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import itk
import numpy as np


# WARNING: This test does currently not work correctly
# because the tested functionality od the dose actor is currently not available
# Test should be successful, but that is meaningless
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/actors/test083_actor_output_pickling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import opengate as gate
import opengate.tests.utility as tu


if __name__ == "__main__":
# create the simulation
sim = gate.Simulation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from opengate.exception import GateImplementationError
import opengate.tests.utility as utility


g_cm3 = gate.g4_units.g_cm3
mm = gate.g4_units.mm
Bq = gate.g4_units.Bq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import opengate as gate
from opengate.tests import utility


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "test_087")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import test028_ge_nm670_spect_2_helpers as test028
from opengate.tests import utility


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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import test028_ge_nm670_spect_4_acc_angle_helpers as test028
from opengate.tests import utility


if __name__ == "__main__":
# create the simulation
sim = gate.Simulation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import opengate as gate
from opengate.tests import utility


if __name__ == "__main__":
paths = utility.get_default_test_paths(
__file__, "gate_test029_volume_time_rotation", "test029"
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/geometry/test058_iec_six_spheres.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import opengate.contrib.phantoms.nemaiec as gate_iec
from opengate.tests import utility


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

Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/geometry/test075_siemens_cios_alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from opengate.contrib.carm.siemensciosalpha import Ciosalpha
from scipy.spatial.transform import Rotation


if __name__ == "__main__":
# paths
# paths = utility.get_default_test_paths(__file__, output_folder="test075_siemens_cios_alpha")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from opengate.exception import GateImplementationError
import opengate.tests.utility as utility


g_cm3 = gate.g4_units.g_cm3
mm = gate.g4_units.mm
Bq = gate.g4_units.Bq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from test095_spect_helpers import *
import json


if __name__ == "__main__":
paths = utility.get_default_test_paths(
__file__, gate_folder="", output_folder="test095"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from test095_spect_helpers import *
import json


if __name__ == "__main__":
paths = utility.get_default_test_paths(
__file__, gate_folder="", output_folder="test095"
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/misc/test004_simple_visu_vrml_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import opengate as gate
import opengate.tests.utility as utility


if __name__ == "__main__":
paths = utility.get_default_test_paths(
__file__, "gate_test004_simulation_stats_actor"
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/misc/test024_py_actor_wip.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import opengate as gate
from opengate.tests import utility


if __name__ == "__main__":
# create the simulation
sim = gate.Simulation()
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/misc/test061_user_event_info_mt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from test061_user_event_info_helpers import create_simulation, analyse
from opengate.tests import utility


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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from opengate.exception import GateImplementationError
import opengate.tests.utility as utility


if __name__ == "__main__":
is_ok = True
exceptions = []
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/physics/test013_phys_lists_2_wip.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from opengate.tests import utility
from test013_phys_lists_helpers import create_pl_sim


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "gate_test013_phys_lists")

Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/physics/test013_phys_lists_5_wip.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from opengate.userhooks import check_production_cuts
from test013_phys_lists_helpers import create_pl_sim


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "gate_test013_phys_lists")

Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/physics/test084_attenuation_map2_hu.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from opengate.tests import utility
from opengate.sources.utility import get_spectrum


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

Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/physics/test088_isotopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import numpy as np
import opengate.tests.utility as utility


g_cm3 = gate.g4_units.g_cm3
mm = gate.g4_units.mm
cm = gate.g4_units.cm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

@author: fava
"""

import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial.transform import Rotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from opengate.tests import utility
import pathlib


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, output_folder="test010")
ref_path = paths.output_ref
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/source/test035_dose_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from opengate.contrib.dose.doserate import create_simulation
from opengate.tests import utility


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "", output_folder="test035")
dr_data = paths.data / "dose_rate_data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import opengate.contrib.phantoms.nemaiec as gate_iec
from opengate.tests import utility


if __name__ == "__main__":
paths = utility.get_default_test_paths(__file__, "", "test038")

Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/source/test044_pbs_source_to_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import opengate as gate
from opengate.tests import utility


if __name__ == "__main__":
paths = utility.get_default_test_paths(
__file__, "gate_test044_pbs", "test044_pbs_source_to_volume"
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/source/test053_phid_05_it_ref_mt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from test053_phid_helpers2 import *
import opengate as gate


if __name__ == "__main__":
paths = get_default_test_paths(__file__, "", output_folder="test053")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import opengate as gate
from opengate.tests import utility


paths = utility.get_default_test_paths(
__file__, "test060_PhsSource_ParticleName_direct", output_folder="test060"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import opengate as gate
from opengate.tests import utility


paths = utility.get_default_test_paths(
__file__, "test060_PhsSource_ParticleName_direct", output_folder="test060"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import opengate as gate
from opengate.tests import utility


paths = utility.get_default_test_paths(
__file__, "test060_PhsSource_ParticleName_direct", output_folder="test060"
)
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/source/test060_phsp_source_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import opengate as gate
from opengate.tests import utility


paths = utility.get_default_test_paths(
__file__, "test060_PhsSource_ParticleName_direct", output_folder="test060"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import opengate as gate
from opengate.tests import utility


paths = utility.get_default_test_paths(
__file__, "test060_PhsSource_ParticleName_direct", output_folder="test060"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import gatetools.phsp as phsp
from opengate.tests import utility


paths = utility.get_default_test_paths(
__file__, "test060_PhsSource_ParticleName_direct", output_folder="test060"
)
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/source/test068_rotation_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import numpy as np
import uproot


# The test generates three different generic sources, momentum, focused and iso, which are attached to a plan.
# The plan is randomly rotated, and we verify that the generated particles have a direction which is in accordance
# with the applied rotations and the transmissions.
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/source/test079_acollin_b2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import opengate.tests.utility as tu
import matplotlib.pyplot as plt


#########################################################################################
# Simulations configuration that may be relevant to change
#######################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import opengate.tests.utility as tu
import matplotlib.pyplot as plt


#########################################################################################
# Simulations configuration that may be relevant to change
#########################################################################################
Expand Down
1 change: 0 additions & 1 deletion opengate/tests/src/source/test079_acollin_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt


#########################################################################################
# Constants
#########################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import opengate.tests.utility as tu
import matplotlib.pyplot as plt


#########################################################################################
# Simulations configuration that may be relevant to change
#########################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import opengate.tests.utility as tu
import matplotlib.pyplot as plt


#########################################################################################
# Simulations configuration that may be relevant to change
#########################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import opengate.tests.utility as tu
import matplotlib.pyplot as plt


#########################################################################################
# Simulations configuration that may be relevant to change
#########################################################################################
Expand Down
Loading
Loading