Skip to content
Open
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
8 changes: 4 additions & 4 deletions PRAS.jl/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
"Julian Florez <Julian.Florez@nlr.gov>",
"Gord Stephen <g.stephen@imperial.ac.uk>"
]
version = "0.8.0"
version = "0.9.0"

[deps]
PRASCapacityCredits = "2e1a2ed5-e89d-4cd3-bc86-c0e88a73d3a3"
Expand All @@ -15,9 +15,9 @@ PRASFiles = "a2806276-6d43-4ef5-91c0-491704cd7cf1"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
PRASCapacityCredits = "0.8.0"
PRASCore = "0.8.0"
PRASFiles = "0.8.0"
PRASCapacityCredits = "0.9"
PRASCore = "0.9"
PRASFiles = "0.9"
Reexport = "1"
julia = "1.10"

Expand Down
15 changes: 13 additions & 2 deletions PRAS.jl/examples/pras_walkthrough.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,21 @@ sys["2"]

# We can visualize a time series of the regional load in region "2":
region_2_load = sys.regions.load[sys["2"].index,:]
plot(sys.timestamps, region_2_load,
xlabel="Time", ylabel="Region 2 load ($(powerunit))",
plot(sys.timestamps, region_2_load,
xlabel="Time", ylabel="Region 2 load ($(powerunit))",
legend=false)

# !!! tip "Get the time axis from `sys.timestamps`, don't rebuild it"
# The plot above passes `sys.timestamps` directly, which is exactly right:
# it is the true length-`N` vector of timestamps. If you need a plain
# `Vector` (e.g. for a `DataFrame` or to align an external series), use
# `collect(sys.timestamps)`. Either way, do **not** reconstruct the axis from
# `first(sys.timestamps)` and `length(sys.timestamps)` with a fixed timestep
# (e.g. `first(sys.timestamps) .+ (0:length(sys.timestamps)-1) .* timestep`):
# that assumes evenly spaced timestamps with no gaps, which is wrong for a
# non-contiguous (multi-slice) system -- it fills the gaps between slices
# with times that are not actually in the system.

# We can find more information about all the Generators in the system by
# retriving the `generators` in the SystemModel:
system_generators = sys.generators
Expand Down
4 changes: 2 additions & 2 deletions PRASCapacityCredits.jl/Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name = "PRASCapacityCredits"
uuid = "2e1a2ed5-e89d-4cd3-bc86-c0e88a73d3a3"
authors = ["Gord Stephen <g.stephen@imperial.ac.uk>"]
version = "0.8.0"
version = "0.9.0"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
PRASCore = "c5c32b99-e7c3-4530-a685-6f76e19f7fe2"

[compat]
Distributions = "0.25"
PRASCore = "0.7 - 0.8"
PRASCore = "0.7 - 0.9"
julia = "1.10"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
"Julian Florez <Julian.Florez@nlr.gov>",
"Gord Stephen <g.stephen@imperial.ac.uk>"
]
version = "0.8.1"
version = "0.9.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/DemandResponseAvailability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ accumulatortype(::DemandResponseAvailability) = DRAvailabilityAccumulator
struct DemandResponseAvailabilityResult{N,L,T<:Period} <: AbstractAvailabilityResult{N,L,T}

demandresponses::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

available::Array{Bool,3}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/DemandResponseEnergy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct DemandResponseEnergyResult{N,L,T<:Period,E<:EnergyUnit} <: AbstractEnergy

nsamples::Union{Int,Nothing}
demandresponses::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

energy_mean::Matrix{Float64}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/DemandResponseEnergySamples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ accumulatortype(::DemandResponseEnergySamples) = DemandResponseEnergySamplesAccu
struct DemandResponseEnergySamplesResult{N,L,T<:Period,E<:EnergyUnit} <: AbstractEnergyResult{N,L,T}

demandresponses::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

energy::Array{Int,3}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/Flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct FlowResult{N,L,T<:Period,P<:PowerUnit} <: AbstractFlowResult{N,L,T}

nsamples::Union{Int,Nothing}
interfaces::Vector{Pair{String,String}}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

flow_mean::Matrix{Float64}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/FlowSamples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ accumulatortype(::FlowSamples) = FlowSamplesAccumulator
struct FlowSamplesResult{N,L,T<:Period,P<:PowerUnit} <: AbstractFlowResult{N,L,T}

interfaces::Vector{Pair{String,String}}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

flow::Array{Int,3}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/GeneratorAvailability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ accumulatortype(::GeneratorAvailability) = GenAvailabilityAccumulator
struct GeneratorAvailabilityResult{N,L,T<:Period} <: AbstractAvailabilityResult{N,L,T}

generators::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

available::Array{Bool,3}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/GeneratorStorageAvailability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ accumulatortype(::GeneratorStorageAvailability) = GenStorAvailabilityAccumulator
struct GeneratorStorageAvailabilityResult{N,L,T<:Period} <: AbstractAvailabilityResult{N,L,T}

generatorstorages::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

available::Array{Bool,3}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/GeneratorStorageEnergy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct GeneratorStorageEnergyResult{N,L,T<:Period,E<:EnergyUnit} <: AbstractEner

nsamples::Union{Int,Nothing}
generatorstorages::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

energy_mean::Matrix{Float64}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/GeneratorStorageEnergySamples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ accumulatortype(::GeneratorStorageEnergySamples) = GenStorageEnergySamplesAccumu
struct GeneratorStorageEnergySamplesResult{N,L,T<:Period,E<:EnergyUnit} <: AbstractEnergyResult{N,L,T}

generatorstorages::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

energy::Array{Int,3}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/LineAvailability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct LineAvailability <: ResultSpec end
struct LineAvailabilityResult{N,L,T<:Period} <: AbstractAvailabilityResult{N,L,T}

lines::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

available::Array{Bool,3}

Expand Down
4 changes: 2 additions & 2 deletions PRASCore.jl/src/Results/Shortfall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct ShortfallResult{N, L, T <: Period, E <: EnergyUnit, S} <:
AbstractShortfallResult{N, L, T}
nsamples::Union{Int, Nothing}
regions::Regions
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}
Comment thread
sriharisundar marked this conversation as resolved.

eventperiod_mean::Float64
eventperiod_std::Float64
Expand All @@ -164,7 +164,7 @@ struct ShortfallResult{N, L, T <: Period, E <: EnergyUnit, S} <:
function ShortfallResult{N,L,T,E,S}(
nsamples::Union{Int,Nothing},
regions::Regions,
timestamps::StepRange{ZonedDateTime,T},
timestamps::AbstractVector{ZonedDateTime},
Comment thread
sriharisundar marked this conversation as resolved.
eventperiod_mean::Float64,
eventperiod_std::Float64,
eventperiod_region_mean::Vector{Float64},
Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/ShortfallSamples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ accumulatortype(::S) where {
struct ShortfallSamplesResult{N,L,T<:Period,P<:PowerUnit,E<:EnergyUnit, S} <: AbstractShortfallResult{N,L,T}

regions::Regions{N,P}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

shortfall::Array{Int,3} # r x t x s

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/StorageAvailability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ accumulatortype(::StorageAvailability) = StorAvailabilityAccumulator
struct StorageAvailabilityResult{N,L,T<:Period} <: AbstractAvailabilityResult{N,L,T}

storages::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

available::Array{Bool,3}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/StorageEnergy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct StorageEnergyResult{N,L,T<:Period,E<:EnergyUnit} <: AbstractEnergyResult{

nsamples::Union{Int,Nothing}
storages::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

energy_mean::Matrix{Float64}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/StorageEnergySamples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ accumulatortype(::StorageEnergySamples) = StorageEnergySamplesAccumulator
struct StorageEnergySamplesResult{N,L,T<:Period,E<:EnergyUnit} <: AbstractEnergyResult{N,L,T}

storages::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

energy::Array{Int,3}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/Surplus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct SurplusResult{N,L,T<:Period,P<:PowerUnit} <: AbstractSurplusResult{N,L,T}

nsamples::Union{Int,Nothing}
regions::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

surplus_mean::Matrix{Float64}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/SurplusSamples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ accumulatortype(::SurplusSamples) = SurplusSamplesAccumulator
struct SurplusSamplesResult{N,L,T<:Period,P<:PowerUnit} <: AbstractSurplusResult{N,L,T}

regions::Vector{String}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

surplus::Array{Int,3}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/Utilization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct UtilizationResult{N,L,T<:Period} <: AbstractUtilizationResult{N,L,T}

nsamples::Union{Int,Nothing}
interfaces::Vector{Pair{String,String}}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

utilization_mean::Matrix{Float64}

Expand Down
2 changes: 1 addition & 1 deletion PRASCore.jl/src/Results/UtilizationSamples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ accumulatortype(::UtilizationSamples) = UtilizationSamplesAccumulator
struct UtilizationSamplesResult{N,L,T<:Period} <: AbstractUtilizationResult{N,L,T}

interfaces::Vector{Pair{String,String}}
timestamps::StepRange{ZonedDateTime,T}
timestamps::AbstractVector{ZonedDateTime}

utilization::Array{Float64,3}

Expand Down
Loading
Loading