Skip to content

Reference

Contents

Index

AustralianElectricityMarkets.AEMDB Type
julia
AEMDB(db::DuckDB, config::HiveConfiguration)

Thin wrapper with the connection and a configuration for the data location
source
AustralianElectricityMarkets.HiveConfiguration Type
julia
HiveConfiguration

Configuration for accessing data.

Fields

  • hive_location::String: The directory where data is cached. Defaults to ~/.nemweb_cache.

  • filesystem::String: The filesystem to use for the cache. Defaults to "local". Can be s3, gs.

source
AustralianElectricityMarkets._add_demand_ts_to_components! Method
julia
_add_demand_ts_to_components!(sys, ts, type)

Adds demand time series data to the system components.

Arguments

  • sys: The PowerSystems.System object.

  • ts: A TimeArray of demand data.

  • type: The type of component to add the time series to.

source
AustralianElectricityMarkets._add_renewable_ts_to_components! Method
julia
_add_renewable_ts_to_components!(sys, ts, prime_mover)

Adds renewable generation time series data to the system components.

Arguments

  • sys: The PowerSystems.System object.

  • ts: A TimeArray of renewable generation data.

  • prime_mover: The prime mover type of the renewable generator.

source
AustralianElectricityMarkets._as_timearray Method
julia
_as_timearray(df, index, col, value)

Converts a DataFrame to a TimeArray.

Arguments

  • df: The input DataFrame.

  • index: The column to use as the timestamp.

  • col: The column to use for the column names of the TimeArray.

  • value: The column to use for the values of the TimeArray.

source
AustralianElectricityMarkets._filter_latest Method
julia
_filter_latest(table, key)

Helper function to filter for the most recent records in a table based on a given key.

Arguments

  • table: The TidierDB table to filter.

  • key: The column (as a Symbol) to use for determining the latest records.

source
AustralianElectricityMarkets._filter_latest Method
julia
_filter_latest(table, key=:archive_month)

Helper function to filter for the most recent records in a table.

Arguments

  • table: The table to filter.

  • key: The column to use for determining the latest records. Defaults to :archive_month.

source
AustralianElectricityMarkets._parse_hive_root Method
julia
_parse_hive_root(config::PyHiveConfiguration)

Construct the correct path to the Hive dataset based on the specified filesystem.

Arguments

  • config::PyHiveConfiguration: The configuration object containing filesystem and location details.
source
AustralianElectricityMarkets.read_demand Method
julia
read_demand(db; resolution::Dates.Period=Dates.Minute(5))

Read and process regional demand data from the database.

Arguments

  • db: The database connection.

  • resolution::Dates.Period: The time resolution to which the data should be floored. Defaults to 5 minutes.

Returns

A DataFrame with demand and renewable availability data, aggregated by the specified resolution.

Example

julia
db = aem_connect(duckdb())
demand_df = read_demand(db; resolution=Dates.Hour(1))
println(demand_df)

Row │ SETTLEMENTDATE REGIONID TOTALDEMAND DISPATCHABLEGENERATION DISPATCHABLELOAD NETINTERCHANGE │ Dates.DateTime String7 Float64 Float64 Float64 Float64 ───────┼────────────────────────────────────────────────────────────────────────────────────────────────────── 1 │ 2024-01-01T00:05:00 NSW1 6574.92 6721.88 0.0 146.96 2 │ 2024-01-01T00:05:00 QLD1 6228.31 5713.21 0.0 -515.1 3 │ 2024-01-01T00:05:00 SA1 1293.98 1116.68 0.0 -177.3 4 │ 2024-01-01T00:05:00 TAS1 1033.29 580.29 0.0 -453.0 5 │ 2024-01-01T00:05:00 VIC1 3977.1 5071.17 0.0 1094.07

source
AustralianElectricityMarkets.read_hive Method
julia
read_hive(db::TidierDB.DBInterface.Connection,table_name::Symbol; config::HiveConfiguration=CONFIG[])

Read a hive-partitioned parquet dataset into a TidierDB table.

Arguments

  • db::TidierDB.DBInterface.Connection: The database connection to use.

  • table_name::Symbol: The name of the table to read.

  • config::HiveConfiguration: The configuration to use. Defaults to CONFIG[].

source
AustralianElectricityMarkets.read_interconnectors Method
julia
read_interconnectors(db)

Reads and processes interconnector data from the database.

Arguments

  • db: The database connection.

Returns

A DataFrame containing the latest interconnector constraint data.

Example

julia
db = aem_connect(duckdb())
interconnectors_df = read_interconnectors(db)
println(interconnectors_df)
source
AustralianElectricityMarkets.read_units Method
julia
read_units(db)

Gathers and processes unit data from the database.

Arguments

  • db: The database connection.

Returns

A DataFrame containing detailed information about each generation unit.

Example

julia
db = aem_connect(duckdb())
units_df = read_units(db)
println(units_df)
source
AustralianElectricityMarkets.set_demand! Method
julia
set_demand!(sys, db, date_range; kwargs...)

Adds load time series data to the system from the database.

This function reads demand data for a specified date range, processes it into a time series, and attaches it to the PowerLoad components in the system.

Arguments

  • sys: The PowerSystems.System object.

  • db: The database connection.

  • date_range: A range of dates for which to fetch demand data.

  • kwargs: Additional keyword arguments passed to read_demand.

source
AustralianElectricityMarkets.set_market_bids! Method
julia
set_renewable_pv!(sys, db, date_range; kwargs...)

Adds Market bids time series data to the system.

This function reads solar availability data for a specified date range from the database, processes it into a time series, and attaches it to the RenewableDispatch components representing PV generators.

Arguments

  • sys: The PowerSystems.System object.

  • db: The database connection.

  • date_range: A range of dates for which to fetch the data.

  • kwargs: Additional keyword arguments passed to read_demand.

source
AustralianElectricityMarkets.set_renewable_pv! Method
julia
set_renewable_pv!(sys, db, date_range; kwargs...)

Adds photovoltaic (PV) renewable generation time series data to the system.

This function reads solar availability data for a specified date range from the database, processes it into a time series, and attaches it to the RenewableDispatch components representing PV generators.

Arguments

  • sys: The PowerSystems.System object.

  • db: The database connection.

  • date_range: A range of dates for which to fetch the data.

  • kwargs: Additional keyword arguments passed to read_demand.

source
AustralianElectricityMarkets.set_renewable_wind! Method
julia
set_renewable_wind!(sys, db, date_range; kwargs...)

Adds wind turbine renewable generation time series data to the system.

This function reads wind availability data for a specified date range from the database, processes it into a time series, and attaches it to the RenewableDispatch components representing wind turbines.

Arguments

  • sys: The PowerSystems.System object.

  • db: The database connection.

  • date_range: A range of dates for which to fetch the data.

  • kwargs: Additional keyword arguments passed to read_demand.

source