diff --git a/pyproject.toml b/pyproject.toml index 13a3cbb..8840bcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pytrnsys_process" -version = "0.0.28" +version = "0.0.29" authors = [ { name="Alex Hobé", email="alex.hobe@ost.ch" }, { name="Sebastian Swoboda", email="sebastian@swoboda.ch" }, diff --git a/pytrnsys_process/plot/plot_wrappers.py b/pytrnsys_process/plot/plot_wrappers.py index e1a51d6..0e3e200 100644 --- a/pytrnsys_process/plot/plot_wrappers.py +++ b/pytrnsys_process/plot/plot_wrappers.py @@ -281,6 +281,9 @@ def energy_balance( q_in_columns + q_out_columns ].sum(axis=1) + # imbalance is visually added where it is missing. + df_modified[q_imb_column] *= -1 + columns_to_plot = q_in_columns + q_out_columns + [q_imb_column] plotter = pltrs.StackedBarChart() diff --git a/tests/pytrnsys_process/data/plotters/energy-balance/expected_calculated.png b/tests/pytrnsys_process/data/plotters/energy-balance/expected_calculated.png index 4b21140..54f328c 100644 Binary files a/tests/pytrnsys_process/data/plotters/energy-balance/expected_calculated.png and b/tests/pytrnsys_process/data/plotters/energy-balance/expected_calculated.png differ diff --git a/tests/pytrnsys_process/data/plotters/energy-balance/expected_cmap.png b/tests/pytrnsys_process/data/plotters/energy-balance/expected_cmap.png index 1811857..28e02d9 100644 Binary files a/tests/pytrnsys_process/data/plotters/energy-balance/expected_cmap.png and b/tests/pytrnsys_process/data/plotters/energy-balance/expected_cmap.png differ diff --git a/tests/pytrnsys_process/data/plotters/energy-balance/expected_given.png b/tests/pytrnsys_process/data/plotters/energy-balance/expected_given.png index 8d21c52..8cbb53b 100644 Binary files a/tests/pytrnsys_process/data/plotters/energy-balance/expected_given.png and b/tests/pytrnsys_process/data/plotters/energy-balance/expected_given.png differ diff --git a/tests/pytrnsys_process/test_plotters.py b/tests/pytrnsys_process/test_plotters.py index 48ab6db..c9189a3 100644 --- a/tests/pytrnsys_process/test_plotters.py +++ b/tests/pytrnsys_process/test_plotters.py @@ -383,6 +383,7 @@ def test_energy_balance_imb_given(self, monthly_data): self.assert_plots_match(actual_imb_given, expected) def test_energy_balance_imb_calculated(self, monthly_data): + """Exaggerating dQ to really make imbalance show up.""" # Setup actual_imb_calculated = ( const.DATA_FOLDER @@ -392,6 +393,7 @@ def test_energy_balance_imb_calculated(self, monthly_data): const.DATA_FOLDER / "plotters/energy-balance/expected_calculated.png" ) + monthly_data["QSnk60dQ"] *= 100 # Execute fig, _ = plot.energy_balance( @@ -417,6 +419,8 @@ def test_energy_balance_fig_and_ax(self, monthly_data): ) fig, ax = get_fig_and_ax() + monthly_data["QSnk60dQ"] *= 100 + # Execute _, _ = plot.energy_balance( monthly_data,