Skip to content

Commit 464f8bc

Browse files
authored
Fixed bug related to investmentdata for hydro reservoirs and level parameter. (#78)
* The bug is only present when the Storage fieldnames are changed * In the EMX repositories, this only affected HydroReservoir
1 parent fa8bbd6 commit 464f8bc

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release notes
22

3+
## Unversioned
4+
5+
### Bugfixes
6+
7+
* Fix a bug in which field names for the capacities of a `Storage` node resulted in error message for the investment data checks.
8+
39
## Version 0.9.3 (2025-10-23)
410

511
## Bugfixes

ext/EMIExt/checks.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ function EMB.check_node_data(
5353
return
5454
end
5555

56-
for cap_fields fieldnames(typeof(data))
57-
sub_data = getfield(data, cap_fields)
56+
cap_map = Dict(:charge => charge, :level => level, :discharge => discharge)
57+
58+
for (cap, cap_fun) cap_map
59+
sub_data = getfield(data, cap)
5860
isnothing(sub_data) && continue
5961
check_inv_data(
6062
sub_data,
61-
EMB.capacity(getproperty(n, cap_fields)),
63+
EMB.capacity(cap_fun(n)),
6264
𝒯,
63-
" of field `" * String(cap_fields) * "`",
65+
" of field `" * String(cap) * "`",
6466
check_timeprofiles,
6567
)
6668
end

0 commit comments

Comments
 (0)