Reference
Contents
Index
AustralianElectricityMarkets.AEMDBAustralianElectricityMarkets.HiveConfigurationAustralianElectricityMarkets._add_demand_ts_to_components!AustralianElectricityMarkets._add_renewable_ts_to_components!AustralianElectricityMarkets._as_timearrayAustralianElectricityMarkets._filter_latestAustralianElectricityMarkets._filter_latestAustralianElectricityMarkets._parse_hive_rootAustralianElectricityMarkets.read_demandAustralianElectricityMarkets.read_hiveAustralianElectricityMarkets.read_interconnectorsAustralianElectricityMarkets.read_unitsAustralianElectricityMarkets.set_demand!AustralianElectricityMarkets.set_market_bids!AustralianElectricityMarkets.set_renewable_pv!AustralianElectricityMarkets.set_renewable_wind!
AustralianElectricityMarkets.AEMDB Type
AEMDB(db::DuckDB, config::HiveConfiguration)
Thin wrapper with the connection and a configuration for the data locationAustralianElectricityMarkets.HiveConfiguration Type
HiveConfigurationConfiguration 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.
AustralianElectricityMarkets._add_demand_ts_to_components! Method
_add_demand_ts_to_components!(sys, ts, type)Adds demand time series data to the system components.
Arguments
sys: ThePowerSystems.Systemobject.ts: ATimeArrayof demand data.type: The type of component to add the time series to.
AustralianElectricityMarkets._add_renewable_ts_to_components! Method
_add_renewable_ts_to_components!(sys, ts, prime_mover)Adds renewable generation time series data to the system components.
Arguments
sys: ThePowerSystems.Systemobject.ts: ATimeArrayof renewable generation data.prime_mover: The prime mover type of the renewable generator.
AustralianElectricityMarkets._as_timearray Method
_as_timearray(df, index, col, value)Converts a DataFrame to a TimeArray.
Arguments
df: The inputDataFrame.index: The column to use as the timestamp.col: The column to use for the column names of theTimeArray.value: The column to use for the values of theTimeArray.
AustralianElectricityMarkets._filter_latest Method
_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.
AustralianElectricityMarkets._filter_latest Method
_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.
AustralianElectricityMarkets._parse_hive_root Method
_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.
AustralianElectricityMarkets.read_demand Method
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
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
sourceAustralianElectricityMarkets.read_hive Method
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 toCONFIG[].
AustralianElectricityMarkets.read_interconnectors Method
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
db = aem_connect(duckdb())
interconnectors_df = read_interconnectors(db)
println(interconnectors_df)AustralianElectricityMarkets.read_units Method
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
db = aem_connect(duckdb())
units_df = read_units(db)
println(units_df)AustralianElectricityMarkets.set_demand! Method
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: ThePowerSystems.Systemobject.db: The database connection.date_range: A range of dates for which to fetch demand data.kwargs: Additional keyword arguments passed toread_demand.
AustralianElectricityMarkets.set_market_bids! Method
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: ThePowerSystems.Systemobject.db: The database connection.date_range: A range of dates for which to fetch the data.kwargs: Additional keyword arguments passed toread_demand.
AustralianElectricityMarkets.set_renewable_pv! Method
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: ThePowerSystems.Systemobject.db: The database connection.date_range: A range of dates for which to fetch the data.kwargs: Additional keyword arguments passed toread_demand.
AustralianElectricityMarkets.set_renewable_wind! Method
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: ThePowerSystems.Systemobject.db: The database connection.date_range: A range of dates for which to fetch the data.kwargs: Additional keyword arguments passed toread_demand.