Skip to content

Commit

Permalink
Merge pull request #832 from blue-marble/develop
Browse files Browse the repository at this point in the history
GridPath v0.11.0
  • Loading branch information
anamileva authored Oct 19, 2021
2 parents 8cc7813 + b73fb83 commit 66560ab
Show file tree
Hide file tree
Showing 402 changed files with 5,726 additions and 822 deletions.
10 changes: 10 additions & 0 deletions db/create_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def load_data(conn, omit_data, custom_units):
:param custom_units: Boolean, True if user-specified units
:return:
"""
# TODO: refactor this
if not omit_data:
# General Model Data
load_mod_months(conn=conn)
Expand All @@ -96,6 +97,7 @@ def load_data(conn, omit_data, custom_units):
load_mod_operational_types(conn=conn)
load_mod_reserve_types(conn=conn)
load_mod_tx_capacity_types(conn=conn)
load_mod_tx_availability_types(conn=conn)
load_mod_tx_operational_types(conn=conn)
load_mod_prm_types(conn=conn)
load_mod_capacity_and_operational_type_invalid_combos(conn=conn)
Expand Down Expand Up @@ -168,6 +170,14 @@ def load_mod_tx_capacity_types(conn):
load_aux_data(conn=conn, filename="mod_tx_capacity_types.csv", sql=sql)


def load_mod_tx_availability_types(conn):
sql = """
INSERT INTO mod_tx_availability_types
(availability_type, description)
VALUES (?, ?);"""
load_aux_data(conn=conn, filename="mod_tx_availability_types.csv", sql=sql)


def load_mod_tx_operational_types(conn):
sql = """
INSERT INTO mod_tx_operational_types
Expand Down
202 changes: 103 additions & 99 deletions db/csvs_test_examples/csv_data_master.csv

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
project,period,carbon_tax_allowance_tco2_per_mwh
Coal,2020,10
Gas_CCGT,2020,5
Gas_CT,2020,5
Gas_CCGT_new,2020,5
Gas_CT_new,2020,5
Coal,2030,5
Gas_CCGT,2030,3
Gas_CT,2030,3
Gas_CCGT_new,2030,3
Gas_CT_new,2030,3
181 changes: 92 additions & 89 deletions db/csvs_test_examples/scenarios.csv

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions db/csvs_test_examples/system_load/load_zones/1_1zone.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
load_zone,allow_overgeneration,overgeneration_penalty_per_mw,allow_unserved_energy,unserved_energy_penalty_per_mw
Zone1,1,99999999,1,99999999
load_zone,allow_overgeneration,overgeneration_penalty_per_mw,allow_unserved_energy,unserved_energy_penalty_per_mwh,max_unserved_load_penalty_per_mw,export_penalty_cost_per_mwh
Zone1,1,99999999,1,99999999,0,0
6 changes: 3 additions & 3 deletions db/csvs_test_examples/system_load/load_zones/2_2zones.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
load_zone,allow_overgeneration,overgeneration_penalty_per_mw,allow_unserved_energy,unserved_energy_penalty_per_mw
Zone1,1,99999999,1,99999999
Zone2,1,99999999,1,99999999
load_zone,allow_overgeneration,overgeneration_penalty_per_mw,allow_unserved_energy,unserved_energy_penalty_per_mwh,max_unserved_load_penalty_per_mw,export_penalty_cost_per_mwh
Zone1,1,99999999,1,99999999,0,0
Zone2,1,99999999,1,99999999,0,0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
load_zone,allow_overgeneration,overgeneration_penalty_per_mw,allow_unserved_energy,unserved_energy_penalty_per_mw
Zone1,0,99999999,1,99999999
load_zone,allow_overgeneration,overgeneration_penalty_per_mw,allow_unserved_energy,unserved_energy_penalty_per_mwh,max_unserved_load_penalty_per_mw,export_penalty_cost_per_mwh
Zone1,0,99999999,1,99999999,0,0
8 changes: 4 additions & 4 deletions db/csvs_test_examples/system_load/load_zones/4_3zones.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load_zone,allow_overgeneration,overgeneration_penalty_per_mw,allow_unserved_energy,unserved_energy_penalty_per_mw
Zone1,1,99999999,1,99999999
Zone2,1,99999999,1,99999999
Zone3,1,99999999,1,99999999
load_zone,allow_overgeneration,overgeneration_penalty_per_mw,allow_unserved_energy,unserved_energy_penalty_per_mwh,max_unserved_load_penalty_per_mw,export_penalty_cost_per_mwh
Zone1,1,99999999,1,99999999,0,0
Zone2,1,99999999,1,99999999,0,0
Zone3,1,99999999,1,99999999,0,0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load_zone,allow_overgeneration,overgeneration_penalty_per_mw,allow_unserved_energy,unserved_energy_penalty_per_mwh,max_unserved_load_penalty_per_mw,export_penalty_cost_per_mwh
Zone1,1,99999999,1,99999999,0,200
Zone2,1,99999999,1,99999999,0,200
5 changes: 5 additions & 0 deletions db/csvs_test_examples/transmission/availability/1_base.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
transmission_line,availability_type,exogenous_availability_scenario_id,endogenous_availability_scenario_id
Tx1,exogenous,,
Tx2,exogenous,,
Tx3,exogenous,,
Tx_new,exogenous,,
5 changes: 5 additions & 0 deletions db/csvs_test_examples/transmission/availability/2_halfTx1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
transmission_line,availability_type,exogenous_availability_scenario_id,endogenous_availability_scenario_id
Tx1,exogenous,1,
Tx2,exogenous,,
Tx3,exogenous,,
Tx_new,exogenous,,
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
transmission_line,availability_type,exogenous_availability_scenario_id,endogenous_availability_scenario_id
Tx1,exogenous_monthly,1,
Tx2,exogenous,,
Tx3,exogenous,,
Tx_new,exogenous,,
58 changes: 58 additions & 0 deletions db/csvs_test_examples/transmission/availability/doc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2016-2020 Blue Marble Analytics LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
**Relevant tables:**
+--------------------------------+-----------------------------------------------+
|:code:`scenarios` table column |:code:`transmission_availability_scenario_id` |
+--------------------------------+-----------------------------------------------+
|:code:`scenarios` table feature |N/A |
+--------------------------------+-----------------------------------------------+
|:code:`subscenario_` table |:code:`subscenarios_transmission_availability` |
+--------------------------------+-----------------------------------------------+
|:code:`input_` tables |:code:`inputs_transmission_availability` |
+--------------------------------+-----------------------------------------------+
All transmission lins in a GridPath scenario must be a assigned an
*availability type*, which determines whether their capacity is operational
in each timepoint in which the capacity exists. All implemented availability types are
listed in the :code:`mod_tx_availability_types` table.
Each line's availability type are given in the
:code:`inputs_transmission_availability`. The availability types currently
implemented include :code:`exogenous` (availability is determined outside of
a GridPath model via the data fed into it) and two endogenous types:
:code:`binary` and :code:`continuous` that require certain inputs that
determine how availability is constrained in the GridPath model. See the
:ref:`transmission-availability-type-section-ref` section for more info. In
addition to the transmission availability types, the
:code:`inputs_transmission_availability` table contains the information for
how to find any additional data needed to determine transmission availability with
the :code:`exogenous_availability_scenario_id` and
:code:`endogenous_availability_scenario` columns for the endogenous and
exogenous types respectively. The IDs in the former column are linked to the
data in the :code:`inputs_transmission_availability_exogenous` table and in the
latter column to the :code:`inputs_transmission_availability_endogenous` table.
For transmissions of the :code:`exogenous` availability type, if the value is in the
:code:`exogenous_availability_scenario_id` column is NULL, no availability
capacity derate is applied by GridPath. For transmissions of a :code:`binary` of
:code:`continuous` availability type, a value in the
:code:`endogenous_availability_scenario_id` is required.
"""

if __name__ == "__main__":
print(__doc__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
stage_id,timepoint,month,availability_derate
1,20200101,0,0.5
1,20200102,0,0.5
1,20300101,0,0.5
1,20300102,0,0.5
1 ,0,1,0.5
40 changes: 40 additions & 0 deletions db/csvs_test_examples/transmission/availability/exogenous/doc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2016-2020 Blue Marble Analytics LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
**Relevant tables:**
+---------------------------+---------------------------------------------------------+
|:code:`subscenario_` table |:code:`subscenarios_transmission_availability_exogenous` |
+---------------------------+---------------------------------------------------------+
|:code:`input_` table |:code:`inputs_transmission_availability_exogenous` |
+---------------------------+---------------------------------------------------------+
Within each :code:`transmission_availability_scenario_id`, a transmission line
of the :code:`exogenous` *availability type* can point to a particular
:code:`exogenous_availability_scenario_id`, the data for which is contained
in the :code:`inputs_transmission_availability_exogenous` table. The names and
descriptions of each :code:`transmission` and
:code:`exogenous_availability_scenario_id` combination are in the
:code:`subscenarios_transmission_availability_exogenous` table. The
availability derate for each combination is defined by stage and timepoint
or month (if using timepoint-level availability, set the month to 0; if
using monthly availability, set the timpoint to 0), and must be greater than
or equal to 0 (0=full derate). Values more than 1 are allowed.
"""

if __name__ == "__main__":
print(__doc__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
transmission_line,period,min_cumulative_new_build_mw,max_cumulative_new_build_mw
Tx_new,2020,0,30
Tx_new,2030,0,30
3 changes: 3 additions & 0 deletions db/data/mod_tx_availability_types.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
availability_type,description
exogenous,
exogenous_monthly,
Loading

0 comments on commit 66560ab

Please sign in to comment.