diff --git a/NEWS.md b/NEWS.md index 5d040163..a82f3991 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # Release notes +## Unversioned + +### Bugfixes + +* Fix a bug in which field names for the capacities of a `Storage` node resulted in error message for the investment data checks. + ## Version 0.9.3 (2025-10-23) ## Bugfixes diff --git a/ext/EMIExt/checks.jl b/ext/EMIExt/checks.jl index 3f185008..577efb00 100644 --- a/ext/EMIExt/checks.jl +++ b/ext/EMIExt/checks.jl @@ -53,14 +53,16 @@ function EMB.check_node_data( return end - for cap_fields ∈ fieldnames(typeof(data)) - sub_data = getfield(data, cap_fields) + cap_map = Dict(:charge => charge, :level => level, :discharge => discharge) + + for (cap, cap_fun) ∈ cap_map + sub_data = getfield(data, cap) isnothing(sub_data) && continue check_inv_data( sub_data, - EMB.capacity(getproperty(n, cap_fields)), + EMB.capacity(cap_fun(n)), 𝒯, - " of field `" * String(cap_fields) * "`", + " of field `" * String(cap) * "`", check_timeprofiles, ) end