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
9 changes: 8 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Release notes

## Version 0.10.6 (2026-07-30)
## Version 0.10.7 (2026-08-11)

### Bug fixes

* Fixed a problem introduced in version 0.10.5.
* The problem was associated to wrong breaks from the check of the type of the time profile.

## Version 0.10.6 (2026-08-04)

### Bug fixes

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "EnergyModelsBase"
uuid = "5d7e687e-f956-46f3-9045-6f5a5fd49f50"
authors = ["Lars Hellemo <Lars.Hellemo@sintef.no>, Julian Straus <Julian.Straus@sintef.no>"]
version = "0.10.6"
version = "0.10.7"

[deps]
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
Expand Down
32 changes: 27 additions & 5 deletions src/checks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -661,32 +661,52 @@ on potential subprofiles. This can be achieved through the function [`check_sub_
User should never use this function directly. It should only be included within the core
structure in `EnergyModelsBase`.
"""
function check_sub_profile(::Type{TP}, sub_prof::TimeProfile, sub_msg::String) where {TP<:Union{StrategicProfile, StrategicStochasticProfile}}
function check_sub_profile(
::Type{TP},
sub_prof::TimeProfile,
sub_msg::String,
) where {TP<:Union{StrategicProfile, StrategicStochasticProfile}}
bool_op = check_not_profile(OperationalProfile, sub_prof, sub_msg)
bool_part = check_not_profile(PartitionProfile, sub_prof, sub_msg)
bool_scp = check_not_profile(ScenarioProfile, sub_prof, sub_msg)
bool_rp = check_not_profile(RepresentativeProfile, sub_prof, sub_msg)

return bool_op * bool_part * bool_scp * bool_rp
end
function check_sub_profile(::Type{TP}, sub_prof::TimeProfile, sub_msg::String) where {TP<:RepresentativeProfile}
function check_sub_profile(
::Type{TP},
sub_prof::TimeProfile,
sub_msg::String,
) where {TP<:RepresentativeProfile}
bool_op = check_not_profile(OperationalProfile, sub_prof, sub_msg)
bool_part = check_not_profile(PartitionProfile, sub_prof, sub_msg)
bool_scp = check_not_profile(ScenarioProfile, sub_prof, sub_msg)

return bool_op * bool_part * bool_scp
end
function check_sub_profile(::Type{TP}, sub_prof::TimeProfile, sub_msg::String) where {TP<:ScenarioProfile}
function check_sub_profile(
::Type{TP},
sub_prof::TimeProfile,
sub_msg::String,
) where {TP<:ScenarioProfile}
bool_op = check_not_profile(OperationalProfile, sub_prof, sub_msg)
bool_part = check_not_profile(PartitionProfile, sub_prof, sub_msg)

return bool_op * bool_part
end
function check_sub_profile(::Type{TP}, sub_prof::TimeProfile, sub_msg::String) where {TP<:PartitionProfile}
function check_sub_profile(
::Type{TP},
sub_prof::TimeProfile,
sub_msg::String,
) where {TP<:PartitionProfile}
bool_op = check_not_profile(OperationalProfile, sub_prof, sub_msg)
return bool_op
end
function check_sub_profile(::Type{TP}, sub_prof::Number, sub_msg::String) where {TP<:PartitionProfile}
function check_sub_profile(
::Type{TP},
sub_prof::Number,
sub_msg::String,
) where {TP<:PartitionProfile}
return true
end

Expand Down Expand Up @@ -719,6 +739,7 @@ function check_sub_profs(
sub_msg = "in `$(TP.name.name)`s " * msg
for sub_prof ∈ prof.vals
bool_val *= check_sub_profile(TP_C, sub_prof, sub_msg)
!bool_val && break
bool_val *= check_sub_profs(TP_C, sub_prof, sub_msg)
!bool_val && break
end
Expand Down Expand Up @@ -746,6 +767,7 @@ function check_sub_profs(
sub_msg = "in `StrategicStochasticProfile`s " * msg
for sp_array ∈ prof.vals, sub_prof ∈ sp_array
bool_val = check_sub_profile(TP_C, sub_prof, sub_msg)
!bool_val && break
bool_val *= check_sub_profs(TP_C, sub_prof, msg)
!bool_val && break
end
Expand Down
Loading