InfrastructureSystems API Reference
InfrastructureSystems.COMPONENT_NAME_DELIMITER — Constant
Delimiter to use when constructing qualified names like component_type__component_name.
Core.Union — Method
Evaluate the PiecewiseLinearData or PiecewiseStepData at a given x-coordinate
InfrastructureSystems.AbstractRecorderEvent — Type
Supertype for recorder events
sourceInfrastructureSystems.AverageRateCurve — Type
An average rate curve, relating the production quantity to the average cost rate from the origin: y = f(x)/x. Can be used, for instance, in the representation of a CostCurve where x is MW and y is currency/MWh, or in the representation of a FuelCurve where x is MW and y is fuel/MWh. Typically calculated by dividing absolute values of cost rate or fuel input rate by absolute values of electric power.
InfrastructureSystems.ComponentContainer — Type
A data structure that acts like a container of components. The ComponentContainer interface consists of:
get_componentsget_componentget_available_componentsget_available_component
Notable subtypes include Components, SystemData, and PowerSystems.System.
InfrastructureSystems.ComponentSelector — Type
Given some ComponentContainer-like source of components to draw from, such as a PowerSystems.System, a ComponentSelector picks out a certain subset of them based on some user-defined selection criteria. A ComponentSelector can also be used to name that subset of components or to split it up into groups. The same ComponentSelector can be used to apply the same set of selection criteria to multiple sources of components. The primary use case for ComponentSelector is to support repeatable multi-scenario post-processing analytics (see e.g. PowerAnalytics.jl).
Formally, instances of ComponentSelector represent lazy, partitioned, named, source-independent collections of InfrastructureSystemsComponents.
Core Interface
make_selector: factory function to handleComponentSelectorcreation; end users should use this rather than calling the constructors directly.get_groups: get the groups that make up aComponentSelector, which will themselves be represented asComponentSelectors.get_components: get all the components that make up aComponentSelector, ignoring how they are grouped. A component should appear in theget_componentsof a given selector if and only if it appears in theget_componentsof at least one of that selector's groups.get_name: get the name of theComponentSelector. AllComponentSelectors have a name, whether it is specified by the user or created automatically.rebuild_selector: create a newComponentSelectorfrom an existing one with some details (e.g., the name or the grouping behavior) tweaked.
Availability Filtering
Besides the core interface, also provided are get_component for ComponentSelector subtypes that can only refer to at most one component; and get_available_component, get_available_components, and get_available_groups, which work the same as the corresponding functions without available except they only consider components for which get_available is true.
scope_limiter Filtering
The ComponentSelector methods of get_component, get_components, and get_groups, and the corresponding _available_ variants, take an optional first argument scope_limiter::Union{Function, Nothing}. If a function is passed in here, it will be used as a filter function to limit the components under consideration before the ComponentSelector's criteria are evaluated.
InfrastructureSystems.Components — Type
A simple container for components and time series data.
sourceInfrastructureSystems.CompressionSettings — Type
CompressionSettings(enabled, type, level, shuffle)Provides customization of HDF5 compression settings.
enabled::Bool: Controls whether compression is enabled.type::InfrastructureSystems.CompressionTypesModule.CompressionTypes: Specifies the type of compression to use.level::Int64: Supported values are 0-9. Higher values deliver better compression ratios but take longer.shuffle::Bool: Controls whether to enable the shuffle filter. Used with DEFLATE.
Refer to the HDF5.jl and HDF5 documentation for more details on the options.
Example
settings = CompressionSettings(
enabled = true,
type = CompressionTypes.DEFLATE, # BLOSC is also supported
level = 3,
shuffle = true,
)sourceInfrastructureSystems.CostCurve — Type
struct CostCurve{T<:InfrastructureSystems.ValueCurve} <: InfrastructureSystems.ProductionVariableCostCurve{T<:InfrastructureSystems.ValueCurve}value_curve::InfrastructureSystems.ValueCurve: The underlyingValueCurverepresentation of thisProductionVariableCostCurvepower_units::InfrastructureSystems.UnitSystemModule.UnitSystem: (default: natural units (MW)) The units for the x-axis of the curvevom_cost::LinearCurve: (default of 0) Additional proportional Variable Operation and Maintenance Cost in /(power_unit h), represented as aLinearCurve
CostCurve(value_curve, power_units, vom_cost)
CostCurve(; value_curve, power_units, vom_cost)Direct representation of the variable operation cost of a power plant in currency. Composed of a ValueCurve that may represent input-output, incremental, or average rate data. The default units for the x-axis are MW and can be specified with power_units.
InfrastructureSystems.DataFormatError — Type
Thrown upon detection of user data that is not supported.
sourceInfrastructureSystems.Deterministic — Type
mutable struct Deterministic <: AbstractDeterministic
name::String
data::SortedDict
resolution::Dates.Period
interval::Dates.Period
scaling_factor_multiplier::Union{Nothing, Function}
internal::InfrastructureSystemsInternal
endA deterministic forecast for a particular data field in a Component.
Arguments
name::String: user-defined namedata::SortedDict: timestamp - scalingfactorresolution::Dates.Period: forecast resolutioninterval::Dates.Period: forecast intervalscaling_factor_multiplier::Union{Nothing, Function}: Applicable when the time series data are scaling factors. Called on the associated component to convert the values.internal::InfrastructureSystemsInternal
InfrastructureSystems.Deterministic — Method
Deterministic(
name::AbstractString,
input_data::AbstractDict{Dates.DateTime, <:TimeSeries.TimeArray};
resolution,
interval,
normalization_factor,
scaling_factor_multiplier
) -> InfrastructureSystems.Deterministic
Construct Deterministic from a Dict of TimeArrays.
Arguments
name::AbstractString: user-defined nameinput_data::AbstractDict{Dates.DateTime, TimeSeries.TimeArray}: time series data.resolution::Union{Nothing, Dates.Period} = nothing: If nothing, infer resolution from the data. Otherwise, it must be the difference between each consecutive timestamps. Resolution is required if the resolution is irregular, such as with Dates.Month or Dates.Year.interval::Union{Nothing, Dates.Period} = nothing: If nothing, infer interval from the data. Otherwise, it must be the difference in time between the start of each window. Interval is required if the interval is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.timestamp = :timestamp: If the values are DataFrames is passed then this must be the column name that contains timestamps.
InfrastructureSystems.Deterministic — Method
Deterministic(
name::AbstractString,
filename::AbstractString,
component::InfrastructureSystems.InfrastructureSystemsComponent,
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
) -> InfrastructureSystems.Deterministic
Construct Deterministic from a CSV file. The first column must be a timestamp in DateTime format and the columns the values in the forecast window.
Arguments
name::AbstractString: user-defined namefilename::AbstractString: name of CSV file containing datacomponent::InfrastructureSystemsComponent: component associated with the datanormalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.
InfrastructureSystems.Deterministic — Method
Deterministic(
name::AbstractString,
series_data::InfrastructureSystems.RawTimeSeries,
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
) -> InfrastructureSystems.Deterministic
Construct Deterministic from RawTimeSeries.
sourceInfrastructureSystems.Deterministic — Method
Deterministic(
src::InfrastructureSystems.Deterministic,
name::AbstractString;
scaling_factor_multiplier
) -> InfrastructureSystems.Deterministic
Construct Deterministic that shares the data from an existing instance.
This is useful in cases where you want a component to use the same time series data for two different attributes.
Examples
resolution = Dates.Hour(1)
data = Dict(
DateTime("2020-01-01T00:00:00") => ones(24),
DateTime("2020-01-01T01:00:00") => ones(24),
)
# Define a Deterministic for the first attribute
forecast_max_active_power = Deterministic(
"max_active_power",
data,
resolution,
scaling_factor_multiplier = get_max_active_power,
)
add_time_series!(sys, generator, forecast_max_active_power)
# Reuse time series for second attribute
forecast_max_reactive_power = Deterministic(
forecast_max_active_power,
"max_reactive_power"
scaling_factor_multiplier = get_max_reactive_power,
)
add_time_series!(sys, generator, forecast_max_reactive_power)sourceInfrastructureSystems.Deterministic — Method
Deterministic(
forecast::InfrastructureSystems.Deterministic,
data
) -> InfrastructureSystems.Deterministic
Construct a new Deterministic from an existing instance and a subset of data.
sourceInfrastructureSystems.DeterministicMetadata — Type
mutable struct DeterministicMetadata <: ForecastMetadata
name::String
resolution::Dates.Period
initial_timestamp::Dates.DateTime
interval::Dates.Period
count::Int
time_series_uuid::UUIDs.UUID
horizon::Dates.Period
time_series_type::Type{<:AbstractDeterministic}
scaling_factor_multiplier::Union{Nothing, Function}
features::Dict{String, Union{Bool, Int, String}}
internal::InfrastructureSystemsInternal
endA deterministic forecast for a particular data field in a Component.
Arguments
name::String: user-defined nameresolution::Dates.Period:initial_timestamp::Dates.DateTime: time series availability timeinterval::Dates.Period: time step between forecast windowscount::Int: number of forecast windowstime_series_uuid::UUIDs.UUID: reference to time series datahorizon::Dates.Period: length of this time seriestime_series_type::Type{<:AbstractDeterministic}: Type of the time series data associated with this metadata.scaling_factor_multiplier::Union{Nothing, Function}: (default:nothing) Applicable when the time series data are scaling factors. Called on the associated component to convert the values.features::Dict{String, Union{Bool, Int, String}}: (default:Dict{String, Any}()) User-defined tags that differentiate multiple time series arrays that represent the same component attribute, such as different arrays for different scenarios or years.internal::InfrastructureSystemsInternal:
InfrastructureSystems.DeterministicSingleTimeSeries — Type
mutable struct DeterministicSingleTimeSeries <: AbstractDeterministic
single_time_series::SingleTimeSeries
initial_timestamp::Dates.DateTime
interval::Dates.Period
count::Int
horizon::Int
endA deterministic forecast that wraps a SingleTimeSeries
DeterministicSingleTimeSeries behaves exactly like a Deterministic, but instead of storing windows at each initial time it provides a view into the existing SingleTimeSeries at incrementing offsets. This avoids large data duplications when there are the overlapping windows between forecasts.
Can be used as a perfect forecast based on historical data when real forecast data is unavailable.
Arguments
single_time_series::SingleTimeSeries: wrappedSingleTimeSeriesobjectinitial_timestamp::Dates.DateTime: time series availability timeinterval::Dates.Period: time step between forecast windowscount::Int: number of forecast windowshorizon::Int: length of this time series
InfrastructureSystems.DeviceParameter — Type
Base type for auxillary structs. These should not be stored in a system.
sourceInfrastructureSystems.DynamicallyGroupedComponentSelector — Type
PluralComponentSelectors whose grouping is determined by a groupby field. The semantics of this field are described at make_selector.
InfrastructureSystems.FileLogger — Type
Specializes the behavior of SimpleLogger by adding timestamps and process and thread IDs.
sourceInfrastructureSystems.FilterComponentSelector — Type
ComponentSelector represented by a filter function and a type of component. Contains all the components of that type that satisfy the filter function, grouped by the groupby field (see make_selector).
InfrastructureSystems.FlattenIteratorWrapper — Type
Wrapper around Iterators.Flatten to provide total length.
sourceInfrastructureSystems.Forecast — Type
Supertype for forecast time series Current concrete subtypes are:
Subtypes of Forecast must implement:
get_horizon_countget_initial_timesget_initial_timestampget_nameget_scaling_factor_multiplierget_windowiterate_windows
InfrastructureSystems.ForecastCache — Method
Construct ForecastCache to automatically control caching of forecast data. Maintains some count of forecast windows in memory based on cache_size_bytes.
Call Base.iterate or get_next_time_series_array! to retrieve data. Each iteration will return a TimeSeries.TimeArray covering one forecast window of length horizon_count.
Arguments
::Type{T}: subtype of Forecastcomponent::InfrastructureSystemsComponent: componentname::AbstractString: forecast namestart_time::Union{Nothing, Dates.DateTime} = nothing: forecast start timehorizon_count::Union{Nothing, Int} = nothing: forecast horizon countcache_size_bytes = TIME_SERIES_CACHE_SIZE_BYTES: maximum size of data to keep in memoryignore_scaling_factors = false: controls whether to ignorescaling_factor_multiplierin the time series instance
InfrastructureSystems.ForecastKey — Type
A unique key to identify and retrieve a Forecast
See: get_time_series_keys and get_time_series(::TimeSeriesOwners, ::TimeSeriesKey).
InfrastructureSystems.FuelCurve — Type
struct FuelCurve{T<:InfrastructureSystems.ValueCurve} <: InfrastructureSystems.ProductionVariableCostCurve{T<:InfrastructureSystems.ValueCurve}value_curve::InfrastructureSystems.ValueCurve: The underlyingValueCurverepresentation of thisProductionVariableCostCurvepower_units::InfrastructureSystems.UnitSystemModule.UnitSystem: (default: natural units (MW)) The units for the x-axis of the curvefuel_cost::Union{Float64, InfrastructureSystems.TimeSeriesKey}: Either a fixed value for fuel cost or theTimeSeriesKeyto a fuel cost time seriesstartup_fuel_offtake::LinearCurve: (default of 0) Fuel consumption at the unit startup proceedure. Additional cost to the startup costs and related only to the initial fuel required to start the unit. represented as aLinearCurvevom_cost::LinearCurve: (default of 0) Additional proportional Variable Operation and Maintenance Cost in /(power_unit h) represented as aLinearCurve
FuelCurve(value_curve, power_units, fuel_cost, startup_fuel_offtake, vom_cost)
FuelCurve(value_curve, fuel_cost)
FuelCurve(value_curve, fuel_cost, startup_fuel_offtake, vom_cost)
FuelCurve(value_curve, power_units, fuel_cost)
FuelCurve(; value_curve, power_units, fuel_cost, startup_fuel_offtake, vom_cost)Representation of the variable operation cost of a power plant in terms of fuel (MBTU, liters, m^3, etc.), coupled with a conversion factor between fuel and currency. Composed of a ValueCurve that may represent input-output, incremental, or average rate data. The default units for the x-axis are MW and can be specified with power_units.
InfrastructureSystems.GeographicInfo — Type
GeographicInfo <: SupplementalAttributeSupplemental attribute to store geographic information about system components in GeoJSON format.
Arguments
geo_json::Dict{String, Any}: dictionary containing GeoJSON data representing the geographic information of the componentinternal::InfrastructureSystemsInternal: internal infrastructure systems data for managing metadata and UUID tracking
InfrastructureSystems.GeographicInfo — Method
GeographicInfo(
;
geo_json,
internal
) -> InfrastructureSystems.GeographicInfo
GeographicInfo(; geo_json, internal)Construct a GeographicInfo supplemental attribute.
Arguments
geo_json::Dict{String, Any}: dictionary containing GeoJSON data. Defaults to an empty dictionary if not providedinternal::InfrastructureSystemsInternal: internal infrastructure systems data. Defaults to a new InfrastructureSystemsInternal instance if not provided
Example
# Create with default empty geo_json
geo_info = GeographicInfo()
# Create with specific geo_json data
geo_data = Dict("type" => "Point", "coordinates" => [1.0, 2.0])
geo_info = GeographicInfo(geo_json = geo_data)sourceInfrastructureSystems.Hdf5TimeSeriesStorage — Type
Stores all time series data in an HDF5 file.
The file used is assumed to be temporary and will be automatically deleted when there are no more references to the storage object.
sourceInfrastructureSystems.Hdf5TimeSeriesStorage — Method
Hdf5TimeSeriesStorage(
create_file::Bool;
filename,
directory,
compression
) -> InfrastructureSystems.Hdf5TimeSeriesStorage
Constructs Hdf5TimeSeriesStorage.
Arguments
create_file::Bool: create new filefilename=nothing: if nothing, create a temp file, else use this name.directory=nothing: if set and filename is nothing, create a temp file in this directory. If it is not set, use the environment variableSIENNA_TIME_SERIES_DIRECTORY. If that is not set, use tempdir(). This should be set if the time series data is larger than the tmp filesystem can hold.
InfrastructureSystems.Hdf5TimeSeriesStorage — Method
Hdf5TimeSeriesStorage(
) -> InfrastructureSystems.Hdf5TimeSeriesStorage
Constructs Hdf5TimeSeriesStorage by creating a temp file.
sourceInfrastructureSystems.InMemoryTimeSeriesStorage — Type
Stores all time series data in memory.
sourceInfrastructureSystems.InMemoryTimeSeriesStorage — Method
InMemoryTimeSeriesStorage(
hdf5_storage::InfrastructureSystems.Hdf5TimeSeriesStorage
) -> InfrastructureSystems.InMemoryTimeSeriesStorage
Constructs InMemoryTimeSeriesStorage from an instance of Hdf5TimeSeriesStorage.
sourceInfrastructureSystems.InfrastructureSystemsComponent — Type
Base type for structs that are stored in a system.
Required interface functions for subtypes:
Note: InfrastructureSystems provides default implementations for these methods that depend on the struct field names name and internal. If subtypes have different field names, they must implement these methods.
- get_name()
- setnameinternal!()
- get_internal()
Warning: Subtypes should not implement the function setname!(::InfrastructureSystemsComponent, name). InfrastructureSystems uses the component name in internal data structures, so it is not safe to change the name of a component after it has been added to a system. InfrastructureSystems provides setname!(data::SystemData, component, name) for this purpose.
Optional interface functions:
The default function returns true because some get_components functions need to return all "available" and all components that don't explicitly have that attribute should be returned.
- get_available()
The default function is a no-op.
- set_available!()
Subtypes may contain time series and be associated with supplemental attributes. Those behaviors can be modified with these methods:
- supportssupplementalattributes()
- supportstimeseries()
InfrastructureSystems.InfrastructureSystemsInternal — Type
Internal storage common to InfrastructureSystems types.
sourceInfrastructureSystems.InfrastructureSystemsInternal — Method
InfrastructureSystemsInternal(
u::Base.UUID
) -> InfrastructureSystems.InfrastructureSystemsInternal
Creates InfrastructureSystemsInternal with an existing UUID.
sourceInfrastructureSystems.InfrastructureSystemsInternal — Method
InfrastructureSystemsInternal(
;
uuid,
shared_system_references,
units_info,
ext
) -> InfrastructureSystems.InfrastructureSystemsInternal
Creates InfrastructureSystemsInternal with a new UUID.
sourceInfrastructureSystems.InfrastructureSystemsType — Type
Base type for any struct in the Sienna packages. All structs must implement a kwarg-only constructor to allow deserializing from a Dict.
sourceInfrastructureSystems.InputOutputCurve — Method
Evaluate the InputOutputCurve at a given input value x.
InfrastructureSystems.LazyDictFromIterator — Method
LazyDictFromIterator creates a dictionary from an iterator, but only increments the iterator and adds items to the dictionary as it needs them. In the worst case it is identical to creating a dictionary by iterating over the entire list. Each V should have a K member.
Arguments
K: type of the dictionary keysV: type of the dictionary valuesiter: any object implementing the Iterator interfacegetter::Function: method to call on V to get its K
InfrastructureSystems.LinearCurve — Type
LinearCurve(proportional_term::Float64)
LinearCurve(proportional_term::Float64, constant_term::Float64)A linear input-output curve, representing a constant marginal rate. May have zero no-load cost (i.e., constant average rate) or not.
Arguments
proportional_term::Float64: marginal rateconstant_term::Float64: optional, cost at zero production, defaults to0.0
InfrastructureSystems.LinearFunctionData — Type
Structure to represent the underlying data of linear functions. Principally used for the representation of cost functions f(x) = proportional_term*x + constant_term.
Arguments
proportional_term::Float64: the proportional term in the represented functionconstant_term::Float64: the constant term in the represented function
InfrastructureSystems.LinearFunctionData — Method
Evaluate the LinearFunctionData at a given x-coordinate
InfrastructureSystems.ListComponentSelector — Type
ComponentSelector represented by a list of other ComponentSelectors. Those selectors form the groups.
InfrastructureSystems.LogEvent — Type
Contains information describing a log event.
sourceInfrastructureSystems.LogEventTracker — Type
LogEventTracker() -> InfrastructureSystems.LogEventTracker
LogEventTracker(
levels
) -> InfrastructureSystems.LogEventTracker
Tracks counts of all log events by level.
Examples
LogEventTracker()
LogEventTracker((Logging.Info, Logging.Warn, Logging.Error))sourceInfrastructureSystems.MultiLogger — Type
Redirects log events to multiple loggers. The primary use case is to allow logging to both a file and the console. Secondarily, it can track the counts of all log messages.
Example
MultiLogger([TerminalLogger(stderr), SimpleLogger(stream)], LogEventTracker())sourceInfrastructureSystems.MultiLogger — Method
MultiLogger(
loggers::Array{T<:Base.CoreLogging.AbstractLogger}
) -> InfrastructureSystems.MultiLogger
Creates a MultiLogger with no event tracking.
Example
MultiLogger([TerminalLogger(stderr), SimpleLogger(stream)])sourceInfrastructureSystems.NameComponentSelector — Type
ComponentSelector that refers by type and name to at most a single component. Has a single group that contains that component if it exists or contains no components if it doesn't.
InfrastructureSystems.NotImplementedError — Type
Indicate that the feature at hand happens to not be implemented for the given data even though it could be. If it is a category mistake to imagine this feature defined on that data, use another exception, like TypeError or ArgumentError.
InfrastructureSystems.PiecewiseAverageCurve — Type
PiecewiseAverageCurve(initial_input::Union{Float64, Nothing}, x_coords::Vector{Float64}, slopes::Vector{Float64})A piecewise linear curve specified by average rates between production points. May have nonzero initial value.
Arguments
initial_input::Union{Float64, Nothing}: cost at minimum production pointfirst(x_coords)(NOT at zero production), defines the start of the curvex_coords::Vector{Float64}: vector ofnproduction pointsslopes::Vector{Float64}: vector ofn-1average rates/slopes of the curve segments between the points
InfrastructureSystems.PiecewiseIncrementalCurve — Type
PiecewiseIncrementalCurve(initial_input::Union{Float64, Nothing}, x_coords::Vector{Float64}, slopes::Vector{Float64})
PiecewiseIncrementalCurve(input_at_zero::Union{Nothing, Float64}, initial_input::Union{Float64, Nothing}, x_coords::Vector{Float64}, slopes::Vector{Float64})A piecewise linear curve specified by marginal rates (slopes) between production points. May have nonzero initial value.
Arguments
input_at_zero::Union{Nothing, Float64}: (optional, defaults tonothing) cost at zero production, does NOT represent a part of the curveinitial_input::Union{Float64, Nothing}: cost at minimum production pointfirst(x_coords)(NOT at zero production), defines the start of the curvex_coords::Vector{Float64}: vector ofnproduction pointsslopes::Vector{Float64}: vector ofn-1marginal rates/slopes of the curve segments between the points
InfrastructureSystems.PiecewiseLinearData — Type
Structure to represent piecewise linear data as a series of points: two points define one segment, three points define two segments, etc. The curve starts at the first point given, not the origin. Principally used for the representation of cost functions where the points store quantities (x, y), such as (MW, /h).
Arguments
points::Vector{@NamedTuple{x::Float64, y::Float64}}: the points that define the function
InfrastructureSystems.PiecewisePointCurve — Type
PiecewisePointCurve(points::Vector{Tuple{Float64, Float64}})A piecewise linear curve specified by cost values at production points.
Arguments
points::Vector{Tuple{Float64, Float64}}or similar: vector of(production, cost)pairs
InfrastructureSystems.PiecewiseStepData — Type
Structure to represent a step function as a series of endpoint x-coordinates and segment y-coordinates: two x-coordinates and one y-coordinate defines a single segment, three x-coordinates and two y-coordinates define two segments, etc. This can be useful to represent the derivative of a PiecewiseLinearData, where the y-coordinates of this step function represent the slopes of that piecewise linear function, so there is also an optional field c that can be used to store the initial y-value of that piecewise linear function. Principally used for the representation of cost functions where the points store quantities (x, dy/dx), such as (MW, /MWh).
Arguments
x_coords::Vector{Float64}: the x-coordinates of the endpoints of the segmentsy_coords::Vector{Float64}: the y-coordinates of the segments:y_coords[1]is the y-value between
x_coords[1] and x_coords[2], etc. Must have one fewer elements than x_coords.
c::Union{Nothing, Float64}: optional, the value to use for the integral from 0 tox_coords[1]of this function
InfrastructureSystems.PluralComponentSelector — Type
ComponentSelector subtype that may refer to multiple components.
InfrastructureSystems.Probabilistic — Type
mutable struct Probabilistic <: Forecast
name::String
resolution::Dates.Period
interval::Dates.Period
percentiles::Vector{Float64}
data::SortedDict
scaling_factor_multiplier::Union{Nothing, Function}
internal::InfrastructureSystemsInternal
endA Probabilistic forecast for a particular data field in a Component.
Arguments
name::String: user-defined nameresolution::Dates.Period: forecast resolutioninterval::Dates.Period: forecast intervalpercentiles::Vector{Float64}: Percentiles for the probabilistic forecastdata::SortedDict: timestamp - scalingfactorscaling_factor_multiplier::Union{Nothing, Function}: Applicable when the time series data are scaling factors. Called on the associated component to convert the values.internal::InfrastructureSystemsInternal
InfrastructureSystems.Probabilistic — Method
Probabilistic(
name::AbstractString,
input_data::AbstractDict{Dates.DateTime, <:TimeSeries.TimeArray},
percentiles::Vector{Float64};
resolution,
interval,
normalization_factor,
scaling_factor_multiplier
) -> InfrastructureSystems.Probabilistic
Construct Probabilistic from a Dict of TimeArrays.
Arguments
name::AbstractString: user-defined nameinput_data::AbstractDict{Dates.DateTime, TimeSeries.TimeArray}: time series data.percentiles: Percentiles represented in the probabilistic forecastresolution::Union{Nothing, Dates.Period} = nothing: If nothing, infer resolution from the data. Otherwise, this must be the difference between each consecutive timestamps. This is required if the resolution is irregular, such as Dates.Month or Dates.Year.interval::Union{Nothing, Dates.Period} = nothing: If nothing, infer interval from the data. Otherwise, it must be the difference in time between the start of each window. Interval is required if the type is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.timestamp = :timestamp: If the values are DataFrames is passed then this must be the column name that contains timestamps.
InfrastructureSystems.Probabilistic — Method
Probabilistic(
name::AbstractString,
data::DataStructures.SortedDict{Dates.DateTime, Matrix{Float64}},
percentiles::Vector,
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
) -> InfrastructureSystems.Probabilistic
Construct Probabilistic from a SortedDict of Arrays.
Arguments
name::AbstractString: user-defined namedata::AbstractDict{Dates.DateTime, Matrix{Float64}}: time series data.percentiles: Percentiles represented in the probabilistic forecastresolution::Dates.Period: The resolution of the forecast in Dates.Period`interval::Union{Nothing, Dates.Period}: If nothing, infer interval from the data. Otherwise, it must be the difference in time between the start of each window. Interval is required if the type is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.
InfrastructureSystems.Probabilistic — Method
Probabilistic(
name::AbstractString,
series_data::InfrastructureSystems.RawTimeSeries,
percentiles::Vector,
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
)
Construct Deterministic from RawTimeSeries.
sourceInfrastructureSystems.Probabilistic — Method
Probabilistic(
src::InfrastructureSystems.Probabilistic,
name::AbstractString;
scaling_factor_multiplier
) -> InfrastructureSystems.Probabilistic
Construct a Probabilistic that shares the data from an existing instance.
This is useful in cases where you want a component to use the same time series data for two different attributes.
sourceInfrastructureSystems.ProbabilisticMetadata — Type
mutable struct ProbabilisticMetadata <: ForecastMetadata
name::String
initial_timestamp::Dates.DateTime
resolution::Dates.Period
interval::Dates.Period
count::Int
percentiles::Vector{Float64}
time_series_uuid::UUIDs.UUID
horizon::Dates.Period
scaling_factor_multiplier::Union{Nothing, Function}
features::Dict{String, Union{Bool, Int, String}}
internal::InfrastructureSystemsInternal
endA Probabilistic forecast for a particular data field in a Component.
Arguments
name::String: user-defined nameinitial_timestamp::Dates.DateTime: time series availability timeresolution::Dates.Period:interval::Dates.Period: time step between forecast windowscount::Int: number of forecast windowspercentiles::Vector{Float64}: Percentiles for the probabilistic forecasttime_series_uuid::UUIDs.UUID: reference to time series datahorizon::Dates.Period: length of this time seriesscaling_factor_multiplier::Union{Nothing, Function}: (default:nothing) Applicable when the time series data are scaling factors. Called on the associated component to convert the values.features::Dict{String, Union{Bool, Int, String}}: (default:Dict{String, Any}()) User-defined tags that differentiate multiple time series arrays that represent the same component attribute, such as different arrays for different scenarios or years.internal::InfrastructureSystemsInternal:
InfrastructureSystems.QuadraticCurve — Type
QuadraticCurve(quadratic_term::Float64, proportional_term::Float64, constant_term::Float64)A quadratic input-output curve, may have nonzero no-load cost.
Arguments
quadratic_term::Float64: quadratic term of the curveproportional_term::Float64: proportional term of the curveconstant_term::Float64: constant term of the curve
InfrastructureSystems.QuadraticFunctionData — Type
Structure to represent the underlying data of quadratic functions. Principally used for the representation of cost functions f(x) = quadratic_term*x^2 + proportional_term*x + constant_term.
Arguments
quadratic_term::Float64: the quadratic term in the represented functionproportional_term::Float64: the proportional term in the represented functionconstant_term::Float64: the constant term in the represented function
InfrastructureSystems.QuadraticFunctionData — Method
QuadraticFunctionData(
data::InfrastructureSystems.LinearFunctionData
) -> InfrastructureSystems.QuadraticFunctionData
Losslessly convert LinearFunctionData to QuadraticFunctionData
InfrastructureSystems.QuadraticFunctionData — Method
Evaluate the QuadraticFunctionData at a given x-coordinate
InfrastructureSystems.RawTimeSeries — Type
Wraps the data read from the text files with time series
sourceInfrastructureSystems.Recorder — Type
Records user-defined events in JSON format.
sourceInfrastructureSystems.Recorder — Method
Recorder(
name::Symbol;
io,
mode,
directory
) -> InfrastructureSystems.Recorder
Construct a Recorder.
Arguments
name::Symbol: name of recorderio::Union{Nothing, IO}: If nothing, record events in a file using name.mode = "w": Only used when io is nothing.directory = ".": Only used when io is nothing.
InfrastructureSystems.RegroupedComponentSelector — Type
ComponentSelector that wraps another ComponentSelector and applies dynamic grouping. Components are the same as those of the wrapped selector, grouping is by the groupby field (see make_selector)
InfrastructureSystems.Results — Type
To implement a sub-type of this you need to implement the methods below.
sourceInfrastructureSystems.Scenarios — Type
mutable struct Scenarios <: Forecast
name::String
resolution::Dates.Period
interval::Dates.Period
scenario_count::Int
data::SortedDict
scaling_factor_multiplier::Union{Nothing, Function}
internal::InfrastructureSystemsInternal
endA Discrete Scenario Based time series for a particular data field in a Component.
Arguments
name::String: user-defined nameresolution::Dates.Period: forecast resolutioninterval::Dates.Period: forecast intervalscenario_count::Int: Number of scenariosdata::SortedDict: timestamp - scalingfactorscaling_factor_multiplier::Union{Nothing, Function}: Applicable when the time series data are scaling factors. Called on the associated component to convert the values.internal::InfrastructureSystemsInternal
InfrastructureSystems.Scenarios — Method
Scenarios(
name::AbstractString,
input_data::AbstractDict{Dates.DateTime, <:TimeSeries.TimeArray};
resolution,
interval,
normalization_factor,
scaling_factor_multiplier
) -> InfrastructureSystems.Scenarios
Construct Scenarios from a Dict of TimeArrays.
Arguments
name::AbstractString: user-defined nameinput_data::AbstractDict{Dates.DateTime, TimeSeries.TimeArray}: time series data.resolution::Union{Nothing, Dates.Period} = nothing: If nothing, infer resolution from the data. Otherwise, it must be the difference between each consecutive timestamps. Resolution is required if the type is irregular, such as with Dates.Month or Dates.Year.interval::Union{Nothing, Dates.Period} = nothing: If nothing, infer interval from the data. Otherwise, it must be the difference in time between the start of each window. Interval is required if the type is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.timestamp = :timestamp: If the values are DataFrames is passed then this must be the column name that contains timestamps.
InfrastructureSystems.Scenarios — Method
Scenarios(
name::AbstractString,
data::DataStructures.SortedDict{Dates.DateTime, Matrix{Float64}},
resolution::Dates.Period;
interval,
normalization_factor,
scaling_factor_multiplier
) -> InfrastructureSystems.Scenarios
Construct Scenarios from a SortedDict of Arrays.
Arguments
name::AbstractString: user-defined nameinput_data::SortedDict{Dates.DateTime, Matrix{Float64}}: time series data.resolution::Dates.Period: The resolution of the forecast inDates.Periodinterval::Union{Nothing, Dates.Period}: If nothing, infer interval from the data. Otherwise, this must be the difference in time between the start of each window. Interval is required if the type is irregular, such as with Dates.Month or Dates.Year.normalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.
InfrastructureSystems.Scenarios — Method
Scenarios(
src::InfrastructureSystems.Scenarios,
name::AbstractString;
scaling_factor_multiplier
) -> InfrastructureSystems.Scenarios
Construct Scenarios that shares the data from an existing instance.
This is useful in cases where you want a component to use the same time series data for two different attributes.
sourceInfrastructureSystems.ScenariosMetadata — Type
mutable struct ScenariosMetadata <: ForecastMetadata
name::String
resolution::Dates.Period
initial_timestamp::Dates.DateTime
interval::Dates.Period
scenario_count::Int64
count::Int
time_series_uuid::UUIDs.UUID
horizon::Dates.Period
scaling_factor_multiplier::Union{Nothing, Function}
features::Dict{String, Union{Bool, Int, String}}
internal::InfrastructureSystemsInternal
endA Discrete Scenario Based time series for a particular data field in a Component.
Arguments
name::String: user-defined nameresolution::Dates.Period:initial_timestamp::Dates.DateTime: time series availability timeinterval::Dates.Period: time step between forecast windowsscenario_count::Int64: Number of scenarioscount::Int: number of forecast windowstime_series_uuid::UUIDs.UUID: reference to time series datahorizon::Dates.Period: length of this time seriesscaling_factor_multiplier::Union{Nothing, Function}: (default:nothing) Applicable when the time series data are scaling factors. Called on the associated component to convert the values.features::Dict{String, Union{Bool, Int, String}}: (default:Dict{String, Any}()) User-defined tags that differentiate multiple time series arrays that represent the same component attribute, such as different arrays for different scenarios or years.internal::InfrastructureSystemsInternal:
InfrastructureSystems.SingleTimeSeries — Type
mutable struct SingleTimeSeries <: StaticTimeSeries
name::String
data::TimeSeries.TimeArray
scaling_factor_multiplier::Union{Nothing, Function}
internal::InfrastructureSystemsInternal
endA single column of time series data for a particular data field in a Component.
In contrast with a forecast, this can represent one continual time series, such as a series of historical measurements or realizations or a single scenario (e.g. a weather year or different input assumptions).
Arguments
name::String: user-defined namedata::TimeSeries.TimeArray: timestamp - scalingfactorresolution::Dates.Period: Time duration between steps in the time series. The resolution must be the same throughout the time seriesscaling_factor_multiplier::Union{Nothing, Function}: Applicable when the time series data are scaling factors. Called on the associated component to convert the values.internal::InfrastructureSystemsInternal
InfrastructureSystems.SingleTimeSeries — Method
SingleTimeSeries(
name::AbstractString,
filename::AbstractString,
component::InfrastructureSystems.InfrastructureSystemsComponent,
resolution::Dates.Period;
normalization_factor,
scaling_factor_multiplier
) -> InfrastructureSystems.SingleTimeSeries
Construct SingleTimeSeries from a CSV file. The file must have a column that is the name of the component.
Arguments
name::AbstractString: user-defined namefilename::AbstractString: name of CSV file containing datacomponent::InfrastructureSystemsComponent: component associated with the dataresolution::Dates.Period: resolution of the time seriesnormalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.
InfrastructureSystems.SingleTimeSeries — Method
SingleTimeSeries(
name::AbstractString,
data::Union{DataFrames.DataFrame, TimeSeries.TimeArray};
normalization_factor,
scaling_factor_multiplier,
timestamp,
resolution
) -> InfrastructureSystems.SingleTimeSeries
Construct SingleTimeSeries from a TimeArray or DataFrame.
Arguments
name::AbstractString: user-defined namedata::Union{TimeSeries.TimeArray, DataFrames.DataFrame}: time series datanormalization_factor::NormalizationFactor = 1.0: optional normalization factor to apply to each data entryscaling_factor_multiplier::Union{Nothing, Function} = nothing: If the data are scaling factors then this function will be called on the component and applied to the data whenget_time_series_arrayis called.timestamp::Symbol = :timestamp: If a DataFrame is passed then this must be the column name that contains timestamps.resolution::Union{Nothing, Dates.Period} = nothing: If nothing, infer resolution from the data. Otherwise, it must be the difference between each consecutive timestamps. Resolution is required if the resolution is irregular, such as with Dates.Month or Dates.Year.
InfrastructureSystems.SingleTimeSeries — Method
SingleTimeSeries(
src::InfrastructureSystems.SingleTimeSeries,
name::AbstractString;
scaling_factor_multiplier
) -> InfrastructureSystems.SingleTimeSeries
Construct SingleTimeSeries that shares the data from an existing instance.
This is useful in cases where you want a component to use the same time series data for two different attribtues.
sourceInfrastructureSystems.SingleTimeSeries — Method
SingleTimeSeries(
time_series::InfrastructureSystems.SingleTimeSeries,
data::TimeSeries.TimeArray
) -> Any
Creates a new SingleTimeSeries from an existing instance and a subset of data.
sourceInfrastructureSystems.SingleTimeSeries — Method
SingleTimeSeries(
name::String,
resolution::Dates.Period,
initial_time::Dates.DateTime,
time_steps::Int64
) -> InfrastructureSystems.SingleTimeSeries
Construct SingleTimeSeries after constructing a TimeArray from initial_time and time_steps.
InfrastructureSystems.SingleTimeSeriesMetadata — Type
mutable struct SingleTimeSeriesMetadata <: StaticTimeSeriesMetadata
name::String
resolution::Dates.Period
initial_timestamp::Dates.DateTime
time_series_uuid::UUIDs.UUID
length::Int
scaling_factor_multiplier::Union{Nothing, Function}
features::Dict{String, Union{Bool, Int, String}}
internal::InfrastructureSystemsInternal
endA TimeSeries Data object in contigous form.
Arguments
name::String: user-defined nameresolution::Dates.Period:initial_timestamp::Dates.DateTime: time series availability timetime_series_uuid::UUIDs.UUID: reference to time series datalength::Int: length of this time seriesscaling_factor_multiplier::Union{Nothing, Function}: (default:nothing) Applicable when the time series data are scaling factors. Called on the associated component to convert the values.features::Dict{String, Union{Bool, Int, String}}: (default:Dict{String, Any}()) User-defined tags that differentiate multiple time series arrays that represent the same component attribute, such as different arrays for different scenarios or years.internal::InfrastructureSystemsInternal:
InfrastructureSystems.SingularComponentSelector — Type
ComponentSelector subtype that can only refer to zero or one components. get_components will always return zero or one components; get_component will return the component directly if there is one and return nothing if there is not.
InfrastructureSystems.StaticTimeSeries — Type
InfrastructureSystems.StaticTimeSeriesCache — Method
Construct StaticTimeSeriesCache to automatically control caching of time series data. Maintains rows of data in memory based on cache_size_bytes.
Call Base.iterate or get_time_series_array to retrieve data. Each iteration will return a TimeSeries.TimeArray of size 1.
Arguments
::Type{T}: subtype of StaticTimeSeriescomponent::InfrastructureSystemsComponent: componentname::AbstractString: time series namecache_size_bytes = TIME_SERIES_CACHE_SIZE_BYTES: maximum size of data to keep in memoryignore_scaling_factors = false: controls whether to ignorescaling_factor_multiplierin the time series instance
InfrastructureSystems.StaticTimeSeriesKey — Type
A unique key to identify and retrieve a StaticTimeSeries
See: get_time_series_keys and get_time_series(::TimeSeriesOwners, ::TimeSeriesKey).
InfrastructureSystems.StructDefinition — Method
StructDefinition(
;
struct_name,
fields,
supertype,
docstring,
is_component
)
Construct a StructDefinition for code auto-generation purposes.
Arguments
struct_name::AbstractString: Struct namefields::Vector{StructField}: Struct fields. Refer toStructField.docstring::AbstractString: Struct docstring. Defaults to an empty string.supertype::Union{String, DataType}: Struct supertype. Defaults to no supertype.is_component::Bool: Set to true for component types that will be attached to a system. Do not set to Default to true.
InfrastructureSystems.StructField — Method
StructField(
;
name,
data_type,
default,
comment,
needs_conversion,
exclude_setter,
valid_range,
validation_action,
null_value,
internal_default
)
Construct a StructField for code auto-generation purposes.
Arguments
name::String: Field namedata_type::Union{DataType, String}: Field typedefault::Any: The generated constructors will define this as a default value.comment::String: Include this comment above the field name. Defaults to empty string.needs_conversion::Bool: Set to true if the getter and setter functions need to apply unit conversion. The type must implementget_value(::Component, ::Type)andset_value(::Component, ::Type)for this combination of component type and field type.exclude_setter::Bool: Do not generate a setter function for this field. Defaults to false.valid_range::Union{Nothing, String, Dict}: Enables range validation when the component is added to a system. Define this as a Dict with "min" and "max" or as a String with the field name in the struct that defines this field's valid range and InfrastructureSystems will validate any value against that range. Usenothingif one doesn't apply, such as if there is no max limit.validation_action: Define this as "error" or "warn". If it is "error" then InfrastructureSystems will throw an exception if the validation code detects a problem. Otherwise, it will log a warning.null_value::Any: Value to indicate the field is zero or empty, such as 0.0 for Float64. If all members in the struct define this field then a "demo" constructor will be generated. This allows enteringval = MyType(nothing)in the REPL to see the layout of a struct without worrying about valid values.internal_default: Set to true for non-user-facing fields likeInfrastructureSystemsInternalthat have default values.
InfrastructureSystems.SupplementalAttribute — Type
Base type for structs that store supplemental attributes
Required interface functions for subtypes:
- get_internal()
Optional interface functions:
- get_uuid()
Subtypes may contain time series. Which requires
supports_time_series(::SupplementalAttribute)
All subtypes must include an instance of ComponentUUIDs in order to track components attached to each attribute.
sourceInfrastructureSystems.SupplementalAttributeAssociations — Method
SupplementalAttributeAssociations(
;
create_indexes
) -> InfrastructureSystems.SupplementalAttributeAssociations
Construct a new SupplementalAttributeAssociations with an in-memory database.
sourceInfrastructureSystems.SystemData — Type
mutable struct SystemData <: ComponentContainer
components::Components
"Masked components are attached to the system for overall management purposes but
are not exposed in the standard library calls like [`get_components`](@ref).
Examples are components in a subsystem."
masked_components::Components
validation_descriptors::Vector
internal::InfrastructureSystemsInternal
endContainer for system components and time series data
sourceInfrastructureSystems.SystemData — Method
SystemData(
;
validation_descriptor_file,
time_series_in_memory,
time_series_directory,
compression
) -> InfrastructureSystems.SystemData
Construct SystemData to store components and time series data.
Arguments
validation_descriptor_file = nothing: Optionally, a file defining component validation descriptors.time_series_in_memory = false: Controls whether time series data is stored in memory or in a file.time_series_directory = nothing: Controls what directory time series data is stored in. Default is the environment variableSIENNA_TIME_SERIES_DIRECTORYortempdir()if that isn't set.compression = CompressionSettings(): Controls compression of time series data.
InfrastructureSystems.TimeSeriesAssociation — Type
Defines an association between a time series owner (component or supplemental attribute) and the time series metadata.
Examples
association1 = TimeSeriesAssociation(component, time_series)
association2 = TimeSeriesAssociation(component, time_series, scenario = "high")sourceInfrastructureSystems.TimeSeriesCounts — Type
Provides counts of time series including attachments to components and supplemental attributes.
sourceInfrastructureSystems.TimeSeriesData — Type
Abstract type for time series stored in the system. Components store references to these through TimeSeriesMetadata values so that data can reside on storage media instead of memory.
sourceInfrastructureSystems.TimeSeriesFileMetadata — Type
Describes how to construct time_series from raw time series data files.
sourceInfrastructureSystems.TimeSeriesKey — Type
Supertype for keys that can be used to access a desired time series dataset
Concrete subtypes:
Required methods:
get_nameget_resolutionget_time_series_type
The default methods rely on the field names name and time_series_type.
InfrastructureSystems.TimeSeriesMetadata — Type
Abstract type for time_series that are stored in a system. Users never create them or get access to them. Stores references to TimeSeriesData.
sourceInfrastructureSystems.TimeSeriesMetadataStore — Method
TimeSeriesMetadataStore(
filename::AbstractString
) -> InfrastructureSystems.TimeSeriesMetadataStore
Load a TimeSeriesMetadataStore from a saved database into an in-memory database.
sourceInfrastructureSystems.TimeSeriesMetadataStore — Method
TimeSeriesMetadataStore(
) -> InfrastructureSystems.TimeSeriesMetadataStore
Construct a new TimeSeriesMetadataStore with an in-memory database.
sourceInfrastructureSystems.TimeSeriesStorage — Type
Abstract type for time series storage implementations.
All subtypes must implement:
clear_time_series!deserialize_time_seriesget_compression_settingsget_num_time_seriesremove_time_series!serialize_time_series!Base.isempty
InfrastructureSystems.TypeComponentSelector — Type
ComponentSelector represented by a type of component. Contains all the components of that type, grouped by the groupby field (see make_selector).
InfrastructureSystems.ValueCurve — Type
Base.close — Method
close(logger::InfrastructureSystems.MultiLogger)
Ensures that any file streams are flushed and closed.
sourceBase.convert — Method
convert(
_::Type{InfrastructureSystems.QuadraticFunctionData},
data::InfrastructureSystems.LinearFunctionData
) -> InfrastructureSystems.QuadraticFunctionData
Losslessly convert LinearFunctionData to QuadraticFunctionData
Base.flush — Method
Base.get — Method
get(
container::InfrastructureSystems.LazyDictFromIterator,
key
) -> Any
Returns the item mapped to key. If the key is already stored then it will be returned with a dictionary lookup. If it has not been stored then iterate over the list until it is found.
Returns nothing if key is not found.
sourceInfrastructureSystems._check_transform_single_time_series — Method
_check_transform_single_time_series(
data::InfrastructureSystems.SystemData,
_::Type{InfrastructureSystems.DeterministicSingleTimeSeries},
horizon::Dates.Period,
interval::Dates.Period,
resolution::Union{Nothing, Dates.Period}
) -> Vector{Any}
Check that all existing SingleTimeSeries can be converted to DeterministicSingleTimeSeries with the given horizon and interval.
Throw ConflictingInputsError if any time series cannot be converted.
Return a Vector of NamedTuple of component, time series metadata, and forecast parameters for all matches.
sourceInfrastructureSystems._get_all_concrete_subtypes — Method
_get_all_concrete_subtypes(
_::Type{T},
sub_types::Vector{DataType}
)
Recursively builds a vector of subtypes.
sourceInfrastructureSystems._make_group — Method
_make_group(
all_components,
partition_results,
group_result,
group_name
) -> Any
Make a ComponentSelector containing the components in all_components whose corresponding entry of partition_results matches group_result
InfrastructureSystems._validate — Method
_validate(
data::InfrastructureSystems.SystemData,
component::InfrastructureSystems.InfrastructureSystemsComponent
)
Checks that the component exists in data and is the same object.
sourceInfrastructureSystems.add_association! — Method
add_association!(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
component::InfrastructureSystems.InfrastructureSystemsComponent,
attribute::InfrastructureSystems.SupplementalAttribute
)
Add a supplemental attribute association to the associations. The caller must check for duplicates.
sourceInfrastructureSystems.add_component! — Method
add_component!(
components::InfrastructureSystems.Components,
component::InfrastructureSystems.InfrastructureSystemsComponent;
kwargs...
)
Add a component.
Throws ArgumentError if the component's name is already stored for its concrete type.
Throws InvalidRange if any of the component's field values are outside of defined valid range.
sourceInfrastructureSystems.add_component_to_subsystem! — Method
add_component_to_subsystem!(
data::InfrastructureSystems.SystemData,
subsystem_name::AbstractString,
component::InfrastructureSystems.InfrastructureSystemsComponent
)
Add a component to a subsystem.
sourceInfrastructureSystems.add_metadata! — Method
add_metadata!(
store::InfrastructureSystems.TimeSeriesMetadataStore,
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
metadata::InfrastructureSystems.TimeSeriesMetadata
)
Add metadata to the store. The caller must check if there are duplicates.
sourceInfrastructureSystems.add_serialization_metadata! — Method
add_serialization_metadata!(data::Dict, _::Type{T})
Add type information to the dictionary that can be used to deserialize the value.
sourceInfrastructureSystems.add_subsystem! — Method
add_subsystem!(
data::InfrastructureSystems.SystemData,
subsystem_name::AbstractString
)
Add a new subsystem to the system.
sourceInfrastructureSystems.add_time_series! — Method
add_time_series!(
data::InfrastructureSystems.SystemData,
components,
time_series::InfrastructureSystems.TimeSeriesData;
features...
) -> Union{InfrastructureSystems.ForecastKey, InfrastructureSystems.StaticTimeSeriesKey}
Add the same time series data to multiple components.
Arguments
data::SystemData: SystemDatacomponents: iterable of components that will store the same time series referencetime_series::TimeSeriesData: Any object of subtype TimeSeriesData
This is significantly more efficent than calling add_time_series! for each component individually with the same data because in this case, only one time series array is stored.
Throws ArgumentError if a component is not stored in the system.
sourceInfrastructureSystems.add_time_series! — Method
add_time_series!(
data::InfrastructureSystems.SystemData,
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
time_series::InfrastructureSystems.TimeSeriesData;
features...
) -> Union{InfrastructureSystems.ForecastKey, InfrastructureSystems.StaticTimeSeriesKey}
Add time series data to a component or supplemental attribute.
Arguments
data::SystemData: SystemDataowner::InfrastructureSystemsComponent: will store the time series referencetime_series::TimeSeriesData: Any object of subtype TimeSeriesData
Throws ArgumentError if the owner is not stored in the system.
sourceInfrastructureSystems.add_time_series_from_file_metadata! — Method
add_time_series_from_file_metadata!(
data::InfrastructureSystems.SystemData,
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent},
file_metadata::Vector{InfrastructureSystems.TimeSeriesFileMetadata};
resolution
) -> Vector{InfrastructureSystems.TimeSeriesKey}
Adds time series data from a metadata file or metadata descriptors.
Arguments
data::SystemData: systemfile_metadata::Vector{TimeSeriesFileMetadata}: metadata for time seriesresolution::DateTime.Period=nothing: skip time_series that don't match this resolution.
InfrastructureSystems.add_time_series_from_file_metadata! — Method
add_time_series_from_file_metadata!(
data::InfrastructureSystems.SystemData,
::Type{T<:InfrastructureSystems.InfrastructureSystemsComponent},
metadata_file::AbstractString;
resolution
) -> Vector{InfrastructureSystems.TimeSeriesKey}
Adds time_series from a metadata file or metadata descriptors.
Arguments
data::SystemData: system::Type{T}: type of the component associated with time series data; may be abstractmetadata_file::AbstractString: metadata file for time series that includes an array of TimeSeriesFileMetadata instances or a vector.resolution::DateTime.Period=nothing: skip time_series that don't match this resolution.
InfrastructureSystems.assign_new_uuid_internal! — Method
assign_new_uuid_internal!(
component::InfrastructureSystems.InfrastructureSystemsComponent
)
Assign a new UUID to the component.
sourceInfrastructureSystems.assign_new_uuid_internal! — Method
assign_new_uuid_internal!(
obj::InfrastructureSystems.InfrastructureSystemsType
)
Assign a new UUID.
sourceInfrastructureSystems.available_and_fn — Method
available_and_fn(
fn::Union{Nothing, Function},
sys
) -> Union{typeof(InfrastructureSystems.get_available), InfrastructureSystems.var"#optional_and_fns##0#optional_and_fns##1"{typeof(InfrastructureSystems.get_available), <:Function}}
Use optional_and_fns to return a function that computes the conjunction of get_available and the given function
InfrastructureSystems.backup_to_temp — Method
backup_to_temp(
store::InfrastructureSystems.TimeSeriesMetadataStore
) -> String
Backup the database to a file on the temporary filesystem and return that filename.
sourceInfrastructureSystems.begin_supplemental_attributes_update — Method
begin_supplemental_attributes_update(
func::Function,
mgr::InfrastructureSystems.SupplementalAttributeManager
) -> Any
Begin an update of supplemental attributes. Use this function when adding or removing many supplemental attributes in order to improve performance.
If an error occurs during the update, changes will be reverted.
sourceInfrastructureSystems.begin_time_series_update — Method
begin_time_series_update(
func::Function,
mgr::InfrastructureSystems.TimeSeriesManager
) -> Any
Begin an update of time series. Use this function when adding many time series arrays in order to improve performance.
If an error occurs during the update, changes will be reverted.
Using this function to remove time series is currently not supported.
sourceInfrastructureSystems.check_consistency — Method
check_consistency(
store::InfrastructureSystems.TimeSeriesMetadataStore,
_::Type{InfrastructureSystems.SingleTimeSeries}
) -> Tuple{Any, Any}
Throw InvalidValue if the SingleTimeSeries arrays have different initial times or lengths. Return the initial timestamp and length as a tuple.
sourceInfrastructureSystems.check_resolution — Method
check_resolution(timestamps, resolution::Dates.Period)
Check if the timestamps have a constant resolution. Handles constant periods like Second and Minute as well as irregular periods like Month and Year. Relies on the calendrical arithmetic of the Julia's Dates library. https://docs.julialang.org/en/v1/stdlib/Dates/#TimeType-Period-Arithmetic
Arguments
timestamps: An indexable sequence of DateTime valuesresolution: a Dates.Period value
InfrastructureSystems.clear_components! — Method
clear_components!(
components::InfrastructureSystems.Components
)
Removes all components from the system.
sourceInfrastructureSystems.clear_ext! — Method
clear_ext!(
obj::InfrastructureSystems.InfrastructureSystemsInternal
)
Clear any value stored in ext.
sourceInfrastructureSystems.clear_metadata! — Method
clear_metadata!(
store::InfrastructureSystems.TimeSeriesMetadataStore
) -> SQLite.Query
Clear all time series metadata from the store.
sourceInfrastructureSystems.clear_supplemental_attributes! — Method
clear_supplemental_attributes!(
mgr::InfrastructureSystems.SupplementalAttributeManager
)
Removes all supplemental_attributes from the system.
Ignores whether attributes are attached to components.
sourceInfrastructureSystems.clear_supplemental_attributes! — Method
clear_supplemental_attributes!(
data::InfrastructureSystems.SystemData
)
Remove all supplemental attributes.
sourceInfrastructureSystems.compare_over_fields — Method
compare_over_fields(cmp_op, reduce_op, init, a, b) -> Any
For a and b, instances of the same concrete type, iterate over all the fields, compare a's value to b's using cmp_op, and reduce to one value using reduce_op with an initialization value of init.
InfrastructureSystems.compare_values — Method
compare_values(
match_fn::Union{Nothing, Function},
x,
y;
compare_uuids,
exclude
) -> Bool
Recursively compares struct values. Prints all mismatched values to stdout.
Arguments
match_fn: optional, a function used to determine whether two values match in the base case of the recursion. Ifnothingor not specified, the default implementation usesIS.isequivalent.x::T: First valuey::U: Second valuecompare_uuids::Bool = false: Compare any UUID in the object or composed objects.- `exclude::Set{Symbol} = Set{Symbol}(): Fields to exclude from comparison. Passed on recursively and so applied per type.
InfrastructureSystems.component_to_qualified_string — Method
component_to_qualified_string(
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent},
component_name::AbstractString
) -> Any
Canonical way to turn an InfrastructureSystemsComponent specification/instance into a unique-per-system string.
InfrastructureSystems.compute_periods_between — Method
compute_periods_between(
t1::Dates.DateTime,
t2::Dates.DateTime,
period::Dates.Period
) -> Int64
Given a series of timestamps that increment by period, return the number of periods between t1 and t2.
t2 must be greater than or equal to t1. There must be an even number of periods between t1 and t2. period can be regular (e.g., Hour) or irregular (e.g., Month).
Arguments
t1: The initial timestamp.t2: The second timestamp.period: The period to use for the index.
Examples
julia> compute_periods_between(
DateTime("2024-01-01T00:00:00"),
DateTime("2024-01-01T05:00:00"),
Hour(1),
)
5
julia> compute_period_index(
DateTime("2024-02-01T00:00:00"),
DateTime("2024-04-01T00:00:00"),
Month(1),
)
2
julia> compute_period_index(
DateTime("2024-01-01T00:00:00"),
DateTime("2028-01-01T00:00:00"),
Year(1),
)
4sourceInfrastructureSystems.compute_sha256 — Method
InfrastructureSystems.compute_time_array_index — Method
compute_time_array_index(
initial_time::Dates.DateTime,
other_time::Dates.DateTime,
resolution::Dates.Period
) -> Any
Given a series of timestamps that start with initial_time and increment by resolution, return the index of other time in the array of timestamps.
Examples
julia> compute_time_array_index(
DateTime("2024-01-01T00:00:00"),
DateTime("2024-01-01T05:00:00"),
Hour(1),
)
6
julia> compute_time_array_index(
DateTime("2024-01-01T00:00:00"),
DateTime("2024-04-01T00:00:00"),
Month(1),
)
4
julia> compute_time_array_index(
DateTime("2024-01-01T00:00:00"),
DateTime("2028-01-01T00:00:00"),
Year(1),
)
5sourceInfrastructureSystems.configure_logging — Method
configure_logging(
;
console,
console_stream,
console_level,
progress,
file,
filename,
file_level,
file_mode,
tracker,
set_global
) -> InfrastructureSystems.MultiLogger
Creates console and file loggers per caller specification and returns a MultiLogger.
Suppress noisy events by specifying per-event values of maxlog = X and _suppression_period = Y where X is the max number of events that can occur in Y seconds. After the period ends, messages will no longer be suppressed. Note that if you don't specify _suppression_period then maxlog applies for the for the duration of your process (standard Julia logging behavior).
Note: Use of log message suppression and the LogEventTracker are not thread-safe. Please contact the package developers if you need this functionality.
Note: If logging to a file users must call Base.close() on the returned MultiLogger to ensure that all events get flushed.
Arguments
console::Bool=true: create console loggerconsole_stream::IOStream=stderr: stream for console loggerconsole_level::Logging.LogLevel=Logging.Error: level for console messagesprogress::Bool=true: enable progress loggerfile::Bool=true: create file loggerfilename::Union{Nothing, String}=log.txt: log filefile_level::Logging.LogLevel=Logging.Info: level for file messagesfile_mode::String=w+: mode used when opening log filetracker::Union{LogEventTracker, Nothing}=LogEventTracker(): optionally track log eventsset_global::Bool=true: set the created logger as the global logger
Example
logger = configure_logging(filename="mylog.txt")
@info "hello world"
@info "hello world" maxlog = 5 _suppression_period = 10sourceInfrastructureSystems.convert_forecast_input_time_arrays — Method
convert_forecast_input_time_arrays(
data::AbstractDict{Dates.DateTime, <:TimeSeries.TimeArray};
resolution
) -> Tuple{DataStructures.SortedDict{Dates.DateTime, _A, Base.Order.ForwardOrdering} where _A, Any}
Convert a Dict of TimeSeries.TimeArray to a SortedDict of Arrays. Before converting, check that the resolution is consistent in all time arrays. Return the SortedDict and the resolution.
sourceInfrastructureSystems.copy_h5_file — Method
copy_h5_file(src::AbstractString, dst::AbstractString)
Copies an HDF5 file to a new file. This should be used instead of a system call to copy because it won't copy unused space that results from deleting datasets.
sourceInfrastructureSystems.copy_time_series! — Method
copy_time_series!(
dst::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
src::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute};
name_mapping,
scaling_factor_multiplier_mapping
)
Efficiently add all time_series in one component to another by copying the underlying references.
Arguments
dst::TimeSeriesOwners: Destination ownersrc::TimeSeriesOwners: Source ownername_mapping::Dict = nothing: Optionally map src names to different dst names. If provided and src has atime_serieswith a name not present inname_mapping, thattime_serieswill not copied. Ifname_mappingis nothing then alltime_serieswill be copied with src's names.scaling_factor_multiplier_mapping::Dict = nothing: Optionally map src multipliers to different dst multipliers. If provided and src has atime_serieswith a multiplier not present inscaling_factor_multiplier_mapping, thattime_serieswill not copied. Ifscaling_factor_multiplier_mappingis nothing then alltime_serieswill be copied with src's multipliers.
InfrastructureSystems.deserialize — Method
deserialize(
_::Type{T<:InfrastructureSystems.InfrastructureSystemsType},
data::Dict
) -> InfrastructureSystems.SystemData
Deserialize an object from standard types stored in non-Julia formats, such as JSON, into Julia types.
sourceInfrastructureSystems.double_equals_from_fields — Method
double_equals_from_fields(a, b) -> Any
Compute the conjunction of the == values of all the fields in a and b
InfrastructureSystems.empty_group_levels! — Method
empty_group_levels!(
logger::InfrastructureSystems.MultiLogger
)
Empty the minimum log levels stored for each group.
sourceInfrastructureSystems.execute — Method
execute(
db::SQLite.DB,
query::AbstractString,
params::Union{Nothing, Tuple, Vector},
log_group::Symbol
) -> SQLite.Query
Wrapper around SQLite.DBInterface.execute to provide caching of compiled statements as well as log messages.
sourceInfrastructureSystems.execute_count — Method
execute_count(
db::SQLite.DB,
query::AbstractString,
params::Union{Nothing, Tuple, Vector},
log_group::Symbol
) -> Any
Run a query to find a count. The query must produce a column called count with one row.
sourceInfrastructureSystems.fast_deepcopy_system — Method
fast_deepcopy_system(
data::InfrastructureSystems.SystemData;
skip_time_series,
skip_supplemental_attributes
) -> InfrastructureSystems.SystemData
Make a deepcopy of a SystemData more quickly by skipping the copying of time series and/or supplemental attributes.
Arguments
data::SystemData: theSystemDatato copyskip_time_series::Bool = true: whether to skip copying time seriesskip_supplemental_attributes::Bool = true: whether to skip copying supplemental attributes
Note that setting both skip_time_series and skip_supplemental_attributes to false results in the same behavior as deepcopy with no performance improvement.
InfrastructureSystems.from — Method
from(
time_series::InfrastructureSystems.SingleTimeSeries,
timestamp
) -> InfrastructureSystems.SingleTimeSeries
Return a time_series truncated starting with timestamp.
sourceInfrastructureSystems.from_file — Method
from_file(
::Type{InfrastructureSystems.Hdf5TimeSeriesStorage},
filename::AbstractString;
read_only,
directory
) -> InfrastructureSystems.Hdf5TimeSeriesStorage
Constructs Hdf5TimeSeriesStorage from an existing file.
sourceInfrastructureSystems.from_h5_file — Method
from_h5_file(
_::Type{InfrastructureSystems.TimeSeriesMetadataStore},
src::AbstractString,
directory
) -> InfrastructureSystems.TimeSeriesMetadataStore
Load a TimeSeriesMetadataStore from an HDF5 file into an in-memory database.
sourceInfrastructureSystems.from_json — Method
from_json(
_::Type{T<:InfrastructureSystems.InfrastructureSystemsType},
filename::String
) -> Any
Deserializes a InfrastructureSystemsType from a JSON filename.
sourceInfrastructureSystems.from_json — Method
from_json(
io::Union{IO, String},
_::Type{T<:InfrastructureSystems.InfrastructureSystemsType}
) -> InfrastructureSystems.TestComponent
Deserializes a InfrastructureSystemsType from String or IO.
sourceInfrastructureSystems.from_records — Method
from_records(
_::Type{InfrastructureSystems.SupplementalAttributeAssociations},
records
) -> InfrastructureSystems.SupplementalAttributeAssociations
Add records to the database. Expects output from to_records.
InfrastructureSystems.generate_struct_file — Method
generate_struct_file(
definition::InfrastructureSystems.StructDefinition;
filename,
output_directory
)
Generate a Julia source code file for one struct from a StructDefinition.
Refer to StructDefinition and StructField for descriptions of the available fields.
Arguments
definition::StructDefinition: Defines the struct and all fields.filename::AbstractString: Add the struct definition to this JSON file. Defaults tosrc/descriptors/structs.jsonoutput_directory::AbstractString: Generate the files in this directory. Defaults tosrc/generated
InfrastructureSystems.generate_struct_files — Method
generate_struct_files(
definitions;
filename,
output_directory
)
Generate Julia source code files for multiple structs from a iterable of StructDefinition instances.
Refer to StructDefinition and StructField for descriptions of the available fields.
Arguments
definitions: Defines the structs and all fields.filename::AbstractString: Add the struct definition to this JSON file. Defaults tosrc/descriptors/power_system_structs.jsonoutput_directory::AbstractString: Generate the files in this directory. Defaults tosrc/generated
InfrastructureSystems.get_abstract_subtypes — Method
get_abstract_subtypes(_::Type{T}) -> Vector
Returns an array of abstract types that are direct subtypes of T.
sourceInfrastructureSystems.get_all_concrete_subtypes — Method
get_all_concrete_subtypes(_::Type{T}) -> Any
Returns an array of all concrete subtypes of T. Caches the values for faster lookup on repeated calls.
Note that this does not find parameterized types. It will also not find types dynamically added after the first call of given type.
sourceInfrastructureSystems.get_assigned_subsystems — Method
get_assigned_subsystems(
data::InfrastructureSystems.SystemData,
component::InfrastructureSystems.InfrastructureSystemsComponent
) -> Vector
Return a Vector of subsystem names that contain the component.
sourceInfrastructureSystems.get_associated_components — Method
get_associated_components(
data::InfrastructureSystems.SystemData,
attribute::InfrastructureSystems.SupplementalAttribute;
component_type
) -> Any
Return all components associated with the attribute that match component_type.
Arguments
data::SystemData: theSystemDatato searchattribute::SupplementalAttribute: Only return components associated with this attribute.component_type::Union{Nothing, Type{<:InfrastructureSystemsComponent}}: Optional, type of the components to return. Can be concrete or abstract.
InfrastructureSystems.get_associated_supplemental_attributes — Method
get_associated_supplemental_attributes(
data::InfrastructureSystems.SystemData,
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent};
attribute_type
) -> Any
Return all supplemental attributes associated with the components of the given type, optionally filtered by attribute_type.
Arguments
data::SystemData: theSystemDatato searchcomponent_type::Type{<:InfrastructureSystemsComponent}: Only return attributes
associated with the components of this type.
attribute_type::Union{Nothing, Type{<:SupplementalAttribute}}`: Optional, type of the attributes to return. Can be concrete or abstract.
InfrastructureSystems.get_attribute_counts_by_type — Method
get_attribute_counts_by_type(
associations::InfrastructureSystems.SupplementalAttributeAssociations
) -> Vector
Return a Vector of OrderedDict of stored time series counts by type.
sourceInfrastructureSystems.get_attribute_summary_table — Method
get_attribute_summary_table(
associations::InfrastructureSystems.SupplementalAttributeAssociations
) -> DataFrames.DataFrame
Return a DataFrame with the number of supplemental attributes by type for components.
sourceInfrastructureSystems.get_available — Method
get_available(
value::InfrastructureSystems.InfrastructureSystemsComponent
) -> Bool
Return true if the component is available.
sourceInfrastructureSystems.get_available_component — Function
Like get_component but only on components that are available.
InfrastructureSystems.get_available_component — Method
get_available_component(
selector::InfrastructureSystems.ComponentSelector,
sys
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Like get_component but only operates on components for which get_available is true.
InfrastructureSystems.get_available_component — Method
get_available_component(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.ComponentSelector,
sys
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Like get_component but only operates on components for which get_available is true.
InfrastructureSystems.get_available_components — Function
Like get_components but only on components that are available.
InfrastructureSystems.get_available_components — Method
get_available_components(
selector::InfrastructureSystems.ComponentSelector,
sys
) -> Any
Like get_components but only operates on components for which get_available is true.
InfrastructureSystems.get_available_components — Method
get_available_components(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.ComponentSelector,
sys
) -> Any
Like get_components but only operates on components for which get_available is true.
InfrastructureSystems.get_available_groups — Method
get_available_groups(
selector::InfrastructureSystems.ComponentSelector,
sys
) -> Any
Like get_groups but only operates on components for which get_available is true.
InfrastructureSystems.get_available_groups — Method
get_available_groups(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.ComponentSelector,
sys
) -> Any
Like get_groups but only operates on components for which get_available is true.
InfrastructureSystems.get_average_rates — Method
get_average_rates(
vc::PiecewiseAverageCurve
) -> Vector{Float64}
Get the average rates that define the PiecewiseAverageCurve
InfrastructureSystems.get_base_component_type — Method
get_base_component_type(
_::InfrastructureSystems.ComponentContainer
) -> Type{InfrastructureSystems.InfrastructureSystemsComponent}
Return the base type stored in the container.
sourceInfrastructureSystems.get_component — Function
Get the single component that matches the given specification from the ComponentContainer, or nothing if there is no match.
InfrastructureSystems.get_component — Method
get_component(
selector::InfrastructureSystems.SingularComponentSelector,
sys
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Get the single component that matches the SingularComponentSelector, or nothing if there is no match.
Arguments
selector::SingularComponentSelector: theSingularComponentSelectorthat specifies which component to getsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_component — Method
get_component(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.NameComponentSelector,
sys
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Get the component to which the NameComponentSelector points, or nothing if such a component does not exist in sys.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::NameComponentSelector: theNameComponentSelectorwhose component to getsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_component — Method
get_component(
_::Type{T<:InfrastructureSystems.InfrastructureSystemsComponent},
components::InfrastructureSystems.Components,
name::AbstractString
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Get the component of type T with name. Returns nothing if no component matches. If T is an abstract type then the names of components across all subtypes of T must be unique.
See get_components_by_name for abstract types with non-unique names across subtypes.
Throws ArgumentError if T is not a concrete type and there is more than one component with requested name
sourceInfrastructureSystems.get_component_supplemental_attribute_pairs — Method
get_component_supplemental_attribute_pairs(
::Type{T<:InfrastructureSystems.InfrastructureSystemsComponent},
::Type{U<:InfrastructureSystems.SupplementalAttribute},
data::InfrastructureSystems.SystemData;
components,
attributes
) -> Array{NamedTuple{(:component, :supplemental_attribute), var"#s177"}, 1} where var"#s177"<:Tuple{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute}
Return a vector of NamedTuples with pairs of components and supplemental attributes that are associated with each other. Limit by components and attributes if provided.
The return type is NamedTuple{(:component, :supplemental_attribute), Tuple{T, U}}[] where T is the component type and U is the supplemental attribute type.
InfrastructureSystems.get_components — Function
Get an iterator of components of a certain specification from the ComponentContainer.
InfrastructureSystems.get_components — Method
get_components(
selector::InfrastructureSystems.ComponentSelector,
sys
) -> Any
Given a ComponentContainer-like source of components, get those components that make up the ComponentSelector.
Arguments
selector::ComponentSelector: theComponentSelectorthat specifies which components to getsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_components — Method
get_components(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.FilterComponentSelector,
sys
) -> InfrastructureSystems.FlattenIteratorWrapper{T, I} where {T<:InfrastructureSystems.InfrastructureSystemsComponent, I<:(Vector)}
Get the components to which the FilterComponentSelector points.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::FilterComponentSelector: theFilterComponentSelectorwhose components to getsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_components — Method
get_components(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.ListComponentSelector,
sys
) -> InfrastructureSystems.FlattenIteratorWrapper
Get the components to which the ListComponentSelector points.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::ListComponentSelector: theListComponentSelectorwhose components to getsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_components — Method
get_components(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.NameComponentSelector,
sys
) -> InfrastructureSystems.FlattenIteratorWrapper{T, Vector{Base.ValueIterator}} where T<:InfrastructureSystems.InfrastructureSystemsComponent
Get the components to which the NameComponentSelector points.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::NameComponentSelector: theNameComponentSelectorwhose components to getsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_components — Method
get_components(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.RegroupedComponentSelector,
sys
) -> Any
Get the components to which the RegroupedComponentSelector points.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::RegroupedComponentSelector: theRegroupedComponentSelectorwhose components to getsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_components — Method
get_components(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.TypeComponentSelector,
sys
) -> InfrastructureSystems.FlattenIteratorWrapper{T, I} where {T<:InfrastructureSystems.InfrastructureSystemsComponent, I<:(Vector)}
Get the components to which the TypeComponentSelector points.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::TypeComponentSelector: theTypeComponentSelectorwhose components to getsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_components — Method
get_components(
::Type{T<:InfrastructureSystems.InfrastructureSystemsComponent},
components::InfrastructureSystems.Components;
component_uuids
) -> InfrastructureSystems.FlattenIteratorWrapper{T, I} where {T<:InfrastructureSystems.InfrastructureSystemsComponent, I<:(Vector)}
Returns an iterator of components. T can be concrete or abstract. Call collect on the result if an array is desired.
Arguments
T: component typecomponents::Components: Components of the systemfilter_func::Union{Nothing, Function} = nothing: Optional function that accepts a component of type T and returns a Bool. Apply this function to each component and only return components where the result is true.
See also: iterate_components
InfrastructureSystems.get_components_by_name — Method
get_components_by_name(
_::Type{T<:InfrastructureSystems.InfrastructureSystemsComponent},
components::InfrastructureSystems.Components,
name::AbstractString
) -> Vector{T} where T<:InfrastructureSystems.InfrastructureSystemsComponent
Get the components of abstract type T with name. Note that InfrastructureSystems enforces unique names on each concrete type but not across concrete types.
See get_component if the concrete type is known.
Throws ArgumentError if T is not an abstract type.
sourceInfrastructureSystems.get_concrete_subtypes — Method
get_concrete_subtypes(_::Type{T}) -> Vector
Returns an array of concrete types that are direct subtypes of T.
sourceInfrastructureSystems.get_constant_term — Method
get_constant_term(vc::LinearCurve) -> Float64
Get the constant term (i.e., intercept) of the LinearCurve
InfrastructureSystems.get_count — Method
get_count(
value::InfrastructureSystems.DeterministicMetadata
) -> Int64
Get DeterministicMetadata count.
InfrastructureSystems.get_count — Method
get_count(
value::InfrastructureSystems.DeterministicSingleTimeSeries
) -> Int64
Get DeterministicSingleTimeSeries count.
InfrastructureSystems.get_count — Method
get_count(
value::InfrastructureSystems.ProbabilisticMetadata
) -> Int64
Get ProbabilisticMetadata count.
InfrastructureSystems.get_count — Method
get_count(
value::InfrastructureSystems.ScenariosMetadata
) -> Int64
Get ScenariosMetadata count.
InfrastructureSystems.get_data — Method
get_data(
value::InfrastructureSystems.Deterministic
) -> DataStructures.SortedDict
Get Deterministic data.
InfrastructureSystems.get_data — Method
get_data(
value::InfrastructureSystems.Probabilistic
) -> DataStructures.SortedDict
Get Probabilistic data.
InfrastructureSystems.get_data — Method
InfrastructureSystems.get_data — Method
get_data(
value::InfrastructureSystems.SingleTimeSeries
) -> TimeSeries.TimeArray
Get SingleTimeSeries data.
InfrastructureSystems.get_data_type — Method
get_data_type(
ts::InfrastructureSystems.TimeSeriesData
) -> Any
Return a String for the data type of the forecast data, this implementation avoids the use of eval on arbitrary code stored in HDF dataset.
InfrastructureSystems.get_domain — Method
get_domain(
fd::InfrastructureSystems.PiecewiseLinearData
) -> Tuple{Float64, Float64}
Get the domain of the function represented by the PiecewiseLinearData.
InfrastructureSystems.get_domain — Method
get_domain(
fd::InfrastructureSystems.PiecewiseStepData
) -> Tuple{Float64, Float64}
Get the domain of the function represented by the PiecewiseStepData.
InfrastructureSystems.get_domain — Method
get_domain(
_::Union{InfrastructureSystems.LinearFunctionData, InfrastructureSystems.QuadraticFunctionData}
) -> Tuple{Float64, Float64}
Get the domain of the function represented by the LinearFunctionData or QuadraticFunctionData (always (-Inf, Inf) for these types).
InfrastructureSystems.get_ext — Method
get_ext(
obj::InfrastructureSystems.InfrastructureSystemsInternal
) -> Union{Nothing, Dict{String, Any}}
Return a user-modifiable dictionary to store extra information.
sourceInfrastructureSystems.get_features — Method
get_features(
value::InfrastructureSystems.DeterministicMetadata
) -> Dict{String, Union{Bool, Int64, String}}
Get DeterministicMetadata features.
InfrastructureSystems.get_features — Method
get_features(
value::InfrastructureSystems.ProbabilisticMetadata
) -> Dict{String, Union{Bool, Int64, String}}
Get ProbabilisticMetadata features.
InfrastructureSystems.get_features — Method
get_features(
value::InfrastructureSystems.ScenariosMetadata
) -> Dict{String, Union{Bool, Int64, String}}
Get ScenariosMetadata features.
InfrastructureSystems.get_features — Method
get_features(
value::InfrastructureSystems.SingleTimeSeriesMetadata
) -> Dict{String, Union{Bool, Int64, String}}
Get SingleTimeSeriesMetadata features.
InfrastructureSystems.get_forecast_summary_table — Method
get_forecast_summary_table(
store::InfrastructureSystems.TimeSeriesMetadataStore
) -> DataFrames.DataFrame
Return a DataFrame with the number of forecasts for components and supplemental attributes.
sourceInfrastructureSystems.get_fuel_cost — Method
get_fuel_cost(
cost::InfrastructureSystems.FuelCurve
) -> Union{Float64, InfrastructureSystems.TimeSeriesKey}
Get the fuel cost or the name of the fuel cost time series
sourceInfrastructureSystems.get_function_data — Method
get_function_data(
cost::InfrastructureSystems.ProductionVariableCostCurve
) -> Any
Get the FunctionData representation of this ProductionVariableCostCurve's ValueCurve
InfrastructureSystems.get_function_data — Method
get_function_data(
curve::InfrastructureSystems.ValueCurve
) -> Any
Get the underlying FunctionData representation of this ValueCurve
InfrastructureSystems.get_geo_json — Method
get_geo_json(
geo::InfrastructureSystems.GeographicInfo
) -> Dict{String, Any}
get_geo_json(geo::GeographicInfo)Get the GeoJSON dictionary from a GeographicInfo attribute.
Arguments
geo::GeographicInfo: theGeographicInfoattribute
InfrastructureSystems.get_group_level — Method
get_group_level(
logger::InfrastructureSystems.MultiLogger,
group::Symbol
) -> Union{Nothing, Base.CoreLogging.LogLevel}
Return the minimum logging level for a group or nothing if group is not stored.
InfrastructureSystems.get_group_levels — Method
get_group_levels(
logger::InfrastructureSystems.MultiLogger
) -> Dict{Symbol, Base.CoreLogging.LogLevel}
Return the minimum logging levels for groups that have been stored.
sourceInfrastructureSystems.get_groups — Method
get_groups(
selector::InfrastructureSystems.ComponentSelector,
sys
) -> Any
Given a ComponentContainer-like source of components, get the groups that make up the ComponentSelector.
Arguments
selector::ComponentSelector: theComponentSelectorwhose groups should be retrievedsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_groups — Method
get_groups(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.DynamicallyGroupedComponentSelector,
sys
) -> Any
Given a ComponentContainer-like source of components, use the groupby property (see make_selector) to get the groups that make up the DynamicallyGroupedComponentSelector.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelectorselector::DynamicallyGroupedComponentSelector: theDynamicallyGroupedComponentSelectorwhose groups should be retrievedsys: theComponentContainer-like source of components to draw from
InfrastructureSystems.get_groups — Method
get_groups(
scope_limiter::Union{Nothing, Function},
selector::InfrastructureSystems.SingularComponentSelector,
sys
) -> Vector{T} where T<:InfrastructureSystems.SingularComponentSelector
Get the single group that corresponds to the SingularComponentSelector, i.e., itself.
Arguments
scope_limiter::Union{Function, Nothing}: seeComponentSelector(unused in this case)selector::SingularComponentSelector: theSingularComponentSelectorwhose group should be retrievedsys: theComponentContainer-like source of components to draw from (unused in this case)
InfrastructureSystems.get_horizon — Method
get_horizon(
value::InfrastructureSystems.DeterministicMetadata
) -> Dates.Period
Get DeterministicMetadata horizon.
InfrastructureSystems.get_horizon — Method
get_horizon(
value::InfrastructureSystems.DeterministicSingleTimeSeries
) -> Dates.Period
Get DeterministicSingleTimeSeries horizon.
InfrastructureSystems.get_horizon — Method
get_horizon(
value::InfrastructureSystems.ProbabilisticMetadata
) -> Dates.Period
Get ProbabilisticMetadata horizon.
InfrastructureSystems.get_horizon — Method
get_horizon(
value::InfrastructureSystems.ScenariosMetadata
) -> Dates.Period
Get ScenariosMetadata horizon.
InfrastructureSystems.get_initial_input — Method
get_initial_input(
cost::InfrastructureSystems.ProductionVariableCostCurve
) -> Union{Nothing, Float64}
Get the initial_input field of this ProductionVariableCostCurve's ValueCurve (not defined for input-output data)
InfrastructureSystems.get_initial_input — Method
get_initial_input(
curve::Union{InfrastructureSystems.AverageRateCurve, InfrastructureSystems.IncrementalCurve}
) -> Union{Nothing, Float64}
Get the initial_input field of this ValueCurve (not defined for InputOutputCurve)
InfrastructureSystems.get_initial_times — Method
get_initial_times(
f::InfrastructureSystems.Forecast
) -> DataStructures.IterableObject{C, DataStructures.EntireContainer, DataStructures.KeysIter, DataStructures.NoTokens, DataStructures.ForwardIter} where C<:(DataStructures.SortedDict{K, D, Ord} where {Ord<:Base.Order.Ordering, D, K})
Return the initial times in the forecast.
sourceInfrastructureSystems.get_initial_timestamp — Method
get_initial_timestamp(
value::InfrastructureSystems.DeterministicMetadata
) -> Dates.DateTime
Get DeterministicMetadata initial_timestamp.
InfrastructureSystems.get_initial_timestamp — Method
get_initial_timestamp(
value::InfrastructureSystems.DeterministicSingleTimeSeries
) -> Dates.DateTime
Get DeterministicSingleTimeSeries initial_timestamp.
InfrastructureSystems.get_initial_timestamp — Method
get_initial_timestamp(
value::InfrastructureSystems.ProbabilisticMetadata
) -> Dates.DateTime
Get ProbabilisticMetadata initial_timestamp.
InfrastructureSystems.get_initial_timestamp — Method
get_initial_timestamp(
value::InfrastructureSystems.ScenariosMetadata
) -> Dates.DateTime
Get ScenariosMetadata initial_timestamp.
InfrastructureSystems.get_initial_timestamp — Method
get_initial_timestamp(
value::InfrastructureSystems.SingleTimeSeriesMetadata
) -> Dates.DateTime
Get SingleTimeSeriesMetadata initial_timestamp.
InfrastructureSystems.get_input_at_zero — Method
get_input_at_zero(
curve::InfrastructureSystems.ValueCurve
) -> Any
Get the input_at_zero field of this ValueCurve
InfrastructureSystems.get_internal — Method
get_internal(
value::InfrastructureSystems.DeterministicMetadata
) -> InfrastructureSystems.InfrastructureSystemsInternal
Get DeterministicMetadata internal.
InfrastructureSystems.get_internal — Method
get_internal(
value::InfrastructureSystems.Deterministic
) -> InfrastructureSystems.InfrastructureSystemsInternal
Get Deterministic internal.
InfrastructureSystems.get_internal — Method
get_internal(
geo::InfrastructureSystems.GeographicInfo
) -> InfrastructureSystems.InfrastructureSystemsInternal
get_internal(geo::GeographicInfo)Get the internal infrastructure systems data from a GeographicInfo attribute.
Arguments
geo::GeographicInfo: theGeographicInfoattribute
InfrastructureSystems.get_internal — Method
get_internal(
value::InfrastructureSystems.ProbabilisticMetadata
) -> InfrastructureSystems.InfrastructureSystemsInternal
Get ProbabilisticMetadata internal.
InfrastructureSystems.get_internal — Method
get_internal(
value::InfrastructureSystems.Probabilistic
) -> InfrastructureSystems.InfrastructureSystemsInternal
Get Probabilistic internal.
InfrastructureSystems.get_internal — Method
get_internal(
value::InfrastructureSystems.ScenariosMetadata
) -> InfrastructureSystems.InfrastructureSystemsInternal
Get ScenariosMetadata internal.
InfrastructureSystems.get_internal — Method
InfrastructureSystems.get_internal — Method
get_internal(
value::InfrastructureSystems.SingleTimeSeriesMetadata
) -> InfrastructureSystems.InfrastructureSystemsInternal
Get SingleTimeSeriesMetadata internal.
InfrastructureSystems.get_internal — Method
get_internal(
value::InfrastructureSystems.SingleTimeSeries
) -> InfrastructureSystems.InfrastructureSystemsInternal
Get SingleTimeSeries internal.
InfrastructureSystems.get_interval — Method
get_interval(
value::InfrastructureSystems.DeterministicMetadata
) -> Dates.Period
Get DeterministicMetadata interval.
InfrastructureSystems.get_interval — Method
get_interval(
value::InfrastructureSystems.DeterministicSingleTimeSeries
) -> Dates.Period
Get DeterministicSingleTimeSeries interval.
InfrastructureSystems.get_interval — Method
get_interval(
value::InfrastructureSystems.Deterministic
) -> Dates.Period
Get Deterministic interval.
InfrastructureSystems.get_interval — Method
get_interval(
value::InfrastructureSystems.ProbabilisticMetadata
) -> Dates.Period
Get ProbabilisticMetadata interval.
InfrastructureSystems.get_interval — Method
get_interval(
value::InfrastructureSystems.Probabilistic
) -> Dates.Period
Get Probabilistic interval.
InfrastructureSystems.get_interval — Method
get_interval(
value::InfrastructureSystems.ScenariosMetadata
) -> Dates.Period
Get ScenariosMetadata interval.
InfrastructureSystems.get_interval — Method
InfrastructureSystems.get_interval_from_initial_times — Method
get_interval_from_initial_times(
initial_times::Vector{Dates.DateTime}
) -> Union{Dates.Millisecond, Dates.Second}
Return the interval by subtracting the first two initial times.
sourceInfrastructureSystems.get_length — Method
get_length(
value::InfrastructureSystems.SingleTimeSeriesMetadata
) -> Int64
Get SingleTimeSeriesMetadata length.
InfrastructureSystems.get_log_events — Method
get_log_events(
tracker::InfrastructureSystems.LogEventTracker,
level::Base.CoreLogging.LogLevel
) -> Union{Base.ValueIterator{Dict{Symbol, InfrastructureSystems.LogEvent}}, Vector{Any}}
Returns an iterable of log events for a level.
sourceInfrastructureSystems.get_metadata — Method
get_metadata(
store::InfrastructureSystems.TimeSeriesMetadataStore,
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
time_series_type::Type{<:InfrastructureSystems.TimeSeriesData},
name::String;
resolution,
features...
) -> Any
Return the metadata matching the inputs. Throw an exception if there is more than one matching input.
sourceInfrastructureSystems.get_name — Method
get_name(
selector::InfrastructureSystems.ComponentSelector
) -> Any
Get the name of the ComponentSelector. This is either a user-specified name passed in at creation or a name automatically generated from the selector's specification.
Examples
sel = make_selector(RenewableDispatch)
get_name(sel) # "RenewableDispatch"sourceInfrastructureSystems.get_name — Method
get_name(
value::InfrastructureSystems.DeterministicMetadata
) -> String
Get DeterministicMetadata name.
InfrastructureSystems.get_name — Method
InfrastructureSystems.get_name — Method
get_name(
value::InfrastructureSystems.InfrastructureSystemsComponent
) -> Any
Return the name of the component.
sourceInfrastructureSystems.get_name — Method
get_name(
value::InfrastructureSystems.ProbabilisticMetadata
) -> String
Get ProbabilisticMetadata name.
InfrastructureSystems.get_name — Method
InfrastructureSystems.get_name — Method
get_name(
value::InfrastructureSystems.ScenariosMetadata
) -> String
Get ScenariosMetadata name.
InfrastructureSystems.get_name — Method
InfrastructureSystems.get_name — Method
get_name(
value::InfrastructureSystems.SingleTimeSeriesMetadata
) -> String
Get SingleTimeSeriesMetadata name.
InfrastructureSystems.get_name — Method
get_name(
value::InfrastructureSystems.SingleTimeSeries
) -> String
Get SingleTimeSeries name.
InfrastructureSystems.get_next_time — Method
get_next_time(
cache::InfrastructureSystems.TimeSeriesCache
) -> Any
Return the timestamp for the next read with get_next_time_series_array!.
Return nothing if all data has been read.
InfrastructureSystems.get_next_time_series_array! — Method
get_next_time_series_array!(
cache::InfrastructureSystems.TimeSeriesCache
) -> Any
Return the next TimeSeries.TimeArray.
Returns nothing when all data has been read. Call reset! to restart. Call get_next_time to check the start time.
Reads from storage if the data is not already in cache.
Arguments
cache::StaticTimeSeriesCache: cached instance
Examples
cache = ForecastCache(Deterministic, component, "max_active_power")
window1 = get_next_time_series_array!(cache)
window2 = get_next_time_series_array!(cache)sourceInfrastructureSystems.get_num_attributes — Method
get_num_attributes(
associations::InfrastructureSystems.SupplementalAttributeAssociations
) -> Any
Return the number of supplemental attributes.
sourceInfrastructureSystems.get_num_components_with_attributes — Method
get_num_components_with_attributes(
associations::InfrastructureSystems.SupplementalAttributeAssociations
) -> Any
Return the number of components with supplemental attributes.
sourceInfrastructureSystems.get_num_steps — Method
get_num_steps(
_::Type{T<:InfrastructureSystems.TimeSeriesFileFormat},
file::CSV.File,
period::AbstractArray
) -> Any
Return the number of steps specified by the period in the file.
sourceInfrastructureSystems.get_num_steps — Method
get_num_steps(
_::Type{T<:InfrastructureSystems.TimeSeriesFormatPeriodAsHeader},
file::CSV.File,
period::AbstractArray
) -> Any
Return the number of steps specified by the period in the file.
sourceInfrastructureSystems.get_num_steps — Method
get_num_steps(
_::Type{T<:Union{InfrastructureSystems.TimeSeriesFormatDateTimeAsColumn, InfrastructureSystems.TimeSeriesFormatPeriodAsColumn}},
file::CSV.File,
period::AbstractArray
) -> Any
Return the number of steps specified by the period in the file.
sourceInfrastructureSystems.get_num_subsystems — Method
get_num_subsystems(
data::InfrastructureSystems.SystemData
) -> Int64
Return the number of subsystems in the system.
sourceInfrastructureSystems.get_num_time_series — Method
get_num_time_series(
store::InfrastructureSystems.TimeSeriesMetadataStore
) -> Any
Return the number of unique time series arrays.
sourceInfrastructureSystems.get_percentiles — Method
get_percentiles(
value::InfrastructureSystems.ProbabilisticMetadata
) -> Vector{Float64}
Get ProbabilisticMetadata percentiles.
InfrastructureSystems.get_percentiles — Method
get_percentiles(
value::InfrastructureSystems.Probabilistic
) -> Vector{Float64}
Get Probabilistic percentiles.
InfrastructureSystems.get_period_columns — Method
get_period_columns(
_::Type{InfrastructureSystems.TimeSeriesFormatPeriodAsColumn},
file::CSV.File
) -> Vector{Symbol}
Return the column names that specify the Period.
sourceInfrastructureSystems.get_points — Method
get_points(
data::InfrastructureSystems.PiecewiseLinearData
) -> Vector{@NamedTuple{x::Float64, y::Float64}}
Get the points that define the piecewise data
sourceInfrastructureSystems.get_points — Method
get_points(
vc::PiecewisePointCurve
) -> Vector{@NamedTuple{x::Float64, y::Float64}}
Get the points that define the PiecewisePointCurve
InfrastructureSystems.get_power_units — Method
get_power_units(
cost::InfrastructureSystems.ProductionVariableCostCurve
) -> Any
Get the units for the x-axis of the curve
sourceInfrastructureSystems.get_proportional_term — Method
get_proportional_term(vc::LinearCurve) -> Float64
Get the proportional term (i.e., slope) of the LinearCurve
InfrastructureSystems.get_proportional_term — Method
get_proportional_term(vc::QuadraticCurve) -> Float64
Get the proportional (i.e., linear) term of the QuadraticCurve
InfrastructureSystems.get_quadratic_term — Method
get_quadratic_term(vc::QuadraticCurve) -> Float64
Get the quadratic term of the QuadraticCurve
InfrastructureSystems.get_raw_data_type — Function
Get from a subtype or instance of FunctionData the type of data its get_raw_data method returns
InfrastructureSystems.get_resolution — Method
get_resolution(
value::InfrastructureSystems.DeterministicMetadata
) -> Dates.Period
Get DeterministicMetadata resolution.
InfrastructureSystems.get_resolution — Method
get_resolution(
value::InfrastructureSystems.Deterministic
) -> Dates.Period
Get Deterministic resolution.
InfrastructureSystems.get_resolution — Method
get_resolution(
value::InfrastructureSystems.ProbabilisticMetadata
) -> Dates.Period
Get ProbabilisticMetadata resolution.
InfrastructureSystems.get_resolution — Method
get_resolution(
value::InfrastructureSystems.Probabilistic
) -> Dates.Period
Get Probabilistic resolution.
InfrastructureSystems.get_resolution — Method
get_resolution(
value::InfrastructureSystems.ScenariosMetadata
) -> Dates.Period
Get ScenariosMetadata resolution.
InfrastructureSystems.get_resolution — Method
InfrastructureSystems.get_resolution — Method
get_resolution(
value::InfrastructureSystems.SingleTimeSeriesMetadata
) -> Dates.Period
Get SingleTimeSeriesMetadata resolution.
InfrastructureSystems.get_resolution — Method
get_resolution(
value::InfrastructureSystems.SingleTimeSeries
) -> Dates.Period
Get SingleTimeSeries resolution.
InfrastructureSystems.get_resolution — Method
get_resolution(ts::TimeSeries.TimeArray) -> Any
Return the resolution from a TimeArray by subtracting the first two timestamps.
sourceInfrastructureSystems.get_scaling_factor_multiplier — Method
get_scaling_factor_multiplier(
value::InfrastructureSystems.DeterministicMetadata
) -> Union{Nothing, Function}
Get DeterministicMetadata scaling_factor_multiplier.
InfrastructureSystems.get_scaling_factor_multiplier — Method
get_scaling_factor_multiplier(
value::InfrastructureSystems.Deterministic
) -> Union{Nothing, Function}
Get Deterministic scaling_factor_multiplier.
InfrastructureSystems.get_scaling_factor_multiplier — Method
get_scaling_factor_multiplier(
value::InfrastructureSystems.ProbabilisticMetadata
) -> Union{Nothing, Function}
Get ProbabilisticMetadata scaling_factor_multiplier.
InfrastructureSystems.get_scaling_factor_multiplier — Method
get_scaling_factor_multiplier(
value::InfrastructureSystems.Probabilistic
) -> Union{Nothing, Function}
Get Probabilistic scaling_factor_multiplier.
InfrastructureSystems.get_scaling_factor_multiplier — Method
get_scaling_factor_multiplier(
value::InfrastructureSystems.ScenariosMetadata
) -> Union{Nothing, Function}
Get ScenariosMetadata scaling_factor_multiplier.
InfrastructureSystems.get_scaling_factor_multiplier — Method
get_scaling_factor_multiplier(
value::InfrastructureSystems.SingleTimeSeriesMetadata
) -> Union{Nothing, Function}
Get SingleTimeSeriesMetadata scaling_factor_multiplier.
InfrastructureSystems.get_scaling_factor_multiplier — Method
get_scaling_factor_multiplier(
value::InfrastructureSystems.SingleTimeSeries
) -> Union{Nothing, Function}
Get SingleTimeSeries scaling_factor_multiplier.
InfrastructureSystems.get_scenario_count — Method
get_scenario_count(
value::InfrastructureSystems.ScenariosMetadata
) -> Int64
Get ScenariosMetadata scenario_count.
InfrastructureSystems.get_serialization_metadata — Method
get_serialization_metadata(data::Dict) -> Any
Return the type information for the serialized struct.
sourceInfrastructureSystems.get_single_time_series — Method
get_single_time_series(
value::InfrastructureSystems.DeterministicSingleTimeSeries
) -> InfrastructureSystems.SingleTimeSeries
Get DeterministicSingleTimeSeries single_time_series.
InfrastructureSystems.get_slopes — Method
get_slopes(
pwl::InfrastructureSystems.PiecewiseLinearData
) -> Vector{Float64}
Calculates the slopes of the line segments defined by the PiecewiseLinearData, returning one fewer slope than the number of underlying points.
sourceInfrastructureSystems.get_slopes — Method
get_slopes(vc::PiecewiseIncrementalCurve) -> Vector{Float64}
Fetch the slopes that define the PiecewiseIncrementalCurve
InfrastructureSystems.get_slopes — Method
get_slopes(vc::PiecewisePointCurve) -> Vector{Float64}
Calculate the slopes of the line segments defined by the PiecewisePointCurve
InfrastructureSystems.get_startup_fuel_offtake — Method
get_startup_fuel_offtake(
cost::InfrastructureSystems.FuelCurve
) -> LinearCurve
Get the function for the fuel consumption at startup
sourceInfrastructureSystems.get_static_time_series_summary_table — Method
get_static_time_series_summary_table(
store::InfrastructureSystems.TimeSeriesMetadataStore
) -> DataFrames.DataFrame
Return a DataFrame with the number of static time series for components and supplemental attributes.
sourceInfrastructureSystems.get_subsystem_components — Method
get_subsystem_components(
data::InfrastructureSystems.SystemData,
subsystem_name::AbstractString
) -> Base.Generator{Set{Base.UUID}, InfrastructureSystems.var"#get_subsystem_components##0#get_subsystem_components##1"{InfrastructureSystems.SystemData}}
Return a Generator of all components in the subsystem.
Throws ArgumentError if the subsystem name is not stored.
sourceInfrastructureSystems.get_subsystems — Method
get_subsystems(
data::InfrastructureSystems.SystemData
) -> Base.KeySet{String, Dict{String, Set{Base.UUID}}}
Return an iterator of all subsystem names in the system.
sourceInfrastructureSystems.get_supplemental_attributes — Method
get_supplemental_attributes(
filter_func::Function,
_::Type{T<:InfrastructureSystems.SupplementalAttribute},
mgr::InfrastructureSystems.SupplementalAttributeManager
) -> InfrastructureSystems.FlattenIteratorWrapper{T, I} where {T<:InfrastructureSystems.SupplementalAttribute, I<:(Vector)}
Returns an iterator of supplemental_attributes. T can be concrete or abstract. Call collect on the result if an array is desired.
Arguments
T: supplemental_attribute typemgr::SupplementalAttributeManager: SupplementalAttributeManager in the systemfilter_func::Union{Nothing, Function} = nothing: Optional function that accepts a component of type T and returns a Bool. Apply this function to each component and only return components where the result is true.
InfrastructureSystems.get_supplemental_attributes — Method
get_supplemental_attributes(
_::Type{T<:InfrastructureSystems.SupplementalAttribute},
component::InfrastructureSystems.InfrastructureSystemsComponent
) -> Any
Return a Vector of supplemental_attributes. T can be concrete or abstract.
Arguments
T: supplemental_attribute typesupplemental_attributes::SupplementalAttributes: SupplementalAttributes in the systemfilter_func::Union{Nothing, Function} = nothing: Optional function that accepts a component of type T and returns a Bool. Apply this function to each component and only return components where the result is true.
InfrastructureSystems.get_time_series — Method
get_time_series(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
key::InfrastructureSystems.TimeSeriesKey;
start_time,
len,
count
) -> Any
Return the exact stored data in a time series, using a time series key.
This will load all forecast windows into memory by default. Be aware of how much data is stored.
Specify start_time and len if you only need a subset of data.
Does not apply a scaling factor multiplier.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time serieskey::TimeSeriesKey: the time series' keystart_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If the time series is a subtype of Forecast thenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length in the time dimension. If nothing, use the entire length.count::Union{Nothing, Int} = nothing: Only applicable to subtypes of Forecast. Number of forecast windows starting atstart_timeto return. Defaults to all available.features...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series by name
InfrastructureSystems.get_time_series — Method
get_time_series(
::Type{T<:InfrastructureSystems.TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
name::AbstractString;
start_time,
len,
count,
resolution,
features...
) -> Any
Return the exact stored data in a time series
This will load all forecast windows into memory by default. Be aware of how much data is stored.
Specify start_time and len if you only need a subset of data.
Does not apply a scaling factor multiplier.
Arguments
::Type{T}: Concrete subtype ofTimeSeriesDatato returnowner::TimeSeriesOwners: Component or attribute containing the time seriesname::AbstractString: name of time seriesresolution::Union{Nothing, Dates.Period} = nothing: Required if resolution is needed to uniquely identify the time series.start_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If T is a subtype of Forecast thenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length in the time dimension. If nothing, use the entire length.count::Union{Nothing, Int} = nothing: Only applicable to subtypes of Forecast. Number of forecast windows starting atstart_timeto return. Defaults to all available.features...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series_array, get_time_series_values, get_time_series by key
InfrastructureSystems.get_time_series_array! — Method
get_time_series_array!(
cache::InfrastructureSystems.TimeSeriesCache,
timestamp::Dates.DateTime
) -> Any
Return the TimeSeries.TimeArray starting at timestamp. Reads from storage if the data is not already in cache.
Timestamps must be read sequentially. Repeated reads are allowed. Random access may be added in the future.
Arguments
cache::StaticTimeSeriesCache: cached instancetimestamp::Dates.DateTime: starting timestamp for the time series array
InfrastructureSystems.get_time_series_array — Method
get_time_series_array(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
forecast::InfrastructureSystems.Forecast;
start_time,
len,
ignore_scaling_factors
) -> Any
Return a TimeSeries.TimeArray for one forecast window from a cached Forecast instance
If the time series data are scaling factors, the returned data will be scaled by the scaling factor multiplier by default.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriesforecast::Forecast: a concrete subtype ofForecaststart_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp of one of the forecast windowslen::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also get_time_series_values, get_time_series_timestamps, ForecastCache, get_time_series_array by name from storage, get_time_series_array from a StaticTimeSeriesCache
InfrastructureSystems.get_time_series_array — Method
get_time_series_array(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
time_series::InfrastructureSystems.StaticTimeSeries;
start_time,
len,
ignore_scaling_factors
) -> Any
Return a TimeSeries.TimeArray from a cached StaticTimeSeries instance.
If the time series data are scaling factors, the returned data will be scaled by the scaling factor multiplier by default.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriestime_series::StaticTimeSeries: subtype ofStaticTimeSeries(e.g.,SingleTimeSeries)start_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp to retrieve. If nothing, use theinitial_timestampof the time series.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire lengthignore_scaling_factors = false: Iftrue, the time-series data will be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_values, get_time_series_timestamps, StaticTimeSeriesCache, get_time_series_array by name from storage, get_time_series_array from a ForecastCache
InfrastructureSystems.get_time_series_array — Method
get_time_series_array(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
key::InfrastructureSystems.TimeSeriesKey;
start_time,
len,
ignore_scaling_factors
) -> Any
Return a TimeSeries.TimeArray from storage, using a time series key.
If the time series data are scaling factors, the returned data will be scaled by the scaling factor multiplier by default.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time serieskey::TimeSeriesKey: the time series keystart_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If the time series is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_array by name, get_time_series_values, get_time_series_timestamps
InfrastructureSystems.get_time_series_array — Method
get_time_series_array(
::Type{T<:InfrastructureSystems.TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
name::AbstractString;
resolution,
start_time,
len,
ignore_scaling_factors,
features...
) -> Any
Return a TimeSeries.TimeArray from storage for the given time series parameters.
If the time series data are scaling factors, the returned data will be scaled by the scaling factor multiplier by default.
This will load all forecast windows into memory by default. Be aware of how much data is stored.
Specify start_time and len if you only need a subset of data.
Arguments
::Type{T}: the type of time series (a concrete subtype ofTimeSeriesData)owner::TimeSeriesOwners: Component or attribute containing the time seriesname::AbstractString: name of time seriesresolution::Union{Nothing, Dates.Period} = nothing: Required if resolution is needed to uniquely identify the time series.start_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If T is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theownerfeatures...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series_values, get_time_series_timestamps, get_time_series_array from a StaticTimeSeriesCache, get_time_series_array from a ForecastCache
InfrastructureSystems.get_time_series_counts — Method
get_time_series_counts(
store::InfrastructureSystems.TimeSeriesMetadataStore
) -> InfrastructureSystems.TimeSeriesCounts
Return an instance of TimeSeriesCounts.
sourceInfrastructureSystems.get_time_series_counts_by_type — Method
get_time_series_counts_by_type(
store::InfrastructureSystems.TimeSeriesMetadataStore
) -> Vector
Return a Vector of OrderedDict of stored time series counts by type.
sourceInfrastructureSystems.get_time_series_format — Method
get_time_series_format(file::CSV.File) -> Type
Return the time series format used in the CSV file.
sourceInfrastructureSystems.get_time_series_keys — Method
get_time_series_keys(
store::InfrastructureSystems.TimeSeriesMetadataStore,
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute}
) -> Vector
Return information about each time series array attached to the owner. This information can be used to call get_time_series.
InfrastructureSystems.get_time_series_keys — Method
get_time_series_keys(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute}
) -> Vector
Return information about each time series array attached to the owner. This information can be used to call get_time_series(::TimeSeriesOwners, ::TimeSeriesKey).
InfrastructureSystems.get_time_series_manager — Method
get_time_series_manager(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute}
) -> Any
Return the TimeSeriesManager or nothing if the component/attribute does not support time series.
sourceInfrastructureSystems.get_time_series_multiple — Function
get_time_series_multiple(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute};
...
) -> Union{Tuple{}, Channel{Any}}
get_time_series_multiple(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
filter_func;
type,
name,
resolution
) -> Union{Tuple{}, Channel{Any}}
Returns an iterator of TimeSeriesData instances attached to the component or attribute.
Note that passing a filter function can be much slower than the other filtering parameters because it reads time series data from media.
Call collect on the result to get an array.
Arguments
owner::TimeSeriesOwners: component or attribute from which to get time_seriesfilter_func = nothing: Only return time_series for which this returns true.type::Union{Nothing, ::Type{<:TimeSeriesData}} = nothing: Only return time_series with this type.name::Union{Nothing, AbstractString} = nothing: Only return time_series matching this value.resolution::Union{Nothing, Dates.Period} = nothing: Only return time_series matching this value.
See also: get_time_series_multiple from a System
InfrastructureSystems.get_time_series_multiple — Function
get_time_series_multiple(
data::InfrastructureSystems.SystemData;
...
) -> Channel{Any}
get_time_series_multiple(
data::InfrastructureSystems.SystemData,
filter_func;
type,
name
) -> Channel{Any}
Returns an iterator of TimeSeriesData instances attached to the system.
Note that passing a filter function can be much slower than the other filtering parameters because it reads time series data from media.
Call collect on the result to get an array.
Arguments
data::SystemData: systemfilter_func = nothing: Only return time_series for which this returns true.type = nothing: Only return time_series with this type.name = nothing: Only return time_series matching this value.
See also: get_time_series_multiple from an individual component or attribute
InfrastructureSystems.get_time_series_resolutions — Method
get_time_series_resolutions(
store::InfrastructureSystems.TimeSeriesMetadataStore;
time_series_type
) -> Any
Return a sorted Vector of distinct resolutions for all time series of the given type (or all types).
sourceInfrastructureSystems.get_time_series_timestamps — Method
get_time_series_timestamps(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
forecast::InfrastructureSystems.Forecast;
start_time,
len
) -> Vector{D} where D<:Dates.TimeType
Return a vector of timestamps from a cached Forecast instance.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriesforecast::Forecast: a concrete subtype ofForecaststart_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp of one of the forecast windowslen::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.
See also: get_time_series_array, get_time_series_values, ForecastCache, get_time_series_timestamps by name from storage, get_time_series_timestamps from a StaticTimeSeriesCache
InfrastructureSystems.get_time_series_timestamps — Method
get_time_series_timestamps(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
time_series::InfrastructureSystems.StaticTimeSeries;
start_time,
len
) -> Vector{D} where D<:Dates.TimeType
Return a vector of timestamps from a cached StaticTimeSeries instance.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriestime_series::StaticTimeSeries: subtype ofStaticTimeSeries(e.g.,SingleTimeSeries)start_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp to retrieve. If nothing, use theinitial_timestampof the time series.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length
See also: get_time_series_array, get_time_series_values, StaticTimeSeriesCache, get_time_series_timestamps by name from storage, get_time_series_timestamps from a ForecastCache
InfrastructureSystems.get_time_series_timestamps — Method
get_time_series_timestamps(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
key::InfrastructureSystems.TimeSeriesKey;
start_time,
len
) -> Vector{D} where D<:Dates.TimeType
Return a vector of timestamps from storage, using a time series key.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time serieskey::TimeSeriesKey: the time series keystart_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If the time series is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.
See also: get_time_series_timestamps by name, get_time_series_array, get_time_series_values
InfrastructureSystems.get_time_series_timestamps — Method
get_time_series_timestamps(
::Type{T<:InfrastructureSystems.TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
name::AbstractString;
resolution,
start_time,
len,
features...
) -> Vector{D} where D<:Dates.TimeType
Return a vector of timestamps from storage for the given time series parameters.
Arguments
::Type{T}: the type of time series (a concrete subtype ofTimeSeriesData)owner::TimeSeriesOwners: Component or attribute containing the time seriesname::AbstractString: name of time seriesresolution::Union{Nothing, Dates.Period} = nothing: Required if resolution is needed to uniquely identify the time series.start_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If T is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.features...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series_array, get_time_series_values, get_time_series_timestamps from a StaticTimeSeriesCache, get_time_series_timestamps from a ForecastCache
InfrastructureSystems.get_time_series_type — Method
get_time_series_type(
value::InfrastructureSystems.DeterministicMetadata
) -> Type{<:InfrastructureSystems.AbstractDeterministic}
Get DeterministicMetadata time_series_type.
InfrastructureSystems.get_time_series_uuid — Method
get_time_series_uuid(
value::InfrastructureSystems.DeterministicMetadata
) -> Base.UUID
Get DeterministicMetadata time_series_uuid.
InfrastructureSystems.get_time_series_uuid — Method
get_time_series_uuid(
value::InfrastructureSystems.ProbabilisticMetadata
) -> Base.UUID
Get ProbabilisticMetadata time_series_uuid.
InfrastructureSystems.get_time_series_uuid — Method
get_time_series_uuid(
value::InfrastructureSystems.ScenariosMetadata
) -> Base.UUID
Get ScenariosMetadata time_series_uuid.
InfrastructureSystems.get_time_series_uuid — Method
get_time_series_uuid(
value::InfrastructureSystems.SingleTimeSeriesMetadata
) -> Base.UUID
Get SingleTimeSeriesMetadata time_series_uuid.
InfrastructureSystems.get_time_series_values — Method
get_time_series_values(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
forecast::InfrastructureSystems.Forecast;
start_time,
len,
ignore_scaling_factors
) -> Any
Return an vector of timeseries data without timestamps for one forecast window from a cached Forecast instance.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriesforecast::Forecast: a concrete subtype ofForecaststart_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp of one of the forecast windowslen::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_array, get_time_series_timestamps, ForecastCache, get_time_series_values by name from storage, get_time_series_values from a StaticTimeSeriesCache
InfrastructureSystems.get_time_series_values — Method
get_time_series_values(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
time_series::InfrastructureSystems.StaticTimeSeries;
start_time,
len,
ignore_scaling_factors
) -> Any
Return an vector of timeseries data without timestamps from a cached StaticTimeSeries instance
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time seriestime_series::StaticTimeSeries: subtype ofStaticTimeSeries(e.g.,SingleTimeSeries)start_time::Union{Nothing, Dates.DateTime} = nothing: the first timestamp to retrieve. If nothing, use theinitial_timestampof the time series.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire lengthignore_scaling_factors = false: Iftrue, the time-series data will be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_array, get_time_series_timestamps, StaticTimeSeriesCache, get_time_series_values by name from storage, get_time_series_values from a ForecastCache
InfrastructureSystems.get_time_series_values — Method
get_time_series_values(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
key::InfrastructureSystems.TimeSeriesKey;
start_time,
len,
ignore_scaling_factors
) -> Any
Return a vector of time series data without timestamps from storage, using a time series key.
Arguments
owner::TimeSeriesOwners: Component or attribute containing the time serieskey::TimeSeriesKey: the time series keystart_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If the time series is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theowner
See also: get_time_series_values by name, get_time_series_array, get_time_series_timestamps
InfrastructureSystems.get_time_series_values — Method
get_time_series_values(
::Type{T<:InfrastructureSystems.TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
name::AbstractString;
resolution,
start_time,
len,
ignore_scaling_factors,
features...
) -> Any
Return an vector of timeseries data without timestamps from storage
If the data size is small and this will be called many times, consider using the version that accepts a cached TimeSeriesData instance.
Arguments
::Type{T}: type of the time series (a concrete subtype ofTimeSeriesData)owner::TimeSeriesOwners: Component or attribute containing the time seriesname::AbstractString: name of time seriesresolution::Union{Nothing, Dates.Period} = nothing: Required if resolution is needed to uniquely identify the time series.start_time::Union{Nothing, Dates.DateTime} = nothing: If nothing, use theinitial_timestampof the time series. If T is a subtype ofForecastthenstart_timemust be the first timestamp of a window.len::Union{Nothing, Int} = nothing: Length of time-series to retrieve (i.e. number of timestamps). If nothing, use the entire length.ignore_scaling_factors = false: Iftrue, the time-series data will be multiplied by the result of calling the storedscaling_factor_multiplierfunction on theownerfeatures...: User-defined tags that differentiate multiple time series arrays for the same component attribute, such as different arrays for different scenarios or years
See also: get_time_series_array, get_time_series_timestamps, get_time_series, get_time_series_values from a StaticTimeSeriesCache, get_time_series_values from a ForecastCache
InfrastructureSystems.get_timestamp — Method
get_timestamp(
_::Type{InfrastructureSystems.TimeSeriesFormatYMDPeriodAsColumn},
file::CSV.File,
row_index::Int64
) -> Any
Return a Dates.DateTime for the row in the CSV file.
sourceInfrastructureSystems.get_total_period — Method
get_total_period(f::InfrastructureSystems.Forecast) -> Any
Return the total period covered by the forecast.
sourceInfrastructureSystems.get_unique_timestamps — Method
get_unique_timestamps(
_::Type{T<:InfrastructureSystems.TimeSeriesFileFormat},
file::CSV.File
) -> Vector{Dict{String, Any}}
Return a vector of dicts of unique timestamps and their counts.
sourceInfrastructureSystems.get_uuid — Method
get_uuid(
geo::InfrastructureSystems.GeographicInfo
) -> Base.UUID
get_uuid(geo::GeographicInfo)Get the UUID from a GeographicInfo attribute.
Arguments
geo::GeographicInfo: theGeographicInfoattribute
InfrastructureSystems.get_uuid — Method
get_uuid(
obj::InfrastructureSystems.InfrastructureSystemsType
) -> Base.UUID
Gets the UUID for any InfrastructureSystemsType.
sourceInfrastructureSystems.get_value_columns — Method
get_value_columns(
_::Type{InfrastructureSystems.TimeSeriesFormatComponentsAsColumnsNoTime},
file::CSV.File
) -> Vector{Symbol}
Return the column names with values.
sourceInfrastructureSystems.get_value_columns — Method
get_value_columns(
_::Type{InfrastructureSystems.TimeSeriesFormatYMDPeriodAsColumn},
file::CSV.File
) -> Vector{Symbol}
Return the column names with values (components).
sourceInfrastructureSystems.get_value_curve — Method
get_value_curve(
cost::InfrastructureSystems.ProductionVariableCostCurve
) -> Any
Get the underlying ValueCurve representation of this ProductionVariableCostCurve
InfrastructureSystems.get_vom_cost — Method
get_vom_cost(
cost::InfrastructureSystems.ProductionVariableCostCurve
) -> Any
Get the variable operation and maintenance cost in currency/(power_units h)
sourceInfrastructureSystems.get_window — Method
get_window(
forecast::InfrastructureSystems.Forecast,
index::Int64;
len
) -> Any
Return the forecast window corresponsing to interval index.
sourceInfrastructureSystems.get_x_coords — Method
get_x_coords(
data::InfrastructureSystems.PiecewiseLinearData
) -> Vector{Float64}
Get the x-coordinates of the points that define the piecewise data
sourceInfrastructureSystems.get_x_coords — Method
get_x_coords(
data::InfrastructureSystems.PiecewiseStepData
) -> Vector{Float64}
Get the x-coordinates of the points that define the piecewise data
sourceInfrastructureSystems.get_x_coords — Method
get_x_coords(vc::PiecewiseAverageCurve) -> Vector{Float64}
Get the x-coordinates that define the PiecewiseAverageCurve
InfrastructureSystems.get_x_coords — Method
get_x_coords(
vc::PiecewiseIncrementalCurve
) -> Vector{Float64}
Get the x-coordinates that define the PiecewiseIncrementalCurve
InfrastructureSystems.get_x_coords — Method
get_x_coords(vc::PiecewisePointCurve) -> Vector{Float64}
Get the x-coordinates of the points that define the PiecewisePointCurve
InfrastructureSystems.get_x_lengths — Method
get_x_lengths(
pwl::Union{InfrastructureSystems.PiecewiseLinearData, InfrastructureSystems.PiecewiseStepData}
) -> Vector{Float64}
Calculates the x-length of each segment of a piecewise curve.
sourceInfrastructureSystems.get_y_coords — Method
get_y_coords(
data::InfrastructureSystems.PiecewiseLinearData
) -> Vector{Float64}
Get the y-coordinates of the points that define the PiecewiseLinearData
sourceInfrastructureSystems.get_y_coords — Method
get_y_coords(
data::InfrastructureSystems.PiecewiseStepData
) -> Vector{Float64}
Get the y-coordinates of the segments in the PiecewiseStepData
sourceInfrastructureSystems.get_y_coords — Method
get_y_coords(vc::PiecewisePointCurve) -> Vector{Float64}
Get the y-coordinates of the points that define the PiecewisePointCurve
InfrastructureSystems.has_association — Method
has_association(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
attribute::InfrastructureSystems.SupplementalAttribute
) -> Bool
Return true if there is at least one association matching the inputs.
sourceInfrastructureSystems.has_component — Method
has_component(
components::InfrastructureSystems.Components,
T::Type{<:InfrastructureSystems.InfrastructureSystemsComponent},
name::AbstractString
) -> Bool
Check to see if a component with name exists.
sourceInfrastructureSystems.has_component — Method
has_component(
data::InfrastructureSystems.SystemData,
subsystem_name::AbstractString,
component::InfrastructureSystems.InfrastructureSystemsComponent
) -> Bool
Return true if the component is in the subsystem.
sourceInfrastructureSystems.has_component — Method
has_component(
data::InfrastructureSystems.SystemData,
T::Type{<:InfrastructureSystems.InfrastructureSystemsComponent},
name::AbstractString
) -> Bool
Check to see if a component exists.
sourceInfrastructureSystems.has_components — Method
has_components(
components::InfrastructureSystems.Components,
T::Type{<:InfrastructureSystems.InfrastructureSystemsComponent}
) -> Bool
Check to see if a component if the given type exists.
sourceInfrastructureSystems.has_metadata — Method
has_metadata(
store::InfrastructureSystems.TimeSeriesMetadataStore,
time_series_uuid::Base.UUID
) -> Bool
Return True if there is time series matching the UUID.
sourceInfrastructureSystems.has_supplemental_attributes — Method
has_supplemental_attributes(
component::InfrastructureSystems.InfrastructureSystemsComponent
) -> Bool
Return true if the component has supplemental attributes.
sourceInfrastructureSystems.has_supplemental_attributes — Method
has_supplemental_attributes(
component::InfrastructureSystems.InfrastructureSystemsComponent,
_::Type{T<:InfrastructureSystems.SupplementalAttribute}
) -> Bool
Return true if the component has supplemental attributes of the given type.
sourceInfrastructureSystems.has_time_series — Method
has_time_series(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute};
kwargs...
) -> Bool
Return true if the component or supplemental attribute has time series data.
sourceInfrastructureSystems.has_time_series — Method
has_time_series(
val::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
_::Type{T<:InfrastructureSystems.TimeSeriesData}
) -> Bool
Return true if the component or supplemental attribute has time series data of type T.
sourceInfrastructureSystems.hash_from_fields — Method
hash_from_fields(a) -> Any
Compute a hash of the instance a by combining hashes of all its fields
InfrastructureSystems.head — Method
head(
time_series::InfrastructureSystems.SingleTimeSeries
) -> Any
Return a time_series with only the first num values.
sourceInfrastructureSystems.increment_count! — Method
increment_count!(
tracker::InfrastructureSystems.LogEventTracker,
event::InfrastructureSystems.LogEvent,
suppressed::Bool
) -> Union{Nothing, Int64, InfrastructureSystems.LogEvent}
Increments the count of a log event.
sourceInfrastructureSystems.index_to_initial_time — Method
index_to_initial_time(
forecast::InfrastructureSystems.Forecast,
index::Int64
) -> Any
Return the Dates.DateTime corresponding to an interval index.
sourceInfrastructureSystems.is_assigned_to_subsystem — Method
is_assigned_to_subsystem(
data::InfrastructureSystems.SystemData,
component::InfrastructureSystems.InfrastructureSystemsComponent,
subsystem_name::AbstractString
) -> Bool
Return true if the component is assigned to the subsystem.
sourceInfrastructureSystems.is_assigned_to_subsystem — Method
is_assigned_to_subsystem(
data::InfrastructureSystems.SystemData,
component::InfrastructureSystems.InfrastructureSystemsComponent
) -> Bool
Return true if the component is assigned to any subsystems.
sourceInfrastructureSystems.is_concave — Method
is_concave(
pwl::InfrastructureSystems.PiecewiseLinearData
) -> Bool
Returns True/False depending on the concavity of the underlying data. For piecewise linear data, it checks if the sequence of slopes is non-increasing.
sourceInfrastructureSystems.is_concave — Method
is_concave(
cost::InfrastructureSystems.ProductionVariableCostCurve
) -> Any
Calculate the concavity of the underlying data
sourceInfrastructureSystems.is_concave — Method
is_concave(curve::InfrastructureSystems.ValueCurve) -> Bool
Calculate the concavity of the underlying data
sourceInfrastructureSystems.is_convex — Method
is_convex(
pwl::InfrastructureSystems.PiecewiseLinearData
) -> Bool
Returns True/False depending on the convexity of the underlying data
sourceInfrastructureSystems.is_convex — Method
is_convex(
cost::InfrastructureSystems.ProductionVariableCostCurve
) -> Any
Calculate the convexity of the underlying data
sourceInfrastructureSystems.is_convex — Method
is_convex(curve::InfrastructureSystems.ValueCurve) -> Bool
Calculate the convexity of the underlying data
sourceInfrastructureSystems.is_cost_alias — Method
is_cost_alias(
_::Union{Type{<:InfrastructureSystems.ValueCurve}, InfrastructureSystems.ValueCurve}
) -> Bool
Whether there is a cost alias for the instance or type under consideration
sourceInfrastructureSystems.is_ext_valid_for_serialization — Method
is_ext_valid_for_serialization(value) -> Bool
Perform a test to see if JSON3 can convert this value so that the code can give the user a a comprehensible corrective action.
sourceInfrastructureSystems.is_transform_array_for_hdf_supported — Method
is_transform_array_for_hdf_supported(
_::Type{T<:Real}
) -> Bool
Check if the element type T is supported by transformarrayfor_hdf. Returns true if supported, false otherwise. Uses multiple dispatch for a more Julian approach.
sourceInfrastructureSystems.isequal_from_fields — Method
isequal_from_fields(a, b) -> Any
Compute the conjunction of the isequal values of all the fields in a and b
InfrastructureSystems.isequivalent — Method
isequivalent(x, y) -> Any
An equality predicate that is true for NaN, NaN (unlike ==) and for -0.0, 0.0 (unlike isequal)
InfrastructureSystems.iterate_components — Method
iterate_components(
components::InfrastructureSystems.Components
) -> InfrastructureSystems.FlattenIteratorWrapper{InfrastructureSystems.InfrastructureSystemsComponent, I} where I<:(Vector)
Iterates over all components.
Examples
for component in iterate_components(obj)
@show component
endSee also: get_components
InfrastructureSystems.iterate_container — Method
iterate_container(
container::InfrastructureSystems.InfrastructureSystemsContainer
) -> InfrastructureSystems.FlattenIteratorWrapper{InfrastructureSystems.InfrastructureSystemsComponent, I} where I<:(Vector)
Iterates over all data in the container.
sourceInfrastructureSystems.iterate_supplemental_attributes — Method
iterate_supplemental_attributes(
mgr::InfrastructureSystems.SupplementalAttributeManager
) -> Base.Iterators.Flatten{Base.Generator{Base.ValueIterator{Dict{DataType, Dict{Base.UUID, <:InfrastructureSystems.SupplementalAttribute}}}, InfrastructureSystems.var"#iterate_container##0#iterate_container##1"}}
Iterates over all supplemental_attributes.
Examples
for supplemental_attribute in iterate_supplemental_attributes(obj)
@show supplemental_attribute
endsourceInfrastructureSystems.iterate_windows — Method
iterate_windows(
forecast::InfrastructureSystems.DeterministicSingleTimeSeries
) -> Union{Tuple{Any}, Base.Generator{I, InfrastructureSystems.var"#iterate_windows##0#iterate_windows##1"{InfrastructureSystems.DeterministicSingleTimeSeries}} where I<:(StepRangeLen{T, R, S, Int64} where {T, R>:Dates.DateTime, S})}
Iterate over the windows in a forecast
Examples
for window in iterate_windows(forecast)
@show values(maximum(window))
endsourceInfrastructureSystems.iterate_windows — Method
iterate_windows(
forecast::InfrastructureSystems.Deterministic
) -> Base.Generator{I, InfrastructureSystems.var"#iterate_windows_common##0#iterate_windows_common##1"{InfrastructureSystems.Deterministic}} where I<:(DataStructures.IterableObject{C, DataStructures.EntireContainer, DataStructures.KeysIter, DataStructures.NoTokens, DataStructures.ForwardIter} where C<:(DataStructures.SortedDict{K, D, Ord} where {Ord<:Base.Order.Ordering, D, K}))
Iterate over the windows in a forecast
Examples
for window in iterate_windows(forecast)
@show values(maximum(window))
endsourceInfrastructureSystems.iterate_windows — Method
iterate_windows(
forecast::InfrastructureSystems.Probabilistic
) -> Base.Generator{I, InfrastructureSystems.var"#iterate_windows_common##0#iterate_windows_common##1"{InfrastructureSystems.Probabilistic}} where I<:(DataStructures.IterableObject{C, DataStructures.EntireContainer, DataStructures.KeysIter, DataStructures.NoTokens, DataStructures.ForwardIter} where C<:(DataStructures.SortedDict{K, D, Ord} where {Ord<:Base.Order.Ordering, D, K}))
Iterate over the windows in a forecast
Examples
for window in iterate_windows(forecast)
@show values(maximum(window))
endsourceInfrastructureSystems.iterate_windows — Method
iterate_windows(
forecast::InfrastructureSystems.Scenarios
) -> Base.Generator{I, InfrastructureSystems.var"#iterate_windows_common##0#iterate_windows_common##1"{InfrastructureSystems.Scenarios}} where I<:(DataStructures.IterableObject{C, DataStructures.EntireContainer, DataStructures.KeysIter, DataStructures.NoTokens, DataStructures.ForwardIter} where C<:(DataStructures.SortedDict{K, D, Ord} where {Ord<:Base.Order.Ordering, D, K}))
Iterate over the windows in a forecast
Examples
for window in iterate_windows(forecast)
@show values(maximum(window))
endsourceInfrastructureSystems.list_associated_component_uuids — Method
list_associated_component_uuids(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
attribute::InfrastructureSystems.SupplementalAttribute,
_::Nothing
) -> Any
Return the distinct component UUIDs associated with the attribute.
sourceInfrastructureSystems.list_associated_component_uuids — Method
list_associated_component_uuids(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
attribute::InfrastructureSystems.SupplementalAttribute,
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent}
) -> Any
Return the distinct component UUIDs associated with the attribute, filter by component type.
sourceInfrastructureSystems.list_associated_component_uuids — Method
list_associated_component_uuids(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
attribute_type::Type{<:InfrastructureSystems.SupplementalAttribute},
_::Nothing
) -> Any
Return the distinct component UUIDs associated with the attribute type.
sourceInfrastructureSystems.list_associated_component_uuids — Method
list_associated_component_uuids(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
attribute_type::Type{<:InfrastructureSystems.SupplementalAttribute},
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent}
) -> Any
Return the distinct component UUIDs associated with the attribute type, filter by component_type.
sourceInfrastructureSystems.list_associated_pair_uuids — Method
list_associated_pair_uuids(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
attribute_type::Type{<:InfrastructureSystems.SupplementalAttribute},
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent}
) -> Vector
Return the component and attribute UUIDs that are associated with the given types.
sourceInfrastructureSystems.list_associated_supplemental_attribute_uuids — Method
list_associated_supplemental_attribute_uuids(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
component::InfrastructureSystems.InfrastructureSystemsComponent,
_::Nothing
) -> Any
Return the distinct attribute UUIDs associated with the component.
sourceInfrastructureSystems.list_associated_supplemental_attribute_uuids — Method
list_associated_supplemental_attribute_uuids(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
component::InfrastructureSystems.InfrastructureSystemsComponent,
attribute_type::Type{<:InfrastructureSystems.SupplementalAttribute}
) -> Any
Return the distinct attribute UUIDs associated with the component, filter by attribute type.
sourceInfrastructureSystems.list_associated_supplemental_attribute_uuids — Method
list_associated_supplemental_attribute_uuids(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent},
_::Nothing
) -> Any
Return the distinct attribute UUIDs associated with the component type.
sourceInfrastructureSystems.list_associated_supplemental_attribute_uuids — Method
list_associated_supplemental_attribute_uuids(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent},
attribute_type::Type{<:InfrastructureSystems.SupplementalAttribute}
) -> Any
Return the distinct attribute UUIDs associated with the component type, filter by attribute_type.
sourceInfrastructureSystems.list_existing_time_series_uuids — Method
list_existing_time_series_uuids(
store::InfrastructureSystems.TimeSeriesMetadataStore,
uuids
) -> Any
Return the time series UUIDs specified in the passed uuids that are already stored.
sourceInfrastructureSystems.list_matching_time_series_uuids — Method
list_matching_time_series_uuids(
store::InfrastructureSystems.TimeSeriesMetadataStore;
time_series_type,
name,
resolution,
features...
) -> Any
Return the time series UUIDs that match the inputs.
sourceInfrastructureSystems.list_metadata_with_owner_uuid — Method
list_metadata_with_owner_uuid(
store::InfrastructureSystems.TimeSeriesMetadataStore,
owner_type::Type{<:Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute}};
time_series_type,
name,
resolution,
features...
) -> Vector
Return a Vector of NamedTuple of owner UUID and time series metadata matching the inputs.
sourceInfrastructureSystems.list_recorder_events — Method
list_recorder_events(
::Type{T<:InfrastructureSystems.AbstractRecorderEvent},
filename::AbstractString
) -> Vector{T} where T<:InfrastructureSystems.AbstractRecorderEvent
list_recorder_events(
::Type{T<:InfrastructureSystems.AbstractRecorderEvent},
filename::AbstractString,
filter_func::Union{Nothing, Function}
) -> Vector{T} where T<:InfrastructureSystems.AbstractRecorderEvent
Return the events of type T in filename.
Arguments
T: event typefilename::AbstractString: filename containing recorder eventsfilter_func::Union{Nothing, Function} = nothing: Optional function that accepts an event of type T and returns a Bool. Apply this function to each event and only return events where the result is true.
InfrastructureSystems.make_selector — Function
Factory function to create the appropriate subtype of ComponentSelector given the arguments. Users should call this rather than manually constructing ComponentSelectors.
Arguments
Several methods of this function have a parameter groupby::Union{Symbol, Function}, which specifies how the selector is grouped for the purposes of get_groups. The groupby argument has the following semantics:
groupby = :each(default): each component that makes up the selector forms its own group. The number of groups fromget_groupswill be equal to the number of components fromget_components.groupby = :all: all components that make up the selector are put into the same group.get_groupswill yield one group.groupby = partition_function: if the argument is a user-supplied function, the function will be applied to each component; all components with the same result under the function will be grouped together, with the name of the group specified by the function's output.
Other arguments are documented on a per-method basis.
Examples
See the methods.
sourceInfrastructureSystems.make_selector — Method
make_selector(
filter_func::Function,
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent};
name,
groupby
) -> InfrastructureSystems.FilterComponentSelector
Make a ComponentSelector from a filter function and a type of component. The filter function must accept instances of component_type as a sole argument and return a Bool. Optionally provide a grouping behavior and/or name for the selector. Selectors constructed this way point to all the components of the given type that satisfy the filter function, grouped by the groupby argument (see the base make_selector documentation).
Arguments
filter_func::Function: the filter function to apply to componentscomponent_type::Type{<:InfrastructureSystemsComponent}: the type of component to selectgroupby::Union{Symbol, Function} = :each: the grouping behavior (see the basemake_selectordocumentation)name::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(RenewableDispatch, x -> get_prime_mover_type(x) == PrimeMovers.PVe)
sel2 = make_selector(RenewableDispatch, x -> get_prime_mover_type(x) == PrimeMovers.PVe; groupby = :all)
sel3 = make_selector(RenewableDispatch, x -> get_prime_mover_type(x) == PrimeMovers.PVe; name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.make_selector — Method
make_selector(
component::InfrastructureSystems.InfrastructureSystemsComponent;
name
) -> InfrastructureSystems.NameComponentSelector
Make a ComponentSelector from a component, pointing to a single component with the same type and name as the one given. Optionally provide a name for the selector. Selectors constructed this way contain exactly one group, which contains one component if the target component exists and zero if it doesn't.
Arguments
component::InfrastructureSystemsComponent: the component whose type and name specify the target of this selectorname::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(my_component)
sel2 = make_selector(my_component; name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.make_selector — Method
make_selector(
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent},
component_name::AbstractString;
name
) -> InfrastructureSystems.NameComponentSelector
Make a ComponentSelector pointing to a single component with the given type and name. Optionally provide a name for the selector. Selectors constructed this way contain exactly one group, which contains one component if the target component exists and zero if it doesn't.
Arguments
component_type::Type{<:InfrastructureSystemsComponent}: the type of the target componentcomponent_name::AbstractString: the name of the target componentname::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(ThermalStandard, "322_CT_6")
sel2 = make_selector(ThermalStandard, "322_CT_6"; name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.make_selector — Method
make_selector(
component_type::Type{<:InfrastructureSystems.InfrastructureSystemsComponent};
groupby,
name
) -> InfrastructureSystems.TypeComponentSelector
Make a ComponentSelector from a type of component. Optionally provide a grouping behavior and/or name for the selector. Selectors constructed this way point to all the components of the given type, grouped by the groupby argument (see the base make_selector documentation).
Arguments
component_type::Type{<:InfrastructureSystemsComponent}: the type of component to selectgroupby::Union{Symbol, Function} = :each: the grouping behavior (see the basemake_selectordocumentation)name::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(RenewableDispatch)
sel2 = make_selector(RenewableDispatch; groupby = :all)
sel3 = make_selector(RenewableDispatch; name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.make_selector — Method
make_selector(
content::InfrastructureSystems.ComponentSelector...;
name
) -> InfrastructureSystems.ListComponentSelector
Make a ComponentSelector from several existing ComponentSelectors. Optionally provide a name for the selector. Selectors constructed this way contain one group for each of the selectors they were constructed with.
Arguments
content::ComponentSelector...: the list of selectors that should form the groupsname::Union{String, Nothing} = nothing: the name of the selector; if not provided, one will be constructed automatically
Examples
sel1 = make_selector(make_selector(ThermalStandard), make_selector(RenewableDispatch))
sel2 = make_selector(make_selector(ThermalStandard), make_selector(RenewableDispatch); name = "my_selector")See also: make_selector unified function documentation
InfrastructureSystems.make_time_array — Method
make_time_array(
forecast::InfrastructureSystems.Forecast,
start_time::Dates.DateTime;
len
) -> Any
Return a TimeSeries.TimeArray for one forecast window.
sourceInfrastructureSystems.make_time_series! — Method
make_time_series!(
cache::InfrastructureSystems.TimeSeriesParsingCache,
ts_file_metadata::InfrastructureSystems.TimeSeriesFileMetadata
) -> Any
Return a time series from TimeSeriesFileMetadata.
Arguments
cache::TimeSeriesParsingCache: cached datats_file_metadata::TimeSeriesFileMetadata: metadataresolution::{Nothing, Dates.Period}: skip any time_series that don't match this resolution
InfrastructureSystems.mask_component! — Method
mask_component!(
data::InfrastructureSystems.SystemData,
component::InfrastructureSystems.InfrastructureSystemsComponent;
remove_time_series,
remove_supplemental_attributes
)
Removes the component from the main container and adds it to the masked container.
sourceInfrastructureSystems.open_file_logger — Function
open_file_logger(func::Function, filename::String) -> Any
open_file_logger(
func::Function,
filename::String,
level
) -> Any
open_file_logger(
func::Function,
filename::String,
level,
mode
) -> Any
Opens a file logger using Logging.SimpleLogger.
Arguments
func::Functionfilename::String: logger filenamelevel=Logging.Info: optional, to change the minimum logging levelmode = "w+": Optional, to designate write mode
Example
open_file_logger("log.txt", Logging.Info) do logger
global_logger(logger)
@info "hello world"
endsourceInfrastructureSystems.optional_and_fns — Method
optional_and_fns(
fn1::Function,
fn2::Function
) -> InfrastructureSystems.var"#optional_and_fns##0#optional_and_fns##1"{<:Function, <:Function}
Return a function that computes the conjunction of the two functions with short-circuit evaluation, where if either of the functions is nothing it is as if its result is true.
InfrastructureSystems.prepare_for_removal! — Method
prepare_for_removal!(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute}
)
This function must be called when a component or attribute is removed from a system.
sourceInfrastructureSystems.prepare_for_serialization_to_file! — Method
prepare_for_serialization_to_file!(
data::InfrastructureSystems.SystemData,
filename::AbstractString;
force
)
Parent object should call this prior to serialization so that SystemData can store the appropriate path information for the time series data.
sourceInfrastructureSystems.read_time_series — Method
read_time_series(
::Type{T<:InfrastructureSystems.TimeSeriesData},
data_file::AbstractString;
...
) -> InfrastructureSystems.RawTimeSeries
read_time_series(
::Type{T<:InfrastructureSystems.TimeSeriesData},
data_file::AbstractString,
component_name;
kwargs...
) -> Any
Return a TimeArray from a CSV file.
Pass component_name when the file does not have the component name in a column header.
sourceInfrastructureSystems.read_time_series — Method
read_time_series(
::Type{T<:InfrastructureSystems.TimeSeriesFormatPeriodAsHeader},
::Type{<:InfrastructureSystems.StaticTimeSeries},
file::CSV.File,
component_name::AbstractString;
kwargs...
) -> InfrastructureSystems.RawTimeSeries
This version of the function supports the format where there is no column header for a component, so the component_name must be passed in.
sourceInfrastructureSystems.read_time_series — Method
read_time_series(
::Type{T<:InfrastructureSystems.TimeSeriesFormatComponentsAsColumnsNoTime},
::Type{<:InfrastructureSystems.StaticTimeSeries},
file::CSV.File;
...
) -> InfrastructureSystems.RawTimeSeries
read_time_series(
::Type{T<:InfrastructureSystems.TimeSeriesFormatComponentsAsColumnsNoTime},
::Type{<:InfrastructureSystems.StaticTimeSeries},
file::CSV.File,
component_name;
kwargs...
) -> InfrastructureSystems.RawTimeSeries
This version of the function only has component_name to match the interface. It is unused.
Set start_datetime as a keyword argument for the starting timestamp, otherwise the current day is used.
sourceInfrastructureSystems.read_time_series — Method
read_time_series(
::Type{T<:Union{InfrastructureSystems.TimeSeriesFormatDateTimeAsColumn, InfrastructureSystems.TimeSeriesFormatPeriodAsColumn}},
::Type{<:InfrastructureSystems.StaticTimeSeries},
file::CSV.File;
...
) -> InfrastructureSystems.RawTimeSeries
read_time_series(
::Type{T<:Union{InfrastructureSystems.TimeSeriesFormatDateTimeAsColumn, InfrastructureSystems.TimeSeriesFormatPeriodAsColumn}},
::Type{<:InfrastructureSystems.StaticTimeSeries},
file::CSV.File,
component_name;
kwargs...
) -> InfrastructureSystems.RawTimeSeries
Return a TimeSeries.TimeArray representing the CSV file.
This version of the function only has component_name to match the interface. It is unused.
sourceInfrastructureSystems.read_time_series — Method
read_time_series(
::Type{T<:InfrastructureSystems.TimeSeriesFormatDateTimeAsColumn},
::Type{InfrastructureSystems.Deterministic},
file::CSV.File;
...
) -> InfrastructureSystems.RawTimeSeries
read_time_series(
::Type{T<:InfrastructureSystems.TimeSeriesFormatDateTimeAsColumn},
::Type{InfrastructureSystems.Deterministic},
file::CSV.File,
component_name;
kwargs...
) -> InfrastructureSystems.RawTimeSeries
Return a RawTimeSeries from a CSV file.
Pass component_name when the file does not have the component name in a column header.
sourceInfrastructureSystems.read_time_series_file_metadata — Method
read_time_series_file_metadata(
file_path::AbstractString
) -> Any
Reads time_series metadata and fixes relative paths to the data files.
sourceInfrastructureSystems.rebuild_selector — Method
rebuild_selector(
selector::InfrastructureSystems.ListComponentSelector;
name,
groupby
) -> InfrastructureSystems.ListComponentSelector
Returns a ComponentSelector functionally identical to the input selector except with the changes to its fields specified in the keyword arguments. It is not guaranteed that the result will have the same concrete type.
Examples
Suppose you have a selector with manual groups and you want to group by :each:
sel = make_selector(make_selector(ThermalStandard), make_selector(RenewableDispatch))
sel_each = rebuild_selector(sel; groupby = :each) # will be a RegroupedComponentSelectorsourceInfrastructureSystems.rebuild_selector — Method
rebuild_selector(
selector::InfrastructureSystems.ComponentSelector;
name
) -> InfrastructureSystems.ListComponentSelector
Returns a ComponentSelector functionally identical to the input selector except with the changes to its fields specified in the keyword arguments.
Examples
Suppose you have a selector with name = "my_name. If you instead wanted name = "your_name:
sel = make_selector(ThermalStandard, "322_CT_6"; name = "my_name")
sel_yours = rebuild_selector(sel; name = "your_name")sourceInfrastructureSystems.rebuild_selector — Method
rebuild_selector(
selector::InfrastructureSystems.DynamicallyGroupedComponentSelector;
name,
groupby
) -> Any
Returns a ComponentSelector functionally identical to the input selector except with the changes to its fields specified in the keyword arguments.
Examples
Suppose you have a selector with groupby = :all. If you instead wanted groupby = :each:
sel = make_selector(ThermalStandard; groupby = :all)
sel_each = rebuild_selector(sel; groupby = :each)sourceInfrastructureSystems.redirect_stdout_to_log — Method
redirect_stdout_to_log(func::Function) -> Any
Redirect all data written to stdout by a function to log events.
sourceInfrastructureSystems.register_recorder! — Method
register_recorder!(name::Symbol; io, mode, directory)
Register a recorder to log events. Afterwards, calls to @record name <event-type>() will record the event as JSON in <name>.log.
Callers should guarantee that unregister_recorder! is called to close the file handle.
Arguments
name::Symbol: name of recorderio::Union{Nothing, IO}: If nothing, record events in a file using name.mode = "w": Only used when io is nothing.directory = ".": Only used when io is nothing.
InfrastructureSystems.remove_association! — Method
remove_association!(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
component::InfrastructureSystems.InfrastructureSystemsComponent,
attribute::InfrastructureSystems.SupplementalAttribute
)
Remove the association between the attribute and component.
sourceInfrastructureSystems.remove_associations! — Method
remove_associations!(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
type::Type{<:InfrastructureSystems.SupplementalAttribute}
)
Remove all associations of the given type.
sourceInfrastructureSystems.remove_component! — Method
remove_component!(
components::InfrastructureSystems.Components,
component::InfrastructureSystems.InfrastructureSystemsComponent;
remove_time_series,
remove_supplemental_attributes
) -> InfrastructureSystems.InfrastructureSystemsComponent
Remove a component by its value.
Throws ArgumentError if the component is not stored.
sourceInfrastructureSystems.remove_component! — Method
remove_component!(
::Type{T<:InfrastructureSystems.InfrastructureSystemsComponent},
components::InfrastructureSystems.Components,
name::AbstractString;
remove_time_series,
remove_supplemental_attributes
) -> InfrastructureSystems.InfrastructureSystemsComponent
Remove a component by its name.
Throws ArgumentError if the component is not stored.
sourceInfrastructureSystems.remove_component_from_subsystem! — Method
remove_component_from_subsystem!(
data::InfrastructureSystems.SystemData,
subsystem_name::AbstractString,
component::InfrastructureSystems.InfrastructureSystemsComponent
)
Remove a component from a subsystem.
Throws ArgumentError if the subsystem name or component is not stored.
sourceInfrastructureSystems.remove_components! — Method
remove_components!(
_::Type{T<:InfrastructureSystems.InfrastructureSystemsComponent},
components::InfrastructureSystems.Components
) -> Base.ValueIterator{T} where T<:(Dict{String, <:InfrastructureSystems.InfrastructureSystemsComponent})
Remove all components of type T.
Throws ArgumentError if the type is not stored.
sourceInfrastructureSystems.remove_metadata! — Method
remove_metadata!(
store::InfrastructureSystems.TimeSeriesMetadataStore,
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
metadata::InfrastructureSystems.TimeSeriesMetadata
) -> Union{Nothing, InfrastructureSystems.TimeSeriesMetadata}
Remove the matching metadata from the store.
sourceInfrastructureSystems.remove_subsystem! — Method
remove_subsystem!(
data::InfrastructureSystems.SystemData,
subsystem_name::AbstractString
)
Remove a subsystem from the system.
Throws ArgumentError if the subsystem name is not stored.
sourceInfrastructureSystems.remove_supplemental_attributes! — Method
remove_supplemental_attributes!(
mgr::InfrastructureSystems.SupplementalAttributeManager,
_::Type{T<:InfrastructureSystems.SupplementalAttribute}
) -> Base.ValueIterator{T} where T<:(Dict{Base.UUID, <:InfrastructureSystems.SupplementalAttribute})
Remove all supplemental_attributes of type T.
Ignores whether attributes are attached to components.
Throws ArgumentError if the type is not stored.
sourceInfrastructureSystems.remove_time_series! — Method
remove_time_series!(
mgr::InfrastructureSystems.TimeSeriesManager,
time_series_type::Type{<:InfrastructureSystems.TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
name::String;
resolution,
features...
)
Remove the time series data for a component.
sourceInfrastructureSystems.remove_time_series! — Method
remove_time_series!(
data::InfrastructureSystems.SystemData,
::Type{T<:InfrastructureSystems.TimeSeriesData},
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute},
name::String;
resolution,
features...
)
Remove the time series data for a component.
sourceInfrastructureSystems.remove_time_series! — Method
remove_time_series!(
data::InfrastructureSystems.SystemData,
::Type{T<:InfrastructureSystems.TimeSeriesData};
resolution
)
Removes all time series of a particular type from a System.
Arguments
data::SystemData: systemtype::Type{<:TimeSeriesData}: Type of time series objects to remove.resolution::Union{Nothing, Dates.Period} = nothing: Only remove time series with this resolution.
InfrastructureSystems.replace_component_uuid! — Method
replace_component_uuid!(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
old_uuid::Base.UUID,
new_uuid::Base.UUID
)
Replace the component UUID in the table.
sourceInfrastructureSystems.replace_iterator — Method
replace_iterator(
container::InfrastructureSystems.LazyDictFromIterator,
iter
)
Replace the iterator, maintaining the cached dict.
sourceInfrastructureSystems.report_log_summary — Method
report_log_summary(
tracker::InfrastructureSystems.LogEventTracker
) -> String
Returns a summary of log event counts by level.
sourceInfrastructureSystems.report_log_summary — Method
report_log_summary(
logger::InfrastructureSystems.MultiLogger
) -> String
Returns a summary of log event counts by level.
sourceInfrastructureSystems.reset! — Method
reset!(cache::InfrastructureSystems.TimeSeriesCache)
Reset parameters in order to start reading data from the beginning with get_next_time_series_array!
InfrastructureSystems.reset_iterator — Method
reset_iterator(
container::InfrastructureSystems.LazyDictFromIterator
)
Reset the iterator for cases where underlying arrays have changed.
sourceInfrastructureSystems.serialize — Method
serialize(
val::InfrastructureSystems.InfrastructureSystemsType
) -> Dict{String, Any}
Serialize the Julia value into standard types that can be converted to non-Julia formats, such as JSON. In cases where val is an instance of a struct, return a Dict. In cases where val is a scalar value, return that value.
sourceInfrastructureSystems.set_available! — Method
set_available!(
value::InfrastructureSystems.InfrastructureSystemsComponent
) -> Bool
Set the availability of the component.
sourceInfrastructureSystems.set_component! — Method
set_component!(
metadata::InfrastructureSystems.TimeSeriesFileMetadata,
data::InfrastructureSystems.SystemData,
mod::Module
) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsComponent}
Set the component value in metadata by looking up the category in module. This requires that category be a string version of a component's abstract type. Modules can override for custom behavior.
sourceInfrastructureSystems.set_count! — Method
set_count!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata count.
InfrastructureSystems.set_count! — Method
set_count!(
value::InfrastructureSystems.DeterministicSingleTimeSeries,
val
) -> Any
Set DeterministicSingleTimeSeries count.
InfrastructureSystems.set_count! — Method
set_count!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata count.
InfrastructureSystems.set_count! — Method
set_count!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata count.
InfrastructureSystems.set_data! — Method
InfrastructureSystems.set_data! — Method
InfrastructureSystems.set_data! — Method
InfrastructureSystems.set_data! — Method
set_data!(
value::InfrastructureSystems.SingleTimeSeries,
val
) -> Any
Set SingleTimeSeries data.
InfrastructureSystems.set_features! — Method
set_features!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata features.
InfrastructureSystems.set_features! — Method
set_features!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata features.
InfrastructureSystems.set_features! — Method
set_features!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata features.
InfrastructureSystems.set_features! — Method
set_features!(
value::InfrastructureSystems.SingleTimeSeriesMetadata,
val
) -> Any
Set SingleTimeSeriesMetadata features.
InfrastructureSystems.set_group_level! — Method
set_group_level!(
logger::InfrastructureSystems.MultiLogger,
group::Symbol,
level::Base.CoreLogging.LogLevel
)
Set the minimum log level for a group.
The group field of a log message defaults to its file's base name (no extension) as a symbol. It can be customized by setting _group = :a_group_name.
The minimum log level stored for a console or file logger supercede this setting.
sourceInfrastructureSystems.set_group_levels! — Method
set_group_levels!(
logger::InfrastructureSystems.MultiLogger,
group_levels::Dict{Symbol, Base.CoreLogging.LogLevel}
)
Set the minimum log levels for multiple groups. Refer to set_group_level! for more information.
InfrastructureSystems.set_horizon! — Method
set_horizon!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata horizon.
InfrastructureSystems.set_horizon! — Method
set_horizon!(
value::InfrastructureSystems.DeterministicSingleTimeSeries,
val
) -> Any
Set DeterministicSingleTimeSeries horizon.
InfrastructureSystems.set_horizon! — Method
set_horizon!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata horizon.
InfrastructureSystems.set_horizon! — Method
set_horizon!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata horizon.
InfrastructureSystems.set_initial_timestamp! — Method
set_initial_timestamp!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata initial_timestamp.
InfrastructureSystems.set_initial_timestamp! — Method
set_initial_timestamp!(
value::InfrastructureSystems.DeterministicSingleTimeSeries,
val
) -> Any
Set DeterministicSingleTimeSeries initial_timestamp.
InfrastructureSystems.set_initial_timestamp! — Method
set_initial_timestamp!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata initial_timestamp.
InfrastructureSystems.set_initial_timestamp! — Method
set_initial_timestamp!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata initial_timestamp.
InfrastructureSystems.set_initial_timestamp! — Method
set_initial_timestamp!(
value::InfrastructureSystems.SingleTimeSeriesMetadata,
val
) -> Any
Set SingleTimeSeriesMetadata initial_timestamp.
InfrastructureSystems.set_internal! — Method
set_internal!(
value::InfrastructureSystems.Deterministic,
val
) -> Any
Set Deterministic internal.
InfrastructureSystems.set_internal! — Method
set_internal!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata internal.
InfrastructureSystems.set_internal! — Method
set_internal!(
value::InfrastructureSystems.Probabilistic,
val
) -> Any
Set Probabilistic internal.
InfrastructureSystems.set_internal! — Method
set_internal!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata internal.
InfrastructureSystems.set_internal! — Method
InfrastructureSystems.set_internal! — Method
set_internal!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata internal.
InfrastructureSystems.set_internal! — Method
set_internal!(
value::InfrastructureSystems.SingleTimeSeries,
val
) -> Any
Set SingleTimeSeries internal.
InfrastructureSystems.set_internal! — Method
set_internal!(
value::InfrastructureSystems.SingleTimeSeriesMetadata,
val
) -> Any
Set SingleTimeSeriesMetadata internal.
InfrastructureSystems.set_interval! — Method
set_interval!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata interval.
InfrastructureSystems.set_interval! — Method
set_interval!(
value::InfrastructureSystems.DeterministicSingleTimeSeries,
val
) -> Any
Set DeterministicSingleTimeSeries interval.
InfrastructureSystems.set_interval! — Method
set_interval!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata interval.
InfrastructureSystems.set_interval! — Method
set_interval!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata interval.
InfrastructureSystems.set_length! — Method
set_length!(
value::InfrastructureSystems.SingleTimeSeriesMetadata,
val
) -> Any
Set SingleTimeSeriesMetadata length.
InfrastructureSystems.set_name! — Method
InfrastructureSystems.set_name! — Method
set_name!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata name.
InfrastructureSystems.set_name! — Method
InfrastructureSystems.set_name! — Method
set_name!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata name.
InfrastructureSystems.set_name! — Method
InfrastructureSystems.set_name! — Method
set_name!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata name.
InfrastructureSystems.set_name! — Method
set_name!(
value::InfrastructureSystems.SingleTimeSeries,
val
) -> Any
Set SingleTimeSeries name.
InfrastructureSystems.set_name! — Method
set_name!(
value::InfrastructureSystems.SingleTimeSeriesMetadata,
val
) -> Any
Set SingleTimeSeriesMetadata name.
InfrastructureSystems.set_name_internal! — Method
set_name_internal!(
value::InfrastructureSystems.InfrastructureSystemsComponent,
name
)
Set the name of the component. Must only be called by InfrastructureSystems.
sourceInfrastructureSystems.set_percentiles! — Method
set_percentiles!(
value::InfrastructureSystems.Probabilistic,
val
) -> Any
Set Probabilistic percentiles.
InfrastructureSystems.set_percentiles! — Method
set_percentiles!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata percentiles.
InfrastructureSystems.set_resolution! — Method
set_resolution!(
value::InfrastructureSystems.Deterministic,
val
) -> Any
Set Deterministic resolution.
InfrastructureSystems.set_resolution! — Method
set_resolution!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata resolution.
InfrastructureSystems.set_resolution! — Method
set_resolution!(
value::InfrastructureSystems.Probabilistic,
val
) -> Any
Set Probabilistic resolution.
InfrastructureSystems.set_resolution! — Method
set_resolution!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata resolution.
InfrastructureSystems.set_resolution! — Method
set_resolution!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata resolution.
InfrastructureSystems.set_resolution! — Method
set_resolution!(
value::InfrastructureSystems.SingleTimeSeriesMetadata,
val
) -> Any
Set SingleTimeSeriesMetadata resolution.
InfrastructureSystems.set_scaling_factor_multiplier! — Method
set_scaling_factor_multiplier!(
value::InfrastructureSystems.Deterministic,
val
) -> Any
Set Deterministic scaling_factor_multiplier.
InfrastructureSystems.set_scaling_factor_multiplier! — Method
set_scaling_factor_multiplier!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata scaling_factor_multiplier.
InfrastructureSystems.set_scaling_factor_multiplier! — Method
set_scaling_factor_multiplier!(
value::InfrastructureSystems.Probabilistic,
val
) -> Any
Set Probabilistic scaling_factor_multiplier.
InfrastructureSystems.set_scaling_factor_multiplier! — Method
set_scaling_factor_multiplier!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata scaling_factor_multiplier.
InfrastructureSystems.set_scaling_factor_multiplier! — Method
set_scaling_factor_multiplier!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata scaling_factor_multiplier.
InfrastructureSystems.set_scaling_factor_multiplier! — Method
set_scaling_factor_multiplier!(
value::InfrastructureSystems.SingleTimeSeries,
val
) -> Any
Set SingleTimeSeries scaling_factor_multiplier.
InfrastructureSystems.set_scaling_factor_multiplier! — Method
set_scaling_factor_multiplier!(
value::InfrastructureSystems.SingleTimeSeriesMetadata,
val
) -> Any
Set SingleTimeSeriesMetadata scaling_factor_multiplier.
InfrastructureSystems.set_scenario_count! — Method
set_scenario_count!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata scenario_count.
InfrastructureSystems.set_single_time_series! — Method
set_single_time_series!(
value::InfrastructureSystems.DeterministicSingleTimeSeries,
val
) -> Any
Set DeterministicSingleTimeSeries single_time_series.
InfrastructureSystems.set_time_series_type! — Method
set_time_series_type!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata time_series_type.
InfrastructureSystems.set_time_series_uuid! — Method
set_time_series_uuid!(
value::InfrastructureSystems.DeterministicMetadata,
val
) -> Any
Set DeterministicMetadata time_series_uuid.
InfrastructureSystems.set_time_series_uuid! — Method
set_time_series_uuid!(
value::InfrastructureSystems.ProbabilisticMetadata,
val
) -> Any
Set ProbabilisticMetadata time_series_uuid.
InfrastructureSystems.set_time_series_uuid! — Method
set_time_series_uuid!(
value::InfrastructureSystems.ScenariosMetadata,
val
) -> Any
Set ScenariosMetadata time_series_uuid.
InfrastructureSystems.set_time_series_uuid! — Method
set_time_series_uuid!(
value::InfrastructureSystems.SingleTimeSeriesMetadata,
val
) -> Any
Set SingleTimeSeriesMetadata time_series_uuid.
InfrastructureSystems.show_recorder_events — Method
show_recorder_events(
::Type{T<:InfrastructureSystems.AbstractRecorderEvent},
filename::AbstractString;
...
)
show_recorder_events(
::Type{T<:InfrastructureSystems.AbstractRecorderEvent},
filename::AbstractString,
filter_func::Union{Nothing, Function};
kwargs...
)
Show the events of type T in filename in a table. Refer to PrettyTables.jl documentation for accepted kwargs.
Arguments
T: event typefilename::AbstractString: filename containing recorder eventsfilter_func::Union{Nothing, Function} = nothing: Optional function that accepts an event of type T and returns a Bool. Apply this function to each event and only return events where the result is true.exclude_columns = Set{String}(): Column names to exclude from the tablekwargs: Passed to PrettyTables
Examples
show_recorder_events(TestEvent, test_recorder.log)
show_recorder_events(TestEvent, test_recorder.log, x -> x.val2 > 2)sourceInfrastructureSystems.show_supplemental_attributes — Method
show_supplemental_attributes(
component::InfrastructureSystems.InfrastructureSystemsComponent
)
Show a table with supplemental attributes attached to the component.
sourceInfrastructureSystems.show_time_series — Method
show_time_series(
owner::Union{InfrastructureSystems.InfrastructureSystemsComponent, InfrastructureSystems.SupplementalAttribute}
)
Show a table with time series data attached to the component.
sourceInfrastructureSystems.sql — Function
sql(
store::InfrastructureSystems.TimeSeriesMetadataStore,
query::String
) -> DataFrames.DataFrame
sql(
store::InfrastructureSystems.TimeSeriesMetadataStore,
query::String,
params
) -> DataFrames.DataFrame
Run a query and return the results in a DataFrame.
sourceInfrastructureSystems.sql — Function
sql(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
query::String
) -> DataFrames.DataFrame
sql(
associations::InfrastructureSystems.SupplementalAttributeAssociations,
query::String,
params
) -> DataFrames.DataFrame
Run a query and return the results in a DataFrame.
sourceInfrastructureSystems.strip_module_name — Method
strip_module_name(name::String) -> String
Strips the module name off of a type. This can be useful to print types as strings and receive consistent results regardless of whether the user used import or using to load a package.
Unlike Base.nameof, this function preserves any parametric types.
Examples
julia> strip_module_name(PowerSystems.RegulationDevice{ThermalStandard})
"RegulationDevice{ThermalStandard}"
julia> string(nameof(PowerSystems.RegulationDevice{ThermalStandard}))
"RegulationDevice"sourceInfrastructureSystems.subtype_to_string — Method
subtype_to_string(
subtype::Type{<:InfrastructureSystems.InfrastructureSystemsComponent}
) -> String
Canonical way to turn an InfrastructureSystemsComponent subtype into a unique string.
InfrastructureSystems.supertypes — Method
supertypes(::Type{T}) -> Vector{Any}
supertypes(::Type{T}, types) -> Any
Returns an array of all super types of T.
sourceInfrastructureSystems.supports_supplemental_attributes — Method
supports_supplemental_attributes(
_::InfrastructureSystems.InfrastructureSystemsComponent
) -> Bool
Return true if the component supports supplemental attributes.
sourceInfrastructureSystems.supports_time_series — Method
supports_time_series(
_::InfrastructureSystems.InfrastructureSystemsComponent
) -> Bool
Return true if the component supports time series.
sourceInfrastructureSystems.supports_time_series — Method
supports_time_series(
_::InfrastructureSystems.SupplementalAttribute
) -> Bool
Return true if the supplemental attribute supports time series.
sourceInfrastructureSystems.tail — Method
tail(
time_series::InfrastructureSystems.SingleTimeSeries
) -> Any
Return a time_series with only the ending num values.
sourceInfrastructureSystems.test_generated_structs — Method
test_generated_structs(
descriptor_file,
existing_dir
) -> Bool
Return true if the structs defined in existing_dir match structs freshly generated from descriptor_file.
InfrastructureSystems.to — Method
to(
time_series::InfrastructureSystems.SingleTimeSeries,
timestamp
) -> InfrastructureSystems.SingleTimeSeries
Return a time_series truncated after timestamp.
sourceInfrastructureSystems.to_dataframe — Method
to_dataframe(
store::InfrastructureSystems.TimeSeriesMetadataStore;
table
) -> DataFrames.DataFrame
Return the table as a DataFrame.
sourceInfrastructureSystems.to_dict — Method
to_dict(
data::InfrastructureSystems.SystemData
) -> Dict{String, Any}
Serialize all system and component data to a dictionary.
sourceInfrastructureSystems.to_json — Method
to_json(
obj::InfrastructureSystems.InfrastructureSystemsType;
pretty,
indent
) -> Any
Serializes a InfrastructureSystemsType to a JSON string.
sourceInfrastructureSystems.to_json — Method
to_json(
obj::InfrastructureSystems.InfrastructureSystemsType;
pretty,
indent
) -> Any
Serializes a InfrastructureSystemsType to a JSON file.
sourceInfrastructureSystems.to_records — Method
to_records(
associations::InfrastructureSystems.SupplementalAttributeAssociations
) -> Vector
Return all rows in the table as dictionaries.
sourceInfrastructureSystems.transform_single_time_series! — Method
transform_single_time_series!(
data::InfrastructureSystems.SystemData,
::Type{<:InfrastructureSystems.DeterministicSingleTimeSeries},
horizon::Dates.Period,
interval::Dates.Period;
resolution
)
Transform all instances of SingleTimeSeries to DeterministicSingleTimeSeries. If all SingleTimeSeries instances cannot be transformed then none will be.
Any existing DeterministicSingleTimeSeries forecasts will be deleted even if the inputs are invalid.
sourceInfrastructureSystems.unregister_recorder! — Method
unregister_recorder!(name::Symbol; close_io) -> Any
Unregister the recorder with this name and stop recording events.
sourceInfrastructureSystems.validate_exported_names — Method
validate_exported_names(mod::Module) -> Bool
Return true if all publicly exported names in mod are defined.
sourceInfrastructureSystems.validate_groupby — Method
validate_groupby(groupby::Symbol) -> Symbol
Helper function to check that the groupby argument is valid. Passes it through if so, errors if not.
InfrastructureSystems.validate_struct — Method
validate_struct(
ist::InfrastructureSystems.InfrastructureSystemsType
) -> Bool
Validates a struct using only information within the struct.
sourceInfrastructureSystems.validate_time_series_data_for_hdf — Method
validate_time_series_data_for_hdf(
_::DataStructures.SortedDict{Dates.DateTime, Array{T, 1}}
)
Validate that data in a SortedDict has supported element types for transformarrayfor_hdf. Throws an ArgumentError if any vector has an unsupported element type.
sourceInfrastructureSystems.when — Method
when(
time_series::InfrastructureSystems.SingleTimeSeries,
period::Function,
t::Integer
) -> Any
Refer to TimeSeries.when(). Underlying data is copied.
sourceInfrastructureSystems.@assert_op — Macro
Throw an AssertionError if conditions like op(exp1, exp2) are false, where op is a conditional infix operator.
Examples
julia> a = 3; b = 4;
julia> @assert_op a == b
ERROR: AssertionError: 3 == 4
julia> @assert_op a + 3 > b + 4
ERROR: AssertionError: 6 > 8sourceInfrastructureSystems.@record — Macro
Record an event if the recorder with name is enabled.
Arguments
name::Symbol: name of recorderevent::AbstractRecorderEvent: event to record
Examples
@record simulation TestEvent("start", 1, 2.0)sourceInfrastructureSystems.@scoped_enum — Macro
Macro to wrap Enum in a module to keep the top level scope clean.
Examples
julia> @scoped_enum Fruit APPLE = 1 ORANGE = 2
julia> value = Fruit.APPLE
Fruit.APPLE = 1
julia> value = Fruit(1)
Fruit.APPLE = 1
julia> @scoped_enum(Fruit,
APPLE = 1, # comment
ORANGE = 2, # comment
)sourceInfrastructureSystems.Simulation — Module
SimulationsourceInfrastructureSystems.Optimization — Module
OptimizationsourceInfrastructureSystems.Optimization.ConstructStage — Type
Optimization Container construction stage
sourceInfrastructureSystems.Optimization.ModelInternal — Type
Common structure to keep track of optimization models' internal information.
sourceInfrastructureSystems.Optimization.OptimizationProblemResults — Method
OptimizationProblemResults(directory::AbstractString) -> Any
Construct a OptimizationProblemResults instance from a serialized directory. It is up to the user or a higher-level package to set the source data using set_source_data!.
InfrastructureSystems.Optimization.OptimizerStats — Method
OptimizerStats(data::Vector{Float64}) -> Any
Construct OptimizerStats from a vector that was serialized.
sourceInfrastructureSystems.Optimization._handle_natural_units — Method
_handle_natural_units(
df::DataFrames.DataFrame,
base_power::Float64,
key::InfrastructureSystems.Optimization.OptimizationContainerKey
) -> DataFrames.DataFrame
Convert the value column to natural units, if required by the key. Does not mutate the input dataframe.
sourceInfrastructureSystems.Optimization.export_optimizer_stats — Method
export_optimizer_stats(
res::InfrastructureSystems.Results,
directory::AbstractString;
format
) -> Union{String, Vector{String}}
Save the optimizer statistics to CSV or JSON
Arguments
res::Union{OptimizationProblemResults, SimulationProblmeResults: Resultsdirectory::AbstractString: target directoryformat = "CSV": can be "csv" or "json
InfrastructureSystems.Optimization.export_realized_results — Method
export_realized_results(
res::InfrastructureSystems.Results
) -> String
Save the realized results to CSV files for all variables, paramaters, duals, auxiliary variables, expressions, and optimizer statistics.
Arguments
res::Results: Resultssave_path::AbstractString: path to save results (defaults to simulation path)
InfrastructureSystems.Optimization.export_results — Method
export_results(
results::InfrastructureSystems.Optimization.OptimizationProblemResults;
kwargs...
)
Exports all results from the operations problem.
sourceInfrastructureSystems.Optimization.read_aux_variable — Method
read_aux_variable(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
args...;
kwargs...
) -> DataFrames.DataFrame
Return the values for the requested aux_variable key for a problem. Accepts a vector of keys for the return of the values.
Arguments
aux_variable::Tuple{Type{<:AuxVariableType}, Type{<:PSY.Component}: Tuple with aux_variable type and device type for the desired resultsstart_time::Dates.DateTime: initial time of the requested resultslen::Int: length of results
InfrastructureSystems.Optimization.read_aux_variables — Method
read_aux_variables(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
aux_variables;
kwargs...
) -> Dict{String, DataFrames.DataFrame}
Return the values for the requested aux_variable keys for a problem. Accepts a vector of keys for the return of the values.
Arguments
aux_variables::Vector{Tuple{Type{<:AuxVariableType}, Type{<:PSY.Component}}: Tuple with aux_variable type and device type for the desired resultsstart_time::Dates.DateTime: initial time of the requested resultslen::Int: length of results
InfrastructureSystems.Optimization.read_aux_variables — Method
read_aux_variables(
res::InfrastructureSystems.Results;
kwargs...
) -> Dict
Return the values for all auxiliary variables.
sourceInfrastructureSystems.Optimization.read_dual — Method
read_dual(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
args...;
kwargs...
) -> DataFrames.DataFrame
Return the values for the requested dual key for a problem. Accepts a vector of keys for the return of the values.
Arguments
dual::Tuple{Type{<:ConstraintType}, Type{<:PSY.Component}: Tuple with dual type and device type for the desired resultsstart_time::Dates.DateTime: initial time of the requested resultslen::Int: length of results
InfrastructureSystems.Optimization.read_duals — Method
read_duals(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
duals;
kwargs...
) -> Dict{String, DataFrames.DataFrame}
Return the values for the requested dual keys for a problem. Accepts a vector of keys for the return of the values.
Arguments
duals::Vector{Tuple{Type{<:ConstraintType}, Type{<:PSY.Component}}: Tuple with dual type and device type for the desired resultsstart_time::Dates.DateTime: initial time of the requested resultslen::Int: length of results
InfrastructureSystems.Optimization.read_duals — Method
read_duals(
res::InfrastructureSystems.Results;
kwargs...
) -> Dict
Return the values for all duals.
sourceInfrastructureSystems.Optimization.read_expression — Method
read_expression(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
args...;
kwargs...
) -> DataFrames.DataFrame
Return the values for the requested expression key for a problem. Accepts a vector of keys for the return of the values.
Arguments
expression::Tuple{Type{<:ExpressionType}, Type{<:PSY.Component}: Tuple with expression type and device type for the desired resultsstart_time::Dates.DateTime: initial time of the requested resultslen::Int: length of results
InfrastructureSystems.Optimization.read_expressions — Method
read_expressions(
res::InfrastructureSystems.Optimization.OptimizationProblemResults;
kwargs...
) -> Dict{String, DataFrames.DataFrame}
Return the values for the requested expression keys for a problem. Accepts a vector of keys for the return of the values.
Arguments
expressions::Vector{Tuple{Type{<:ExpressionType}, Type{<:PSY.Component}}: Tuple with expression type and device type for the desired resultsstart_time::Dates.DateTime: initial time of the requested resultslen::Int: length of results
InfrastructureSystems.Optimization.read_expressions — Method
read_expressions(
res::InfrastructureSystems.Results;
kwargs...
) -> Dict{String, DataFrames.DataFrame}
Return the values for all expressions.
sourceInfrastructureSystems.Optimization.read_parameter — Method
read_parameter(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
args...;
kwargs...
) -> DataFrames.DataFrame
Return the values for the requested parameter key for a problem. Accepts a vector of keys for the return of the values.
Arguments
parameter::Tuple{Type{<:ParameterType}, Type{<:PSY.Component}: Tuple with parameter type and device type for the desired resultsstart_time::Dates.DateTime: initial time of the requested resultslen::Int: length of results
InfrastructureSystems.Optimization.read_parameters — Method
read_parameters(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
parameters;
kwargs...
) -> Dict{String, DataFrames.DataFrame}
Return the values for the requested parameter keys for a problem. Accepts a vector of keys for the return of the values.
Arguments
parameters::Vector{Tuple{Type{<:ParameterType}, Type{<:PSY.Component}}: Tuple with parameter type and device type for the desired resultsstart_time::Dates.DateTime: initial time of the requested resultslen::Int: length of results
InfrastructureSystems.Optimization.read_parameters — Method
read_parameters(
res::InfrastructureSystems.Results;
kwargs...
) -> Dict
Return the values for all parameters.
sourceInfrastructureSystems.Optimization.read_variable — Method
read_variable(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
args...;
kwargs...
) -> DataFrames.DataFrame
Return the values for the requested variable key for a problem. Accepts a vector of keys for the return of the values.
Arguments
res::OptimizationProblemResults: Optimization problem resultsvariable::Tuple{Type{<:VariableType}, Type{<:PSY.Component}: Tuple with variable type and device type for the desired resultsstart_time::Dates.DateTime: Start time of the requested resultslen::Int: length of resultstable_format::TableFormat: Format of the table to be returned. Default isTableFormat.LONGwhere the columns areDateTime,name, andvaluewhen the data has two dimensions andDateTime,name,name2, andvaluewhen the data has three dimensions. Set to itTableFormat.WIDEto pivot the names as columns. Note:TableFormat.WIDEis not supported when the data has more than two dimensions.
InfrastructureSystems.Optimization.read_variables — Method
read_variables(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
variables;
kwargs...
) -> Dict{String, DataFrames.DataFrame}
Return the values for the requested variable keys for a problem. Accepts a vector of keys for the return of the values.
Arguments
variables::Vector{Tuple{Type{<:VariableType}, Type{<:PSY.Component}}: Tuple with variable type and device type for the desired resultsstart_time::Dates.DateTime: initial time of the requested resultslen::Int: length of results
InfrastructureSystems.Optimization.read_variables — Method
read_variables(
res::InfrastructureSystems.Results;
kwargs...
) -> Dict
Return the values for all variables.
sourceInfrastructureSystems.Optimization.serialize_results — Method
serialize_results(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
directory::AbstractString
)
Serialize the results to a binary file.
It is recommended that directory be the directory that contains a serialized OperationModel. That will allow automatic deserialization of the PowerSystems.System. The OptimizationProblemResults instance can be deserialized with OptimizationProblemResults(directory).
InfrastructureSystems.Optimization.set_source_data! — Method
set_source_data!(
res::InfrastructureSystems.Optimization.OptimizationProblemResults,
source::InfrastructureSystems.InfrastructureSystemsType
)
Set the system in the results instance.
Throws InvalidValue if the source UUID is incorrect.
sourceInfrastructureSystems.Optimization.to_matrix — Method
to_matrix(
stats::InfrastructureSystems.Optimization.OptimizerStats
) -> Matrix{Float64}
Convert OptimizerStats to a matrix of floats that can be serialized.
source