Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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" },
Expand Down
3 changes: 3 additions & 0 deletions pytrnsys_process/plot/plot_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions tests/pytrnsys_process/test_plotters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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,
Expand Down