{ "cells": [ { "cell_type": "markdown", "source": [ "# Parsing Tabular Data" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Originally Contributed by**: Clayton Barrows" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Introduction" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "An example of how to parse tabular files (CSV) files similar to the format established in\n", "the [RTS-GMLC](github.com/gridmod/rts-gmlc/RTS_Data/SourceData) and create a `System` using\n", "[PowerSystems.jl](github.com/NREL-SIIP/PowerSystems.jl)" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "### Dependencies" ], "metadata": {} }, { "outputs": [], "cell_type": "code", "source": [ "using PowerSystems\n", "using TimeSeries\n", "using Dates" ], "metadata": {}, "execution_count": 1 }, { "cell_type": "markdown", "source": [ "### Fetch Data\n", "PowerSystems.jl links to some test data that is suitable for this example.\n", "Let's download the test data" ], "metadata": {} }, { "outputs": [], "cell_type": "code", "source": [ "PowerSystems.download(PowerSystems.TestData; branch = \"master\") # *note* add `force=true` to get a fresh copy\n", "base_dir = dirname(dirname(pathof(PowerSystems)));" ], "metadata": {}, "execution_count": 2 }, { "cell_type": "markdown", "source": [ "### The tabular data format relies on a folder containing `*.csv` files and a `user_descriptors.yaml` file\n", "First, we'll read the tabular data" ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ Info: Parsing csv files in Reserves ...\n", "[ Info: Parsing csv data in DAY_AHEAD_regional_Flex_Down.csv ...\n", "[ Info: Parsing csv data in DAY_AHEAD_regional_Flex_Up.csv ...\n", "[ Info: Parsing csv data in DAY_AHEAD_regional_Reg_Down.csv ...\n", "[ Info: Parsing csv data in DAY_AHEAD_regional_Reg_Up.csv ...\n", "[ Info: Parsing csv data in DAY_AHEAD_regional_Spin_Up_R1.csv ...\n", "[ Info: Parsing csv data in DAY_AHEAD_regional_Spin_Up_R2.csv ...\n", "[ Info: Parsing csv data in DAY_AHEAD_regional_Spin_Up_R3.csv ...\n", "[ Info: Parsing csv data in REAL_TIME_regional_Reg_Down.csv ...\n", "[ Info: Parsing csv data in REAL_TIME_regional_Reg_Up.csv ...\n", "[ Info: Parsing csv data in REAL_TIME_regional_Spin_Up_R1.csv ...\n", "[ Info: Parsing csv data in REAL_TIME_regional_Spin_Up_R2.csv ...\n", "[ Info: Parsing csv data in REAL_TIME_regional_Spin_Up_R3.csv ...\n", "[ Info: Successfully parsed Reserves\n", "[ Info: Parsing csv data in branch.csv ...\n", "[ Info: Successfully parsed branch.csv\n", "[ Info: Parsing csv data in bus.csv ...\n", "[ Info: Successfully parsed bus.csv\n", "[ Info: Parsing csv data in dc_branch.csv ...\n", "[ Info: Successfully parsed dc_branch.csv\n", "[ Info: Parsing csv data in gen.csv ...\n", "[ Info: Successfully parsed gen.csv\n", "[ Info: Parsing csv data in reserves.csv ...\n", "[ Info: Successfully parsed reserves.csv\n", "[ Info: Parsing csv data in simulation_objects.csv ...\n", "[ Info: Successfully parsed simulation_objects.csv\n", "[ Info: Parsing csv data in storage.csv ...\n", "[ Info: Successfully parsed storage.csv\n", "[ Info: Parsing csv data in timeseries_pointers.csv ...\n", "[ Info: Successfully parsed timeseries_pointers.csv\n" ] }, { "output_type": "execute_result", "data": { "text/plain": "PowerSystems.PowerSystemTableData:\n directory: /Users/cbarrows/.julia/packages/PowerSystems/61h6O/data/RTS_GMLC\n timeseries_metadata_file: /Users/cbarrows/.julia/packages/PowerSystems/61h6O/data/RTS_GMLC/timeseries_pointers.json\n base_power: 100.0\n PowerSystems.InputCategoryModule.InputCategory.STORAGE = 8: 22×8 DataFrame\n PowerSystems.InputCategoryModule.InputCategory.BRANCH = 1: 120×14 DataFrame\n PowerSystems.InputCategoryModule.InputCategory.DC_BRANCH = 3: 1×60 DataFrame\n PowerSystems.InputCategoryModule.InputCategory.GENERATOR = 4: 158×58 DataFrame\n PowerSystems.InputCategoryModule.InputCategory.RESERVE = 6: 7×7 DataFrame\n PowerSystems.InputCategoryModule.InputCategory.BUS = 2: 73×15 DataFrame\n" }, "metadata": {}, "execution_count": 3 } ], "cell_type": "code", "source": [ "RTS_GMLC_DIR = joinpath(base_dir, \"data\", \"RTS_GMLC\");\n", "rawsys = PowerSystems.PowerSystemTableData(\n", " RTS_GMLC_DIR,\n", " 100.0,\n", " joinpath(RTS_GMLC_DIR, \"user_descriptors.yaml\"),\n", " timeseries_metadata_file = joinpath(RTS_GMLC_DIR, \"timeseries_pointers.json\"),\n", " generator_mapping_file = joinpath(RTS_GMLC_DIR, \"generator_mapping_multi_start.yaml\"),\n", ")" ], "metadata": {}, "execution_count": 3 }, { "cell_type": "markdown", "source": [ "### Create a `System`\n", "Next, we'll create a `System` from the `rawsys` data. Since a `System` is predicated on a\n", "time series resolution and the `rawsys` data includes both 5-minute and 1-hour resolution\n", "time series, we also need to specify which time series we want to include in the `System`.\n", "The `time_series_resolution` kwarg filters to only include time series with a matching resolution." ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ Info: Unit System changed to InfrastructureSystems.UnitSystemModule.UnitSystem.DEVICE_BASE = 1\n", "┌ Warning: Missing PowerSystems.InputCategoryModule.InputCategory.LOAD = 5 data.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:213\n", "┌ Warning: Rate 175.0 MW for A1 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A2 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A3 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A4 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A5 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A6 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A8 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A9 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A10 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A11 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for AB1 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A12-1 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for A13-2 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A18 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A19 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A20 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A21 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A22 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for AB2 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A23 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A24 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A25-1 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A25-2 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A26 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A27 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A28 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A29 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A30 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A31-1 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A31-2 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A32-1 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A32-2 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A33-1 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A33-2 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for A34 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for AB3 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B1 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B2 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B3 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B4 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B5 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B6 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B8 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B9 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B10 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B11 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B12-1 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 175.0 MW for B13-2 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for B18 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 500.0 MW for B19 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Status at Start is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Time at Status is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Cold is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Warm is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Hot is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Must Run is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: Missing PowerSystems.InputCategoryModule.InputCategory.LOAD = 5 data.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:213\n", "[ Info: Adding contributing generators for Spin_Up_R1 by category\n", "┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Status at Start is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Time at Status is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Cold is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Warm is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Hot is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Must Run is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "[ Info: Adding contributing generators for Spin_Up_R2 by category\n", "┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Status at Start is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Time at Status is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Cold is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Warm is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Hot is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Must Run is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "[ Info: Adding contributing generators for Spin_Up_R3 by category\n", "┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Status at Start is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Time at Status is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Cold is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Warm is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Hot is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Must Run is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "[ Info: Adding contributing generators for Flex_Up by category\n", "┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Status at Start is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Time at Status is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Cold is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Warm is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Hot is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Must Run is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "[ Info: Adding contributing generators for Flex_Down by category\n", "┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Status at Start is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Time at Status is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Cold is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Warm is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Hot is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Must Run is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "[ Info: Adding contributing generators for Reg_Up by category\n", "┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Status at Start is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Time at Status is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Cold is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Warm is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Hot is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Must Run is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "[ Info: Adding contributing generators for Reg_Down by category\n", "┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Status at Start is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Time at Status is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Cold is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Warm is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Start Cost Hot is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: User-defined column name Must Run is not in dataframe.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/61h6O/src/parsers/power_system_table_data.jl:1367\n", "┌ Warning: There is only one forecast window. Setting interval = 0 seconds\n", "└ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/3LlGM/src/component.jl:676\n" ] }, { "output_type": "execute_result", "data": { "text/plain": "System\n======\nSystem Units Base: DEVICE_BASE\nBase Power: 100.0\nBase Frequency: 60.0\n\nComponents\n==========\nNum components: 525\n\n\u001b[1m15×3 DataFrame\u001b[0m\n\u001b[1m Row \u001b[0m│\u001b[1m ConcreteType \u001b[0m\u001b[1m SuperTypes \u001b[0m\n\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\n─────┼──────────────────────────────────────────────────────────────────────────\n 1 │ Arc Topology <: Component <: Infrast…\n 2 │ Area AggregationTopology <: Topology …\n 3 │ Bus Topology <: Component <: Infrast…\n 4 │ GenericBattery Storage <: StaticInjection <: De…\n 5 │ HVDCLine DCBranch <: Branch <: Device <: …\n 6 │ HydroDispatch HydroGen <: Generator <: StaticI…\n 7 │ Line ACBranch <: Branch <: Device <: …\n 8 │ LoadZone AggregationTopology <: Topology …\n 9 │ PowerLoad StaticLoad <: ElectricLoad <: St…\n 10 │ RenewableDispatch RenewableGen <: Generator <: Sta…\n 11 │ RenewableFix RenewableGen <: Generator <: Sta…\n 12 │ TapTransformer ACBranch <: Branch <: Device <: …\n 13 │ ThermalMultiStart ThermalGen <: Generator <: Stati…\n 14 │ VariableReserve{PowerSystems.Res… Reserve{PowerSystems.ReserveDown…\n 15 │ VariableReserve{PowerSystems.Res… Reserve{PowerSystems.ReserveUp} …\n\u001b[36m 1 column omitted\u001b[0m\n\nTimeSeriesContainer\n===================\nComponents with time series data: 142\nTotal StaticTimeSeries: 182\nTotal Forecasts: 182\nResolution: 60 minutes\nFirst initial time: 2020-01-01T00:00:00\nLast initial time: 2020-01-01T00:00:00\nHorizon: 24\nInterval: 0 minutes\nForecast window count: 1\n", "text/html": [ "
Base Power: 100.0
\n", "Num components: 525
\n", "15 rows × 3 columns
ConcreteType | SuperTypes | Count | |
---|---|---|---|
String | String | Int64 | |
1 | Arc | Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 109 |
2 | Area | AggregationTopology <: Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 3 |
3 | Bus | Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 73 |
4 | GenericBattery | Storage <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 1 |
5 | HVDCLine | DCBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 1 |
6 | HydroDispatch | HydroGen <: Generator <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 20 |
7 | Line | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 105 |
8 | LoadZone | AggregationTopology <: Topology <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 3 |
9 | PowerLoad | StaticLoad <: ElectricLoad <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 51 |
10 | RenewableDispatch | RenewableGen <: Generator <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 30 |
11 | RenewableFix | RenewableGen <: Generator <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 31 |
12 | TapTransformer | ACBranch <: Branch <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 15 |
13 | ThermalMultiStart | ThermalGen <: Generator <: StaticInjection <: Device <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 76 |
14 | VariableReserve{PowerSystems.ReserveDown} | Reserve{PowerSystems.ReserveDown} <: Service <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 2 |
15 | VariableReserve{PowerSystems.ReserveUp} | Reserve{PowerSystems.ReserveUp} <: Service <: Component <: InfrastructureSystemsComponent <: InfrastructureSystemsType <: Any | 5 |
Components with time series data: 142
\n", "Total StaticTimeSeries: 182
\n", "Total Forecasts: 182
\n", "Resolution: 60 minutes
\n", "First initial time: 2020-01-01T00:00:00
\n", "Last initial time: 2020-01-01T00:00:00
\n", "Horizon: 24
\n", "Interval: 0 minutes
\n", "Forecast window count: 1
\n" ] }, "metadata": {}, "execution_count": 4 } ], "cell_type": "code", "source": [ "sys = System(rawsys; time_series_resolution = Dates.Hour(1));\n", "horizon = 24;\n", "interval = Dates.Hour(24);\n", "transform_single_time_series!(sys, horizon, interval);\n", "sys" ], "metadata": {}, "execution_count": 4 }, { "cell_type": "markdown", "source": [ "---\n", "\n", "*This notebook was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*" ], "metadata": {} } ], "nbformat_minor": 3, "metadata": { "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.6.0" }, "kernelspec": { "name": "julia-1.6", "display_name": "Julia 1.6.0", "language": "julia" } }, "nbformat": 4 }