From baa62767e8bef2bbf1fed555a9a8c568db3f802d Mon Sep 17 00:00:00 2001 From: wouterpeere Date: Thu, 18 Jan 2024 12:53:22 +0100 Subject: [PATCH 1/4] Position image --- docs/index.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 4b7db972..9624fd43 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -25,7 +25,9 @@ The user manual for GHEtool Pro, together with instructions for installation, yo .. image:: GHEtoolPro.png :alt: Image of GHEtool Pro - :width: 500 + :width: 450 + :align: center + GHEtool Community ----------------- From 2216e5f522f83006a1475b5ce7051fbb082e5fbc Mon Sep 17 00:00:00 2001 From: wouterpeere Date: Thu, 18 Jan 2024 13:15:24 +0100 Subject: [PATCH 2/4] Remove unneeded lines --- GHEtool/main_class.py | 70 ++++--------------------------------------- 1 file changed, 6 insertions(+), 64 deletions(-) diff --git a/GHEtool/main_class.py b/GHEtool/main_class.py index 8259546b..1ecf91a0 100644 --- a/GHEtool/main_class.py +++ b/GHEtool/main_class.py @@ -46,7 +46,7 @@ class Borefield(BaseClass): '_ground_data', '_borefield_load', \ 'options_pygfunction', \ 'THRESHOLD_WARNING_SHALLOW_FIELD', \ - 'gui', 'D', 'r_b', 'gfunction_calculation_object', \ + 'D', 'r_b', 'gfunction_calculation_object', \ '_calculation_setup', \ '_secundary_borefield_load', '_building_load', '_external_load' @@ -56,7 +56,6 @@ def __init__(self, peak_heating: np.ndarray | list = None, baseload_cooling: np.ndarray | list = None, borefield=None, custom_gfunction: CustomGFunction = None, - gui: bool = False, load: _LoadData = None): """ @@ -74,9 +73,6 @@ def __init__(self, peak_heating: np.ndarray | list = None, Set the borefield for which the calculations will be carried out custom_gfunction : CustomGFunction Custom gfunction dataset - gui : bool - True if the Borefield object is created by the GUI. This should not be used in the code version - of GHEtool itself. Examples -------- @@ -156,9 +152,6 @@ def __init__(self, peak_heating: np.ndarray | list = None, self._calculation_setup: CalculationSetup = CalculationSetup() self.calculation_setup() - # check if the GHEtool is used by the gui i - self.gui = gui - # load on the geothermal borefield, used in calculations self._borefield_load = MonthlyGeothermalLoadAbsolute() # geothermal load, but converted to a secundary demand in optimise_load_profile @@ -1584,7 +1577,7 @@ def print_temperature_profile(self, legend: bool = True, plot_hourly: bool = Fal Returns ------- fig, ax - If the borefield object is part of the GUI, it returns the figure object + Figure object """ # calculate temperature profile self._calculate_temperature_profile(hourly=plot_hourly) @@ -1608,7 +1601,7 @@ def print_temperature_profile_fixed_depth(self, depth: float, legend: bool = Tru Returns ------- fig, ax - If the borefield object is part of the GUI, it returns the figure object + Figure object """ # calculate temperature profile self._calculate_temperature_profile(H=depth, hourly=plot_hourly) @@ -1618,8 +1611,6 @@ def print_temperature_profile_fixed_depth(self, depth: float, legend: bool = Tru def _plot_temperature_profile(self, legend: bool = True, plot_hourly: bool = False) -> Tuple[plt.Figure, plt.Axes]: """ This function plots the temperature profile. - If the Borefield object exists as part of the GUI, than the figure is returned, - otherwise it is shown. Parameters ---------- @@ -1631,7 +1622,7 @@ def _plot_temperature_profile(self, legend: bool = True, plot_hourly: bool = Fal Returns ------- fig, ax - If the borefield object is part of the GUI, it returns the figure object + Figure object """ # make a time array @@ -1673,9 +1664,7 @@ def _plot_temperature_profile(self, legend: bool = True, plot_hourly: bool = Fal if legend: ax.legend() ax.set_xlim(left=0, right=self.simulation_period) - # show figure if not in gui mode - if not self.gui: - plt.show() + plt.show() return fig, ax def _delete_calculated_temperatures(self) -> None: @@ -2184,52 +2173,5 @@ def plot_load_duration(self, legend: bool = False) -> Tuple[plt.Figure, plt.Axes # plot legend if wanted if legend: ax.legend() # - # show plt if not in gui - if not self.gui: - plt.show() - return fig, ax - - def _plot_load_duration(self, legend: bool = False) -> Tuple[plt.Figure, plt.Axes]: - """ - This function makes a load-duration curve from the hourly values. - - Parameters - ---------- - legend : bool - True if the figure should have a legend - - Returns - ---------- - Tuple - plt.Figure, plt.Axes - """ - - load = self._secundary_borefield_load if self._secundary_borefield_load != HourlyGeothermalLoad() else self.load - - # sort heating and cooling load - heating = load.hourly_heating_load.copy() - heating[::-1].sort() - - cooling = load.hourly_cooling_load.copy() - cooling.sort() - cooling = cooling * (-1) - # create new figure and axes if it not already exits otherwise clear it. - fig = plt.figure() - ax = fig.add_subplot(111) - # add sorted loads to plot - ax.step(np.arange(0, 8760, 1), heating, 'r-', label="Heating") - ax.step(np.arange(0, 8760, 1), cooling, 'b-', label="Cooling") - # create 0 line - ax.hlines(0, 0, 8759, color="black") - # add labels - ax.set_xlabel("Time [hours]") - ax.set_ylabel("Power [kW]") - # set x limits to 8760 - ax.set_xlim(0, 8760) - # plot legend if wanted - if legend: - ax.legend() # pragma: no cover - # show plt if not in gui - if not self.gui: - plt.show() # pragma: no cover + plt.show() return fig, ax From 2980e05e4f6f826580e2b71d2ede88b4a1420a7d Mon Sep 17 00:00:00 2001 From: wouterpeere Date: Thu, 18 Jan 2024 13:35:51 +0100 Subject: [PATCH 3/4] Clean-up requirements --- README.md | 12 ++++++------ docs/sources/code/getting_started.md | 20 ++++++++------------ requirements.txt | 1 - setup.cfg | 2 -- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 378e46a7..5fd5f405 100644 --- a/README.md +++ b/README.md @@ -41,12 +41,12 @@ GHEtool is in constant development with new methods, enhancements and features a ## Requirements This code is tested with Python 3.8, 3.9, 3.10, 3.11 and 3.12 and requires the following libraries (the versions mentioned are the ones with which the code is tested) -* Numpy (>=1.20.2) -* Scipy (>=1.6.2) -* Matplotlib (>=3.4.1) -* Pygfunction (>=2.2.2) -* Openpyxl (>=3.0.7) -* Pandas (>=1.2.4) +* matplotlib>=3.5.2 +* numpy>=1.23.1 +* pandas>=1.4.3 +* pygfunction>=2.2.1 +* scipy>=1.8.1 +* scikit-optimize>=0.9.0 For the tests diff --git a/docs/sources/code/getting_started.md b/docs/sources/code/getting_started.md index 267188b0..bc1de2ef 100644 --- a/docs/sources/code/getting_started.md +++ b/docs/sources/code/getting_started.md @@ -1,18 +1,14 @@ # Installation ## Requirements -This code is tested with Python 3.8, 3.9, 3.10 and 3.11 and requires the following libraries: - -* Numpy (>=1.20.2) -* Scipy (>=1.6.2) -* Matplotlib (>=3.4.1) -* Pygfunction (>=2.2.0) -* Openpyxl (>=3.0.7) -* Pandas (>=1.2.4) - -For the GUI - -* ScenarioGUI (>=0.3.0) +This code is tested with Python 3.8, 3.9, 3.10, 3.11 and 3.12 and requires the following libraries (the versions mentioned are the ones with which the code is tested) + +* matplotlib>=3.5.2 +* numpy>=1.23.1 +* pandas>=1.4.3 +* pygfunction>=2.2.1 +* scipy>=1.8.1 +* scikit-optimize>=0.9.0 For the tests diff --git a/requirements.txt b/requirements.txt index 6066bf9f..d0b31d0e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,5 @@ matplotlib>=3.5.2 numpy>=1.23.1 pandas>=1.4.3 pygfunction>=2.2.1 -configparser>=5.3.0 scipy>=1.8.1 scikit-optimize>=0.9.0 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 44bf1f24..6ed91b1b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,9 +21,7 @@ install_requires = numpy>=1.23.1 pandas>=1.4.3 pygfunction>=2.2.1 - configparser>=5.3.0 scipy>=1.8.1 - pytest>=7.1.2 scikit-optimize>=0.9.0 [flake8] From 85445563a637812ba9b8c6a284b97663b55d0b49 Mon Sep 17 00:00:00 2001 From: wouterpeere Date: Thu, 18 Jan 2024 14:17:58 +0100 Subject: [PATCH 4/4] Issue 153 fixed --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74f18051..8ed282ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Move code related to the GUI to a separate repo (issue #210). ## fixed +- Problem with multiyear hourly data and L3 sizing (issue #153). - Problem with negative g-function values (issue #187). - Bug in load-duration curve when not working with optimize load profile (issue #189). - Bug in hourly data (issue #196).