From 37805a78c53198780ca3d9bd019547295c6b467c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vegard=20Ven=C3=A5s?= Date: Mon, 29 Dec 2025 17:47:08 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Make=20the=20`GeoAvailability(id,=20?= =?UTF-8?q?=F0=9D=92=AB::Array{Resource})`=20constructor=20more=20flexible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NEWS.md | 6 ++++++ Project.toml | 2 +- src/structures/area.jl | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4b3f2ab..ad43f16 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # Release notes +## Version 0.11.5 (2026-01-06) + +### Adjustments + +* Make the `GeoAvailability(id, 𝒫::Array{Resource})` constructor more flexible (enabling, e.g., `GeoAvailability("av", [ResourceCarrier("Power", 0.0)])`). + ## Version 0.11.4 (2025-12-16) ### Minor updates diff --git a/Project.toml b/Project.toml index a78ecd8..81add88 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "EnergyModelsGeography" uuid = "3f775d88-a4da-46c4-a2cc-aa9f16db6708" authors = ["Espen Flo BΓΈdal "] -version = "0.11.4" +version = "0.11.5" [deps] EnergyModelsBase = "5d7e687e-f956-46f3-9045-6f5a5fd49f50" diff --git a/src/structures/area.jl b/src/structures/area.jl index 7fa132f..3b4e063 100644 --- a/src/structures/area.jl +++ b/src/structures/area.jl @@ -67,10 +67,10 @@ changed mass balance. """ struct GeoAvailability <: EMB.Availability id - input::Array{Resource} - output::Array{Resource} + input::Array{<:Resource} + output::Array{<:Resource} end -GeoAvailability(id, 𝒫::Array{Resource}) = GeoAvailability(id, 𝒫, 𝒫) +GeoAvailability(id, 𝒫::Array{<:Resource}) = GeoAvailability(id, 𝒫, 𝒫) """ name(a::Area) From 99b7080532ac0c0411feede8e24f463b107d3fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vegard=20Ven=C3=A5s?= Date: Mon, 5 Jan 2026 17:14:55 +0100 Subject: [PATCH 2/2] Add suggestion from review --- src/structures/area.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/structures/area.jl b/src/structures/area.jl index 3b4e063..fefc9bb 100644 --- a/src/structures/area.jl +++ b/src/structures/area.jl @@ -53,9 +53,9 @@ struct LimitedExchangeArea <: Area end """ - GeoAvailability <: EMB.Availability + struct GeoAvailability <: EMB.Availability -A geography `Availability` node for substituion of the general +A geography `Availability` node for substitution of the general [`GenAvailability`](@extref EnergyModelsBase.GenAvailability) node. A `GeoAvailability` is required if transmission should be included between individual [`Area`](@ref)s due to a changed mass balance. @@ -64,6 +64,10 @@ changed mass balance. - **`id`** is the name/identifier of the node. - **`inputs::Vector{<:Resource}`** are the input [`Resource`](@extref EnergyModelsBase.Resource)s. - **`output::Vector{<:Resource}`** are the output [`Resource`](@extref EnergyModelsBase.Resource)s. + +A constructor is provided so that only a single array can be provided with the fields: +- **`id`** is the name/identifier of the node. +- **`𝒫::Vector{<:Resource}`** are the [`Resource`](@extref EnergyModelsBase.Resource)s. """ struct GeoAvailability <: EMB.Availability id