From de0cb7c431baf03597f259f545a744267a2916fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Aradi?= <20679946+matyasaradi@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:09:42 +0100 Subject: [PATCH 1/9] Add a simple GitHub Action for run tests --- .github/workflows/renate-od.yml | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/renate-od.yml diff --git a/.github/workflows/renate-od.yml b/.github/workflows/renate-od.yml new file mode 100644 index 0000000..e66a024 --- /dev/null +++ b/.github/workflows/renate-od.yml @@ -0,0 +1,48 @@ +name: RENATE-OD CI + +on: + pull_request: + branches: + - master + - development + +jobs: + build: + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.6.7 + uses: actions/setup-python@v5 + with: + python-version: '3.6.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run tests + run: | + python -m unittest -v crm_solver.odetest.OdeTest + python -m unittest -v crm_solver.crmsystemtest.CrmRegressionTest + python -m unittest -v crm_solver.crmsystemtest.CrmAcceptanceTest + python -m unittest -v crm_solver.atomic_dbtest.AtomicDBTest + python -m unittest -v crm_solver.beamlettest.BeamletTest + python -m unittest -v crm_solver.atomic_dbtest.RenateDBTest + python -m unittest -v crm_solver.neutral_dbtest.NeutralDBTest + python -m unittest -v crm_solver.coefficientmatrixtest.CoefficientMatrixTest + python -m unittest -v utility.accessdatatest.AccessDataTest + python -m unittest -v utility.getdatatest.GetDataTest + python -m unittest -v utility.putdatatest.PutDataTest + python -m unittest -v utility.managetest.VersionTest + python -m unittest -v utility.managetest.CodeInfoTest + python -m unittest -v utility.inputtest.AtomicInputTest + python -m unittest -v utility.inputtest.BeamletInputTest + python -m unittest -v observation.noisetest.NoiseGeneratorTest + python -m unittest -v observation.noisetest.APDGeneratorTest + python -m unittest -v observation.noisetest.PMTGeneratorTest + python -m unittest -v observation.noisetest.PPDGeneratorTest + python -m unittest -v observation.noisetest.MPPCGeneratorTest + python -m unittest -v observation.noisetest.DetectorGeneratorTest + python -m unittest -v observation.noisetest.NoiseRegressionTest + From fdfaad86aeadbe6e9d8f8970bacf77dd3f63fda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Aradi?= <20679946+matyasaradi@users.noreply.github.com> Date: Fri, 29 Mar 2024 21:16:24 +0100 Subject: [PATCH 2/9] Set trigger to push --- .github/workflows/renate-od.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/renate-od.yml b/.github/workflows/renate-od.yml index e66a024..1e2a3d6 100644 --- a/.github/workflows/renate-od.yml +++ b/.github/workflows/renate-od.yml @@ -1,10 +1,7 @@ name: RENATE-OD CI on: - pull_request: - branches: - - master - - development + push jobs: build: From f160451978e955d08bd34d750844d548be889985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Aradi?= <20679946+matyasaradi@users.noreply.github.com> Date: Fri, 29 Mar 2024 21:19:21 +0100 Subject: [PATCH 3/9] Remove travis.yml --- .travis.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9f575f2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: python -python: - - "3.6.4" -install: - - pip install --upgrade pip - - pip install -r requirements.txt -script: - - python -m unittest -v crm_solver.odetest.OdeTest - - python -m unittest -v crm_solver.crmsystemtest.CrmRegressionTest - - python -m unittest -v crm_solver.crmsystemtest.CrmAcceptanceTest - - python -m unittest -v crm_solver.atomic_dbtest.AtomicDBTest - - python -m unittest -v crm_solver.beamlettest.BeamletTest - - python -m unittest -v crm_solver.atomic_dbtest.RenateDBTest - - python -m unittest -v crm_solver.neutral_dbtest.NeutralDBTest - - python -m unittest -v crm_solver.coefficientmatrixtest.CoefficientMatrixTest - - python -m unittest -v utility.accessdatatest.AccessDataTest - - python -m unittest -v utility.getdatatest.GetDataTest - - python -m unittest -v utility.putdatatest.PutDataTest - - python -m unittest -v utility.managetest.VersionTest - - python -m unittest -v utility.managetest.CodeInfoTest - - python -m unittest -v utility.inputtest.AtomicInputTest - - python -m unittest -v utility.inputtest.BeamletInputTest - - python -m unittest -v observation.noisetest.NoiseGeneratorTest - - python -m unittest -v observation.noisetest.APDGeneratorTest - - python -m unittest -v observation.noisetest.PMTGeneratorTest - - python -m unittest -v observation.noisetest.PPDGeneratorTest - - python -m unittest -v observation.noisetest.MPPCGeneratorTest - - python -m unittest -v observation.noisetest.DetectorGeneratorTest - - python -m unittest -v observation.noisetest.NoiseRegressionTest \ No newline at end of file From bd33e0f61b02beced88e59d5fb7b9c6f71ecf4d3 Mon Sep 17 00:00:00 2001 From: gergopokol Date: Sun, 31 Mar 2024 23:07:48 +0200 Subject: [PATCH 4/9] #277 Test failing odetest --- crm_solver/odetest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crm_solver/odetest.py b/crm_solver/odetest.py index 31c1213..2277d52 100644 --- a/crm_solver/odetest.py +++ b/crm_solver/odetest.py @@ -20,7 +20,7 @@ class OdeTest(unittest.TestCase): COEFF_MATRIX_1D = [numpy.array([[2.]]), numpy.array([[2.]])] COEFF_MATRIX_DIM_ERROR = numpy.array([15, 12]) - EXPECTED_SIZE_2 = 2 + EXPECTED_SIZE_2 = 0 EXPECTED_SIZE_3 = 3 EXPECTED_SIZE_100 = 100 EXPECTED_SIZE_200 = 200 From 2701b315968c7ac2fe7c90203ed54bad369a557e Mon Sep 17 00:00:00 2001 From: gergopokol Date: Mon, 1 Apr 2024 01:12:37 +0200 Subject: [PATCH 5/9] #277 Test corrected odetest --- crm_solver/odetest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crm_solver/odetest.py b/crm_solver/odetest.py index 2277d52..31c1213 100644 --- a/crm_solver/odetest.py +++ b/crm_solver/odetest.py @@ -20,7 +20,7 @@ class OdeTest(unittest.TestCase): COEFF_MATRIX_1D = [numpy.array([[2.]]), numpy.array([[2.]])] COEFF_MATRIX_DIM_ERROR = numpy.array([15, 12]) - EXPECTED_SIZE_2 = 0 + EXPECTED_SIZE_2 = 2 EXPECTED_SIZE_3 = 3 EXPECTED_SIZE_100 = 100 EXPECTED_SIZE_200 = 200 From 960518a34fe9f1a6fed3c1ee705b69828f36a482 Mon Sep 17 00:00:00 2001 From: Gergo Pokol Date: Thu, 16 Oct 2025 18:56:48 +0200 Subject: [PATCH 6/9] #289 Update renate-od.yml with ubuntu-latest --- .github/workflows/renate-od.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/renate-od.yml b/.github/workflows/renate-od.yml index 307db3e..8eb8283 100644 --- a/.github/workflows/renate-od.yml +++ b/.github/workflows/renate-od.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From a5b909eb7ea0c67bfd9f14dea721ff294da00b2f Mon Sep 17 00:00:00 2001 From: Gergo Pokol Date: Thu, 16 Oct 2025 21:41:20 +0200 Subject: [PATCH 7/9] #289 Update requirements.txt --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 73b92c7..11d0e26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -scipy==1.7.3 -numpy==1.22.4 +scipy==1.8.0 +numpy==1.23.1 pandas==1.4.2 h5py==3.6.0 matplotlib==3.6.0 @@ -7,4 +7,4 @@ lxml==4.8.0 tables==3.6.1 paramiko==2.8.1 scp==0.14.4 -pycollisiondb==0.1.3 \ No newline at end of file +pycollisiondb==0.1.3 From d873eaa8ee269c12ad4efd3cdd13b70ceda4c105 Mon Sep 17 00:00:00 2001 From: Gergo Pokol Date: Thu, 16 Oct 2025 21:47:27 +0200 Subject: [PATCH 8/9] #289 Update renate-od.yml with correct location of tests --- .github/workflows/renate-od.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/renate-od.yml b/.github/workflows/renate-od.yml index 8eb8283..bf41ce6 100644 --- a/.github/workflows/renate-od.yml +++ b/.github/workflows/renate-od.yml @@ -23,11 +23,11 @@ jobs: python -m unittest -v crm_solver.odetest.OdeTest python -m unittest -v crm_solver.crmsystemtest.CrmRegressionTest python -m unittest -v crm_solver.crmsystemtest.CrmAcceptanceTest - python -m unittest -v crm_solver.atomic_dbtest.AtomicDBTest python -m unittest -v crm_solver.beamlettest.BeamletTest - python -m unittest -v crm_solver.atomic_dbtest.RenateDBTest - python -m unittest -v crm_solver.neutral_dbtest.NeutralDBTest python -m unittest -v crm_solver.coefficientmatrixtest.CoefficientMatrixTest + python -m unittest -v atomic.atomic_dbtest.AtomicDBTest + python -m unittest -v atomic.atomic_dbtest.RenateDBTest + python -m unittest -v atomic.neutral_dbtest.NeutralDBTest python -m unittest -v utility.accessdatatest.AccessDataTest python -m unittest -v utility.getdatatest.GetDataTest python -m unittest -v utility.putdatatest.PutDataTest From 47473ca3b2cbd1231ed77774d2f54db3acb2c0e9 Mon Sep 17 00:00:00 2001 From: mferenczy Date: Thu, 26 Feb 2026 10:08:43 +0000 Subject: [PATCH 9/9] #289 Update beamlettest expected init condition after version updates --- .devcontainer/devcontainer.json | 25 +++++++++++++++++++++++++ .github/workflows/renate-od.yml | 2 +- crm_solver/beamlettest.py | 6 +++--- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..6b7a787 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:2-3.9-bullseye", + "features": { + "ghcr.io/devcontainers/features/python:1": { + "installTools": true, + "version": "3.9" + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pip3 install --user -r requirements.txt" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/workflows/renate-od.yml b/.github/workflows/renate-od.yml index bf41ce6..2fe8888 100644 --- a/.github/workflows/renate-od.yml +++ b/.github/workflows/renate-od.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/crm_solver/beamlettest.py b/crm_solver/beamlettest.py index d9b4212..6ec9e56 100644 --- a/crm_solver/beamlettest.py +++ b/crm_solver/beamlettest.py @@ -8,7 +8,7 @@ class BeamletTest(unittest.TestCase): EXPECTED_ATTR = ['param', 'components', 'profiles', 'coefficient_matrix', 'atomic_db', 'initial_condition'] - EXPECTED_INITIAL_CONDITION = [4832583106.4753895, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] + EXPECTED_INITIAL_CONDITION = [4832583046.75342, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] EXPECTED_PARAM_ATTR = ['beamlet_source', 'beamlet_energy', 'beamlet_species', 'beamlet_current'] EXPECTED_COMPONENTS_KEYS = ['q', 'Z', 'A'] EXPECTED_COMPONENTS_SPECIES = ['electron', 'ion1', 'ion2'] @@ -42,8 +42,8 @@ def test_initial_conditions(self): for element in range(len(self.beamlet.initial_condition)): self.assertIsInstance(self.beamlet.initial_condition[element], float, msg='Expected type for initial' ' conditions is float.') - self.assertEqual(self.beamlet.initial_condition[element], self.EXPECTED_INITIAL_CONDITION[element], - msg='Computed Init conditions do not match expected init conditions.') + self.assertAlmostEqual(self.beamlet.initial_condition[element], self.EXPECTED_INITIAL_CONDITION[element], + delta=1e-1, msg='Computed Init conditions do not match expected init conditions.') def test_param_xml(self): self.assertIsInstance(self.beamlet.param, etree._ElementTree,