From eac9803ffbcd2fc463936d622a222342cedf98d5 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:01:12 +0100 Subject: [PATCH 01/15] Replacing the thermogis-1.7.0-shaded.jar --- resources/thermogis_jar/thermogis-1.7.0-shaded.jar | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/thermogis_jar/thermogis-1.7.0-shaded.jar b/resources/thermogis_jar/thermogis-1.7.0-shaded.jar index 2c274aa..e9b30a8 100644 --- a/resources/thermogis_jar/thermogis-1.7.0-shaded.jar +++ b/resources/thermogis_jar/thermogis-1.7.0-shaded.jar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7991ac4e8853db7f863de4c809f0d8035ea8c9ca5a90707e2e93799d6d6f39d6 -size 173317904 +oid sha256:207f0a0ecd48947dd4fdb2739edc17eaf60e1cd4351d06915adcc25d29b10e21 +size 173318007 -- GitLab From 6cafe9371ed512274735afa27cf77082f1ecf239 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:06:07 +0100 Subject: [PATCH 02/15] Adding a new gitlab-ci test which checks if the pyproject.toml has been changed to add a new version number --- .gitlab-ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89e9221..1a2f60e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - test + - validate - deploy Run tests: @@ -23,6 +24,35 @@ Run tests: - main - merge_requests +check_version_and_changelog: + stage: validate + image: alpine:latest + script: + # Fail if version file was not changed + - | + if ! git diff --name-only HEAD~1 HEAD | grep -qE '(^|/)version\.py$|(^|/)VERSION$'; then + echo "Version number has not been updated." + version_not_changed=true + else + echo "Version number updated." + fi + + # Fail if changelog was not changed + - | + if ! git diff --name-only HEAD~1 HEAD | grep -qE 'docs\changelog.md'; then + echo "Changelog has not been updated." + changelog_not_changed=true + else + echo "Changelog updated." + fi + + # Final condition → fail if either missing + - | + if [ "$version_not_changed" = true ] || [ "$changelog_not_changed" = true ]; then + echo "Pipeline failed: version and/or changelog missing" + exit 1 + fi + pages: stage: deploy image: python:latest -- GitLab From cc41d6186f08dd41c1e6f4b8c40bdc9dcb3031f3 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:07:06 +0100 Subject: [PATCH 03/15] Adding a new gitlab-ci test which checks if the pyproject.toml has been changed to add a new version number --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a2f60e..2234f45 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ stages: - test - validate - - deploy + - deploy_documentation Run tests: stage: test @@ -54,7 +54,7 @@ check_version_and_changelog: fi pages: - stage: deploy + stage: deploy_documentation image: python:latest script: - pip install mkdocs mkdocs-material mkdocstrings-python -- GitLab From a996f09ff85fd843dbb6994c6530ae06b65c3b29 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:07:48 +0100 Subject: [PATCH 04/15] Changing name of the pythermogis logo file so it is rendered in the docs --- ..._transparent.png => pythermogis_transparent.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/images/{pyThermoGIS_transparent.png => pythermogis_transparent.png} (100%) diff --git a/docs/images/pyThermoGIS_transparent.png b/docs/images/pythermogis_transparent.png similarity index 100% rename from docs/images/pyThermoGIS_transparent.png rename to docs/images/pythermogis_transparent.png -- GitLab From 4bb9e4a66b2c4e3762d5c08f070954d78081e0b3 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:17:22 +0100 Subject: [PATCH 05/15] Adding a copy of the hea pump test from the java code --- tests/test_pyThermoGIS_Doublet_Benchmark.py | 165 ------------- tests/test_pythermogis_Doublet_Benchmark.py | 244 ++++++++++++++++++++ 2 files changed, 244 insertions(+), 165 deletions(-) delete mode 100644 tests/test_pyThermoGIS_Doublet_Benchmark.py create mode 100644 tests/test_pythermogis_Doublet_Benchmark.py diff --git a/tests/test_pyThermoGIS_Doublet_Benchmark.py b/tests/test_pyThermoGIS_Doublet_Benchmark.py deleted file mode 100644 index 01d934d..0000000 --- a/tests/test_pyThermoGIS_Doublet_Benchmark.py +++ /dev/null @@ -1,165 +0,0 @@ -from unittest import TestCase - -from pythermogis import * - -class ThermoGISDoubletBenchmark(TestCase): - """ - This is a series of tests which produce the same results found in the Java code and in test_ThermoGISDoublet_Benchmark, but using the ntended pythermogis implementation - """ - - def test_calculateDoubletPerformanceTest(self): - viscosity_mode = get_viscosity_mode("kestin") - utc_properties = (instantiate_utc_properties_builder() - .setDhReturnTemp(40) - .setViscosityMode(viscosity_mode) - .build()) - - input_data = xr.Dataset({ - "thickness_mean": ((), 100), - "thickness_sd": ((), 0.0), - "ntg": ((), 1.0), - "porosity": ((), 0.0), - "depth": ((), 2000), - "temperature": ((), 76), - "ln_permeability_mean": ((), np.log(175)), - "ln_permeability_sd": ((), 0.0), - }) - - results = calculate_doublet_performance_stochastic(input_data, utc_properties=utc_properties, rng_seed=0) - - # Assert - self.assertTrue(np.isclose(17500, results.transmissivity.data[0], 0.001)) - self.assertTrue(np.isclose(227.2757568359375, results.flow_rate.data[0], 1)) - self.assertTrue(np.isclose(60, results.pres.data[0], 0.001)) - self.assertTrue(np.isclose(6.616096470753937, results.utc.data[0], 0.001)) - self.assertTrue(np.isclose(1159.17968, results.welld.data[0], 0.001)) - self.assertTrue(np.isclose(13.627557754516602, results.cop.data[0], 0.001)) - self.assertTrue(np.isclose(8.636903762817383, results.power.data[0], 0.001)) - - def test_calculateDoubletPerformance_directHeat(self): - """ - This is a copy of a test from the Java ThermoGisDoubletTest.java script; to validate that this python implementation of the ThermoGIS Doublet - returns the same values. - """ - # Arrange - # Instantiate the UTC properties class - utc_properties = self.setup_template_utc_properties_builder().setOpexBase(0).build() - - input_data = xr.Dataset({ - "thickness_mean": ((), 100), - "thickness_sd": ((), 0.0), - "ntg": ((), 1.0), - "porosity": ((), 0.0), - "depth": ((), 2000), - "temperature": ((), 76), - "ln_permeability_mean": ((), np.log(175)), - "ln_permeability_sd": ((), 0.0), - }) - - # Act - results = calculate_doublet_performance_stochastic(input_data, utc_properties=utc_properties, rng_seed=0) - - - # Assert - self.assertTrue(np.isclose(17500, results.transmissivity.data[0], 0.001)) - self.assertTrue(np.isclose(227.2757568359375, results.flow_rate.data[0], 1)) - self.assertTrue(np.isclose(60, results.pres.data[0], 0.001)) - self.assertTrue(np.isclose(5.229816400909403, results.utc.data[0], 0.001)) - self.assertTrue(np.isclose(1159.1796, results.welld.data[0], 0.001)) - self.assertTrue(np.isclose(13.623167037963867, results.cop.data[0], 0.001)) - self.assertTrue(np.isclose(8.624696731567383, results.power.data[0], 0.001)) - - def test_calculateDoubletPerformance_chiller(self): - """ - This is a copy of a test from the Java ThermoGisDoubletTest.java script; to validate that this python implementation of the ThermoGIS Doublet - returns the same values. - """ - # Arrange - # Instantiate the UTC properties class - utc_properties = (self.setup_template_utc_properties_builder().setCapexConst(0.5) - .setCapexVariable(1100) - .setHeatExchangerEfficiency(0.4) - .setDhReturnTemp(60) - .setHeatExchangerParasitic(0.1).build()) - - input_data = xr.Dataset({ - "thickness_mean": ((), 100), - "thickness_sd": ((), 0.0), - "ntg": ((), 1.0), - "porosity": ((), 0.0), - "depth": ((), 2000), - "temperature": ((), 76), - "ln_permeability_mean": ((), np.log(175)), - "ln_permeability_sd": ((), 0.0), - }) - - # Act - results = calculate_doublet_performance_stochastic(input_data, utc_properties=utc_properties, rng_seed=0) - - # Assert - self.assertTrue(np.isclose(17500, results.transmissivity.data[0], 0.001)) - self.assertTrue(np.isclose(227.2757568359375, results.flow_rate.data[0], 1)) - self.assertTrue(np.isclose(60, results.pres.data[0], 0.001)) - self.assertTrue(np.isclose(20.470115103822685, results.utc.data[0], 0.001)) - self.assertTrue(np.isclose(1227.1484375, results.welld.data[0], 0.001)) - self.assertTrue(np.isclose(1.8887300754346803, results.cop.data[0], 0.001)) - self.assertTrue(np.isclose(1.6594701766967774, results.power.data[0], 0.001)) - self.assertTrue(np.isclose(12.748051248109613, results.capex.data[0], 0.001)) - - def test_calculateDoubletPerformance_ORC(self): - """ - This is a copy of a test from the Java ThermoGisDoubletTest.java script; to validate that this python implementation of the ThermoGIS Doublet - returns the same values. - """ - # Arrange - # Instantiate the UTC properties class - utc_properties = (self.setup_template_utc_properties_builder() - .setCapexConst(0) - .setCapexVariable(2300) - .setHeatExchangerEfficiency(0.6) - .setUseORC(True) - .setHeatExchangerBasetemp(20) - .setDhReturnTemp(60) - .build()) - - input_data = xr.Dataset({ - "thickness_mean": ((), 100), - "thickness_sd": ((), 0.0), - "ntg": ((), 1.0), - "porosity": ((), 0.0), - "depth": ((), 2000), - "temperature": ((), 100), - "ln_permeability_mean": ((), np.log(175)), - "ln_permeability_sd": ((), 0.0), - }) - - # Act - results = calculate_doublet_performance_stochastic(input_data, utc_properties=utc_properties, rng_seed=0) - - # Assert - self.assertTrue(np.isclose(17500, results.transmissivity.data[0], 0.001)) - self.assertTrue(np.isclose(293.6246643066406, results.flow_rate.data[0], 1)) - self.assertTrue(np.isclose(60, results.pres.data[0], 0.001)) - self.assertTrue(np.isclose(36.98296076530068, results.utc.data[0], 0.001)) - self.assertTrue(np.isclose(0.05274631495788107, results.power.data[0], 0.01)) - self.assertTrue(np.isclose(1306.4453125, results.welld.data[0], 0.001)) - self.assertTrue(np.isclose(0.06459403120103477, results.cop.data[0], 0.001)) - self.assertTrue(np.isclose(12.44409167482118, results.capex.data[0], 0.001)) - - def setup_template_utc_properties_builder(self): - viscosity_mode = get_viscosity_mode("kestin") - - return (instantiate_utc_properties_builder() - .setSalinityGradient(47.0) - .setDrillingTime(1) - .setTaxRate(20) - .setEquityReturn(15) - .setOpexBase(10000) - .setOpexPerPower(50) - .setWellCostScaling(1) - .setOpexPerEnergy(0) - .setWellCostConst(0.375) - .setWellCostZ(1050) - .setWellCostZ2(0.3) - .setDhReturnTemp(40) - .setViscosityMode(viscosity_mode)) \ No newline at end of file diff --git a/tests/test_pythermogis_Doublet_Benchmark.py b/tests/test_pythermogis_Doublet_Benchmark.py new file mode 100644 index 0000000..cc274af --- /dev/null +++ b/tests/test_pythermogis_Doublet_Benchmark.py @@ -0,0 +1,244 @@ +from unittest import TestCase + +from pythermogis import * + + +class ThermoGISDoubletBenchmark(TestCase): + """ + This is a series of tests which produce the same results found in the Java code and in test_ThermoGISDoublet_Benchmark, but using the ntended pythermogis implementation + """ + + def test_calculateDoubletPerformanceTest(self): + viscosity_mode = get_viscosity_mode("kestin") + utc_properties = ( + instantiate_utc_properties_builder() + .setDhReturnTemp(40) + .setViscosityMode(viscosity_mode) + .build() + ) + + input_data = xr.Dataset( + { + "thickness_mean": ((), 100), + "thickness_sd": ((), 0.0), + "ntg": ((), 1.0), + "porosity": ((), 0.0), + "depth": ((), 2000), + "temperature": ((), 76), + "ln_permeability_mean": ((), np.log(175)), + "ln_permeability_sd": ((), 0.0), + } + ) + + results = calculate_doublet_performance_stochastic( + input_data, utc_properties=utc_properties, rng_seed=0 + ) + + # Assert + self.assertTrue(np.isclose(17500, results.transmissivity.data[0], 0.001)) + self.assertTrue(np.isclose(227.2757568359375, results.flow_rate.data[0], 1)) + self.assertTrue(np.isclose(60, results.pres.data[0], 0.001)) + self.assertTrue(np.isclose(6.616096470753937, results.utc.data[0], 0.001)) + self.assertTrue(np.isclose(1159.17968, results.welld.data[0], 0.001)) + self.assertTrue(np.isclose(13.627557754516602, results.cop.data[0], 0.001)) + self.assertTrue(np.isclose(8.636903762817383, results.power.data[0], 0.001)) + + def test_calculateDoubletPerformance_directHeat(self): + """ + This is a copy of a test from the Java ThermoGisDoubletTest.java script; to validate that this python implementation of the ThermoGIS Doublet + returns the same values. + """ + # Arrange + # Instantiate the UTC properties class + utc_properties = ( + self.setup_template_utc_properties_builder().setOpexBase(0).build() + ) + + input_data = xr.Dataset( + { + "thickness_mean": ((), 100), + "thickness_sd": ((), 0.0), + "ntg": ((), 1.0), + "porosity": ((), 0.0), + "depth": ((), 2000), + "temperature": ((), 76), + "ln_permeability_mean": ((), np.log(175)), + "ln_permeability_sd": ((), 0.0), + } + ) + + # Act + results = calculate_doublet_performance_stochastic( + input_data, utc_properties=utc_properties, rng_seed=0 + ) + + # Assert + self.assertTrue(np.isclose(17500, results.transmissivity.data[0], 0.001)) + self.assertTrue(np.isclose(227.2757568359375, results.flow_rate.data[0], 1)) + self.assertTrue(np.isclose(60, results.pres.data[0], 0.001)) + self.assertTrue(np.isclose(5.229816400909403, results.utc.data[0], 0.001)) + self.assertTrue(np.isclose(1159.1796, results.welld.data[0], 0.001)) + self.assertTrue(np.isclose(13.623167037963867, results.cop.data[0], 0.001)) + self.assertTrue(np.isclose(8.624696731567383, results.power.data[0], 0.001)) + + def test_calculateDoubletPerformance_chiller(self): + """ + This is a copy of a test from the Java ThermoGisDoubletTest.java script; to validate that this python implementation of the ThermoGIS Doublet + returns the same values. + """ + # Arrange + # Instantiate the UTC properties class + utc_properties = ( + self.setup_template_utc_properties_builder() + .setCapexConst(0.5) + .setCapexVariable(1100) + .setHeatExchangerEfficiency(0.4) + .setDhReturnTemp(60) + .setHeatExchangerParasitic(0.1) + .build() + ) + + input_data = xr.Dataset( + { + "thickness_mean": ((), 100), + "thickness_sd": ((), 0.0), + "ntg": ((), 1.0), + "porosity": ((), 0.0), + "depth": ((), 2000), + "temperature": ((), 76), + "ln_permeability_mean": ((), np.log(175)), + "ln_permeability_sd": ((), 0.0), + } + ) + + # Act + results = calculate_doublet_performance_stochastic( + input_data, utc_properties=utc_properties, rng_seed=0 + ) + + # Assert + self.assertTrue(np.isclose(17500, results.transmissivity.data[0], 0.001)) + self.assertTrue(np.isclose(227.2757568359375, results.flow_rate.data[0], 1)) + self.assertTrue(np.isclose(60, results.pres.data[0], 0.001)) + self.assertTrue(np.isclose(20.470115103822685, results.utc.data[0], 0.001)) + self.assertTrue(np.isclose(1227.1484375, results.welld.data[0], 0.001)) + self.assertTrue(np.isclose(1.8887300754346803, results.cop.data[0], 0.001)) + self.assertTrue(np.isclose(1.6594701766967774, results.power.data[0], 0.001)) + self.assertTrue(np.isclose(12.748051248109613, results.capex.data[0], 0.001)) + + def test_calculateDoubletPerformance_ORC(self): + """ + This is a copy of a test from the Java ThermoGisDoubletTest.java script; to validate that this python implementation of the ThermoGIS Doublet + returns the same values. + """ + # Arrange + # Instantiate the UTC properties class + utc_properties = ( + self.setup_template_utc_properties_builder() + .setCapexConst(0) + .setCapexVariable(2300) + .setHeatExchangerEfficiency(0.6) + .setUseORC(True) + .setHeatExchangerBasetemp(20) + .setDhReturnTemp(60) + .build() + ) + + input_data = xr.Dataset( + { + "thickness_mean": ((), 100), + "thickness_sd": ((), 0.0), + "ntg": ((), 1.0), + "porosity": ((), 0.0), + "depth": ((), 2000), + "temperature": ((), 100), + "ln_permeability_mean": ((), np.log(175)), + "ln_permeability_sd": ((), 0.0), + } + ) + + # Act + results = calculate_doublet_performance_stochastic( + input_data, utc_properties=utc_properties, rng_seed=0 + ) + + # Assert + self.assertTrue(np.isclose(17500, results.transmissivity.data[0], 0.001)) + self.assertTrue(np.isclose(293.6246643066406, results.flow_rate.data[0], 1)) + self.assertTrue(np.isclose(60, results.pres.data[0], 0.001)) + self.assertTrue(np.isclose(36.98296076530068, results.utc.data[0], 0.001)) + self.assertTrue(np.isclose(0.05274631495788107, results.power.data[0], 0.01)) + self.assertTrue(np.isclose(1306.4453125, results.welld.data[0], 0.001)) + self.assertTrue(np.isclose(0.06459403120103477, results.cop.data[0], 0.001)) + self.assertTrue(np.isclose(12.44409167482118, results.capex.data[0], 0.001)) + + def test_calculateDoubletPerformance_directHeat_and_heatpump(self): + """ + This is a copy of a test from the Java ThermoGisDoubletTest.java script; to validate that this python implementation of the ThermoGIS Doublet + returns the same values. + """ + # Arrange + # Instantiate the UTC properties class + utc_properties = ( + self.setup_template_utc_properties_builder() + .setOpexPerPower(100) + .setOpexBase(0) + .setHpDirectHeatInputTemp(70) + .setUseHeatPump(True) + .setDhReturnTemp(35) + .build() + ) + + input_data = xr.Dataset( + { + "thickness_mean": ((), 100), + "thickness_sd": ((), 0.0), + "ntg": ((), 1.0), + "porosity": ((), 0.0), + "depth": ((), 2000), + "temperature": ((), 50), + "ln_permeability_mean": ((), np.log(175)), + "ln_permeability_sd": ((), 0.0), + } + ) + + # Act + results = calculate_doublet_performance_stochastic( + input_data, utc_properties=utc_properties, rng_seed=0 + ) + power_hpelec = results.heat_pump_power / (results.cophp - 1) + power_ratio = results.power / (results.power + power_hpelec) + + + # Assert + self.assertTrue(np.isclose(5.856159806251526, results.power + power_hpelec, 0.1)) + self.assertTrue(np.isclose(8.83718197747828, results.utc * power_ratio, 0.1)) + self.assertTrue(np.isclose(17499.99940, 17500, 0.001)) + self.assertTrue(np.isclose(163.99771118164062, results.flow_rate, 0.001)) + self.assertTrue(np.isclose(60, results.pres, 0.001)) + self.assertTrue(np.isclose(4.97566556930542, results.power, 0.001)) + self.assertTrue(np.isclose(989.2578125, results.welld, 0.001)) + self.assertTrue(np.isclose(4.383212200392486, results.cop, 0.001)) + self.assertTrue(np.isclose(3.798196792602539, results.cophp, 0.001)) + self.assertTrue(np.isclose(10.401010755009017, results.utc, 0.001)) + self.assertTrue(np.isclose(16.50359210062243, results.capex, 0.001)) + + def setup_template_utc_properties_builder(self): + viscosity_mode = get_viscosity_mode("kestin") + + return ( + instantiate_utc_properties_builder() + .setSalinityGradient(47.0) + .setDrillingTime(1) + .setTaxRate(20) + .setEquityReturn(15) + .setOpexBase(10000) + .setOpexPerPower(50) + .setWellCostScaling(1) + .setOpexPerEnergy(0) + .setWellCostConst(0.375) + .setWellCostZ(1050) + .setWellCostZ2(0.3) + .setDhReturnTemp(40) + .setViscosityMode(viscosity_mode) + ) \ No newline at end of file -- GitLab From f00994715ec6d8c60602d83283c7c3827a454169 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:19:47 +0100 Subject: [PATCH 06/15] Changing the gitlab-ci.yml so that the version number and the changelog has to be updated before merging to main --- .gitlab-ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2234f45..e745aa8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ stages: - test - - validate - - deploy_documentation + - changelog-version + - deploy-documentation Run tests: stage: test @@ -24,8 +24,8 @@ Run tests: - main - merge_requests -check_version_and_changelog: - stage: validate +changelog-version: + stage: changelog-version image: alpine:latest script: # Fail if version file was not changed @@ -53,8 +53,8 @@ check_version_and_changelog: exit 1 fi -pages: - stage: deploy_documentation +deploy-documentation: + stage: deploy-documentation image: python:latest script: - pip install mkdocs mkdocs-material mkdocstrings-python -- GitLab From 089649be3efb4653b1d027dfa8e0fb8bef4825c9 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:21:31 +0100 Subject: [PATCH 07/15] Changing the gitlab-ci.yml so that the version number and the changelog has to be updated before merging to main --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e745aa8..e232aa9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ stages: - - test +# - test - changelog-version - deploy-documentation -- GitLab From 6b53e2b5b8e91d80d97283dc5992f57b8079f126 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:22:39 +0100 Subject: [PATCH 08/15] Changing the gitlab-ci.yml so that the version number and the changelog has to be updated before merging to main --- .gitlab-ci.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e232aa9..7f2081d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ stages: -# - test + - test - changelog-version - deploy-documentation @@ -10,16 +10,17 @@ Run tests: image: ghcr.io/prefix-dev/pixi:latest allow_failure: false script: - - export TZ=Europe/Amsterdam - - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - - apt-get update - - apt-get install -y build-essential gcc tk openjdk-17-jdk - - export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 - - export PATH=$JAVA_HOME/bin:$PATH - - export THERMOGIS_JAR=$CI_PROJECT_DIR/resources/thermogis_jar/thermogis-1.7.0-shaded.jar - - pixi install - - pixi run pytest -rx tests/ - - rm -rf /var/lib/apt/lists/* +# - export TZ=Europe/Amsterdam +# - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# - apt-get update +# - apt-get install -y build-essential gcc tk openjdk-17-jdk +# - export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 +# - export PATH=$JAVA_HOME/bin:$PATH +# - export THERMOGIS_JAR=$CI_PROJECT_DIR/resources/thermogis_jar/thermogis-1.7.0-shaded.jar +# - pixi install +# - pixi run pytest -rx tests/ +# - rm -rf /var/lib/apt/lists/* + - echo "lorem ipsum" only: - main - merge_requests -- GitLab From 3e979751d7f2d9dfe6f7c139a22c636df15a026a Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:26:10 +0100 Subject: [PATCH 09/15] Changing the gitlab-ci.yml so that the version number and the changelog has to be updated before merging to main --- .gitlab-ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f2081d..6fb9557 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ stages: - test - - changelog-version + - check-version-changelog - deploy-documentation Run tests: @@ -25,8 +25,8 @@ Run tests: - main - merge_requests -changelog-version: - stage: changelog-version +Check Version and Changelog: + stage: check-version-changelog image: alpine:latest script: # Fail if version file was not changed @@ -53,8 +53,11 @@ changelog-version: echo "Pipeline failed: version and/or changelog missing" exit 1 fi + only: + - main + - merge_requests -deploy-documentation: +Deploy Documentation: stage: deploy-documentation image: python:latest script: -- GitLab From 19931fee1c83fac490d0e8d728b4dc8f599f0927 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:31:54 +0100 Subject: [PATCH 10/15] Changing the changelog.md and pyproject.toml version number --- docs/changelog.md | 4 ++++ pyproject.toml | 2 +- ...let_Benchmark.py => test_pythermogis_doublet_benchmark.py} | 0 3 files changed, 5 insertions(+), 1 deletion(-) rename tests/{test_pythermogis_Doublet_Benchmark.py => test_pythermogis_doublet_benchmark.py} (100%) diff --git a/docs/changelog.md b/docs/changelog.md index 05f4a84..ba6c6de 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -18,3 +18,7 @@ Another bug was fixed, this occured when sampling for transmissivity with high o Additional Functionality: - two functions have been added to print out the environment variables THERMOGIS_JAR and JAVA_HOME. This enables users to debug if their are issues with their installation. +## v1.2.3 (27-11-2025) +Updating the Java jar which has a fixed implementation of the heat pump. Before the heat pump cop was not being correctly calculated. There is a test added to test_pythermogis_doublet_benchmark.py to showcase how the new heatpump mode +should be used. + diff --git a/pyproject.toml b/pyproject.toml index 60532c2..390e14b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pythermogis" -version = "1.2.1" +version = "1.2.2" description = "This repository is used as a python API for the ThermoGIS Doublet simulations" authors = [ { name = "Hen Brett", email = "hen.brett@tno.nl" }, diff --git a/tests/test_pythermogis_Doublet_Benchmark.py b/tests/test_pythermogis_doublet_benchmark.py similarity index 100% rename from tests/test_pythermogis_Doublet_Benchmark.py rename to tests/test_pythermogis_doublet_benchmark.py -- GitLab From 9e369a4e198a3625b4a6d462c824e7b036756551 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:33:37 +0100 Subject: [PATCH 11/15] ensuring that git is installed in the check version and changelog --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6fb9557..db19b09 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,6 +30,9 @@ Check Version and Changelog: image: alpine:latest script: # Fail if version file was not changed + - apk update + - apk add git + - git --version - | if ! git diff --name-only HEAD~1 HEAD | grep -qE '(^|/)version\.py$|(^|/)VERSION$'; then echo "Version number has not been updated." -- GitLab From 2b8313a174dfef655ff54db24d0ad86394f6d7b3 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:36:27 +0100 Subject: [PATCH 12/15] ensuring that git is installed in the check version and changelog --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db19b09..a2877a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,12 +38,13 @@ Check Version and Changelog: echo "Version number has not been updated." version_not_changed=true else + version_not_changed=false echo "Version number updated." fi # Fail if changelog was not changed - | - if ! git diff --name-only HEAD~1 HEAD | grep -qE 'docs\changelog.md'; then + if ! git diff --name-only HEAD~1 HEAD | grep -qE '\docs\changelog.md'; then echo "Changelog has not been updated." changelog_not_changed=true else -- GitLab From 1e6997aa13bc477d83424216893c49846942e8a2 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 09:52:59 +0100 Subject: [PATCH 13/15] ensuring that git is installed in the check version and changelog --- .gitlab-ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a2877a6..b274e97 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,7 @@ Run tests: - main - merge_requests -Check Version and Changelog: +Version and Changelog updated: stage: check-version-changelog image: alpine:latest script: @@ -44,13 +44,13 @@ Check Version and Changelog: # Fail if changelog was not changed - | - if ! git diff --name-only HEAD~1 HEAD | grep -qE '\docs\changelog.md'; then - echo "Changelog has not been updated." - changelog_not_changed=true - else - echo "Changelog updated." - fi - +# if ! git diff --name-only HEAD~1 HEAD | grep -qE '\docs\changelog.md'; then +# echo "Changelog has not been updated." +# changelog_not_changed=true +# else +# echo "Changelog updated." +# fi + changelog_not_changed=true # Final condition → fail if either missing - | if [ "$version_not_changed" = true ] || [ "$changelog_not_changed" = true ]; then -- GitLab From d0a10053d34192a2e5475d7b4c5aa9a50cceaa99 Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 10:00:06 +0100 Subject: [PATCH 14/15] ensuring that git is installed in the check version and changelog --- .gitlab-ci.yml | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b274e97..68170ef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,32 +29,13 @@ Version and Changelog updated: stage: check-version-changelog image: alpine:latest script: - # Fail if version file was not changed - apk update - apk add git - git --version + - git diff --quiet main -- .\docs\changelog.md || changelog_not_changed=true - | - if ! git diff --name-only HEAD~1 HEAD | grep -qE '(^|/)version\.py$|(^|/)VERSION$'; then - echo "Version number has not been updated." - version_not_changed=true - else - version_not_changed=false - echo "Version number updated." - fi - - # Fail if changelog was not changed - - | -# if ! git diff --name-only HEAD~1 HEAD | grep -qE '\docs\changelog.md'; then -# echo "Changelog has not been updated." -# changelog_not_changed=true -# else -# echo "Changelog updated." -# fi - changelog_not_changed=true - # Final condition → fail if either missing - - | - if [ "$version_not_changed" = true ] || [ "$changelog_not_changed" = true ]; then - echo "Pipeline failed: version and/or changelog missing" + if [ "$changelog_not_changed" = true ]; then + echo "Pipeline failed: changelog has not been updated" exit 1 fi only: -- GitLab From 4ef8be428e3283e744d1c1f32a868e2cfdf9515e Mon Sep 17 00:00:00 2001 From: bretth Date: Thu, 27 Nov 2025 10:03:03 +0100 Subject: [PATCH 15/15] Putting the gitlab-ci.yml back, will try again another time in a separate MR --- .gitlab-ci.yml | 45 +++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 68170ef..89e9221 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ stages: - test - - check-version-changelog - - deploy-documentation + - deploy Run tests: stage: test @@ -10,40 +9,22 @@ Run tests: image: ghcr.io/prefix-dev/pixi:latest allow_failure: false script: -# - export TZ=Europe/Amsterdam -# - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -# - apt-get update -# - apt-get install -y build-essential gcc tk openjdk-17-jdk -# - export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 -# - export PATH=$JAVA_HOME/bin:$PATH -# - export THERMOGIS_JAR=$CI_PROJECT_DIR/resources/thermogis_jar/thermogis-1.7.0-shaded.jar -# - pixi install -# - pixi run pytest -rx tests/ -# - rm -rf /var/lib/apt/lists/* - - echo "lorem ipsum" + - export TZ=Europe/Amsterdam + - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + - apt-get update + - apt-get install -y build-essential gcc tk openjdk-17-jdk + - export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 + - export PATH=$JAVA_HOME/bin:$PATH + - export THERMOGIS_JAR=$CI_PROJECT_DIR/resources/thermogis_jar/thermogis-1.7.0-shaded.jar + - pixi install + - pixi run pytest -rx tests/ + - rm -rf /var/lib/apt/lists/* only: - main - merge_requests -Version and Changelog updated: - stage: check-version-changelog - image: alpine:latest - script: - - apk update - - apk add git - - git --version - - git diff --quiet main -- .\docs\changelog.md || changelog_not_changed=true - - | - if [ "$changelog_not_changed" = true ]; then - echo "Pipeline failed: changelog has not been updated" - exit 1 - fi - only: - - main - - merge_requests - -Deploy Documentation: - stage: deploy-documentation +pages: + stage: deploy image: python:latest script: - pip install mkdocs mkdocs-material mkdocstrings-python -- GitLab