From 4c9656a2c6d97fdc019c863112d086ecb17b0d08 Mon Sep 17 00:00:00 2001 From: korevaarzer Date: Mon, 19 Jan 2026 12:32:15 +0100 Subject: [PATCH 1/2] Add paths to test dirs to a paths file in the test directory and remove the path definitions from the constants file in the geoloop package core. --- src/geoloop/constants.py | 12 ------------ test/paths.py | 6 ++++++ test/test_b2g.py | 3 ++- test/test_b2g_ana.py | 3 ++- test/test_h5.py | 3 ++- test/test_lithology.py | 3 ++- test/test_loadflowdata.py | 3 ++- test/test_plotting.py | 3 ++- test/test_pyg_ana.py | 3 ++- test/test_pygfield_ana.py | 3 ++- uv.lock | 2 +- 11 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 test/paths.py diff --git a/src/geoloop/constants.py b/src/geoloop/constants.py index e1e55cf..827212e 100644 --- a/src/geoloop/constants.py +++ b/src/geoloop/constants.py @@ -1,15 +1,3 @@ -from pathlib import Path - -repo_path = Path(__file__).parent.parent.parent - -# Test directories -test_dir = repo_path / "test" -tests_input_path = test_dir / "input" -test_output_path = test_dir / "output" - -# Resources directory -resources_path = repo_path / "resources" - # Dictionary of units for various parameters in the model. units_dict = { "Q_b": "W", diff --git a/test/paths.py b/test/paths.py new file mode 100644 index 0000000..cabb5a1 --- /dev/null +++ b/test/paths.py @@ -0,0 +1,6 @@ +from pathlib import Path + +# Test directories +test_dir = Path(__file__).parent +tests_input_path = test_dir / "input" +test_output_path = test_dir / "output" \ No newline at end of file diff --git a/test/test_b2g.py b/test/test_b2g.py index acbffba..ff06652 100644 --- a/test/test_b2g.py +++ b/test/test_b2g.py @@ -4,10 +4,11 @@ from pathlib import Path import numpy as np import xarray as xr +from paths import test_dir, tests_input_path + from geoloop.configuration import SingleRunConfig, LithologyConfig, load_nested_config from geoloop.utils.helpers import save_singlerun_results from geoloop.bin.SingleRunSim import SingleRun -from geoloop.constants import test_dir, tests_input_path from geoloop.geoloopcore.b2g import B2G from geoloop.lithology.process_lithology import ProcessLithologyToThermalConductivity diff --git a/test/test_b2g_ana.py b/test/test_b2g_ana.py index 98cd9e3..5cb80d7 100644 --- a/test/test_b2g_ana.py +++ b/test/test_b2g_ana.py @@ -4,6 +4,8 @@ from pathlib import Path import numpy as np import xarray as xr +from paths import test_dir, tests_input_path + from geoloop.configuration import SingleRunConfig, load_nested_config, LithologyConfig, StochasticRunConfig from geoloop.utils.helpers import ( save_MCrun_results, @@ -11,7 +13,6 @@ from geoloop.utils.helpers import ( ) from geoloop.utils.RunManager import run_models from geoloop.bin.SingleRunSim import SingleRun -from geoloop.constants import test_dir, tests_input_path from geoloop.geoloopcore.b2g_ana import B2G_ana from geoloop.lithology.process_lithology import ProcessLithologyToThermalConductivity diff --git a/test/test_h5.py b/test/test_h5.py index 898162d..e4086aa 100644 --- a/test/test_h5.py +++ b/test/test_h5.py @@ -4,10 +4,11 @@ from pathlib import Path import numpy as np import xarray as xr +from paths import test_dir, tests_input_path + from geoloop.configuration import load_nested_config, SingleRunConfig, LithologyConfig from geoloop.utils.helpers import save_singlerun_results from geoloop.bin.SingleRunSim import SingleRun -from geoloop.constants import test_dir, tests_input_path from geoloop.lithology.process_lithology import ProcessLithologyToThermalConductivity diff --git a/test/test_lithology.py b/test/test_lithology.py index 0e45e45..00c36fd 100644 --- a/test/test_lithology.py +++ b/test/test_lithology.py @@ -2,7 +2,8 @@ import unittest import xarray as xr -from geoloop.constants import tests_input_path, test_output_path +from paths import tests_input_path, test_output_path + from geoloop.configuration import LithologyConfig, load_single_config from geoloop.lithology.process_lithology import ProcessLithologyToThermalConductivity diff --git a/test/test_loadflowdata.py b/test/test_loadflowdata.py index 2c26e12..3b6d854 100644 --- a/test/test_loadflowdata.py +++ b/test/test_loadflowdata.py @@ -2,9 +2,10 @@ import unittest import numpy as np +from paths import tests_input_path, test_output_path + from geoloop.configuration import LoadProfileConfig, FlowDataConfig, load_single_config from geoloop.utils.helpers import apply_smoothing -from geoloop.constants import tests_input_path, test_output_path from geoloop.loadflowdata.flow_data import FlowData from geoloop.loadflowdata.loadprofile import LoadProfile diff --git a/test/test_plotting.py b/test/test_plotting.py index 582fbb1..ac48211 100644 --- a/test/test_plotting.py +++ b/test/test_plotting.py @@ -7,9 +7,10 @@ import matplotlib.pyplot as plt import numpy as np import xarray as xr +from paths import test_dir, tests_input_path + from geoloop.configuration import PlotInputConfig, load_single_config from geoloop.bin.Plotmain import DataSelection, DataTotal, PlotInput -from geoloop.constants import test_dir, tests_input_path from geoloop.plotting.create_plots import PlotResults diff --git a/test/test_pyg_ana.py b/test/test_pyg_ana.py index fdcf29c..b94720f 100644 --- a/test/test_pyg_ana.py +++ b/test/test_pyg_ana.py @@ -4,10 +4,11 @@ from pathlib import Path import numpy as np import xarray as xr +from paths import test_dir, tests_input_path + from geoloop.configuration import load_nested_config, SingleRunConfig, LithologyConfig from geoloop.utils.helpers import save_singlerun_results from geoloop.bin.SingleRunSim import SingleRun -from geoloop.constants import test_dir, tests_input_path from geoloop.geoloopcore.pyg_ana import PYG_ana from geoloop.lithology.process_lithology import ProcessLithologyToThermalConductivity diff --git a/test/test_pygfield_ana.py b/test/test_pygfield_ana.py index 1e0e5d9..b62e183 100644 --- a/test/test_pygfield_ana.py +++ b/test/test_pygfield_ana.py @@ -2,9 +2,10 @@ import unittest import numpy as np +from paths import tests_input_path + from geoloop.configuration import load_nested_config, SingleRunConfig, LithologyConfig from geoloop.bin.SingleRunSim import SingleRun -from geoloop.constants import tests_input_path from geoloop.geoloopcore.pygfield_ana import ( PYGFIELD_ana, create_curved_borehole, diff --git a/uv.lock b/uv.lock index 6917e2b..e8c0ae4 100644 --- a/uv.lock +++ b/uv.lock @@ -340,7 +340,7 @@ wheels = [ [[package]] name = "geoloop" -version = "1.0.0" +version = "1.0.1" source = { editable = "." } dependencies = [ { name = "h5netcdf" }, -- GitLab From d5aa8d5fba0f3342de95478658a560ad07882f8a Mon Sep 17 00:00:00 2001 From: korevaarzer Date: Mon, 19 Jan 2026 12:33:51 +0100 Subject: [PATCH 2/2] Increment package version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 233e1bc..01427ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "geoloop" -version = "1.0.1" +version = "1.0.2" description = "This is a Python package for simulation of (deep) vertical Borehole Heat Exchanger (BHE) systems" authors = [ { name = "Zanne Korevaar", email = "zanne.korevaar@tno.nl" }, -- GitLab