From bc95ac2b1b9b139f27ff3e1d0f1b41d00597eef3 Mon Sep 17 00:00:00 2001 From: Gord Stephen Date: Thu, 4 Jul 2024 10:37:28 -0700 Subject: [PATCH] Fix compile warnings on newer Julia versions --- src/PRASBase/SystemModel.jl | 10 +++++----- .../sequentialmontecarlo/SequentialMonteCarlo.jl | 2 +- test/runtests.jl | 3 --- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/PRASBase/SystemModel.jl b/src/PRASBase/SystemModel.jl index f68e10c6..d5f8e25f 100644 --- a/src/PRASBase/SystemModel.jl +++ b/src/PRASBase/SystemModel.jl @@ -59,11 +59,11 @@ end # No time zone constructor function SystemModel( - regions, interfaces, - generators, region_gen_idxs, - storages, region_stor_idxs, - generatorstorages, region_genstor_idxs, - lines, interface_line_idxs, + regions::Regions{N,P}, interfaces::Interfaces{N,P}, + generators::Generators{N,L,T,P}, region_gen_idxs::Vector{UnitRange{Int}}, + storages::Storages{N,L,T,P,E}, region_stor_idxs::Vector{UnitRange{Int}}, + generatorstorages::GeneratorStorages{N,L,T,P,E}, region_genstor_idxs::Vector{UnitRange{Int}}, + lines, interface_line_idxs::Vector{UnitRange{Int}}, timestamps::StepRange{DateTime,T} ) where {N,L,T<:Period,P<:PowerUnit,E<:EnergyUnit} diff --git a/src/ResourceAdequacy/simulations/sequentialmontecarlo/SequentialMonteCarlo.jl b/src/ResourceAdequacy/simulations/sequentialmontecarlo/SequentialMonteCarlo.jl index 456bf114..95d5853e 100644 --- a/src/ResourceAdequacy/simulations/sequentialmontecarlo/SequentialMonteCarlo.jl +++ b/src/ResourceAdequacy/simulations/sequentialmontecarlo/SequentialMonteCarlo.jl @@ -64,7 +64,7 @@ function assess( sampleseeds::Channel{Int}, results::Channel{<:Tuple{Vararg{ResultAccumulator{SequentialMonteCarlo}}}}, resultspecs::ResultSpec... -) where {R<:ResultSpec, N} +) where N dispatchproblem = DispatchProblem(system) systemstate = SystemState(system) diff --git a/test/runtests.jl b/test/runtests.jl index a7c2c7e5..b602f4c7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -13,9 +13,6 @@ withinrange(x::ReliabilityMetric, y::Real, n::Real) = withinrange(x::Tuple{<:Real, <:Real}, y::Real, nsamples::Int, n::Real) = isapprox(first(x), y, atol=n*last(x)/sqrt(nsamples)) -Base.isapprox(x::DiscreteNonParametric, y::DiscreteNonParametric) = - isapprox(support(x), support(y)) && isapprox(probs(x), probs(y)) - Base.isapprox(x::T, y::T) where {T <: Tuple} = all(isapprox.(x, y)) Base.isapprox(x::T, y::T) where {T <: ReliabilityMetric} =