Skip to content

Fix #113: Prevent runtime warnings and NaNs in KPI cover factor calculations#116

Open
philippnim wants to merge 2 commits into
developfrom
113-scf-and-dcf-runtime-warning-and-nan-
Open

Fix #113: Prevent runtime warnings and NaNs in KPI cover factor calculations#116
philippnim wants to merge 2 commits into
developfrom
113-scf-and-dcf-runtime-warning-and-nan-

Conversation

@philippnim
Copy link
Copy Markdown
Contributor

#113
Replaced direct division with np.divide to safely handle scenarios where the denominator for demand or supply cover factors is zero. This prevents RuntimeWarning and NaN values, ensuring defined outputs (1 for demand cover factor, 0 for supply cover factor) in these edge cases.

…lations

Replaced direct division with `np.divide` to safely handle scenarios where the denominator for demand or supply cover factors is zero. This prevents `RuntimeWarning` and `NaN` values, ensuring defined outputs (1 for demand cover factor, 0 for supply cover factor) in these edge cases.
The calculation of annual demand and supply cover factors (dcf_year, scf_year) has been reworked. Instead of averaging cluster-level cover factors, the new approach aggregates weighted shared energy, total demand, and total supply across all clusters for a given year before calculating the overall annual factors.

Additionally, residual load and injection from the energy hub is now included in the SCF and DCF calculations.
@philippnim philippnim requested a review from JoelSchoelzel May 20, 2026 15:37
@philippnim philippnim added the bug Something isn't working label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants