diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 447b95a8dd..047ca0c5cb 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -52,7 +52,7 @@ repos:
- id: rm-unneeded-f-str
- repo: https://github.com/pre-commit/mirrors-prettier
- rev: v3.0.1
+ rev: v3.0.2
hooks:
- id: prettier
types_or: [yaml]
diff --git a/README.rst b/README.rst
index d1443dfa36..df5edcda3e 100644
--- a/README.rst
+++ b/README.rst
@@ -64,18 +64,18 @@ What data is available?
PUDL currently integrates data from:
-* `EIA Form 860 `__: 2001-2021
-* `EIA Form 860m `__: 2022-06
-* `EIA Form 861 `__: 2001-2021
-* `EIA Form 923 `__: 2001-2021
-* `EPA Continuous Emissions Monitoring System (CEMS) `__: 1995-2021
+* `EIA Form 860 `__: 2001-2022
+* `EIA Form 860m `__: 2023-06
+* `EIA Form 861 `__: 2001-2022
+* `EIA Form 923 `__: 2001-2022
+* `EPA Continuous Emissions Monitoring System (CEMS) `__: 1995-2022
* `FERC Form 1 `__: 1994-2021
* `FERC Form 714 `__: 2006-2020
* `US Census Demographic Profile 1 Geodatabase `__: 2010
Thanks to support from the `Alfred P. Sloan Foundation Energy & Environment
Program `__, from
-2021 to 2023 we will be integrating the following data as well:
+2021 to 2024 we will be integrating the following data as well:
* `EIA Form 176 `__
(The Annual Report of Natural Gas Supply and Disposition)
@@ -124,7 +124,7 @@ Want access to all the published data in bulk? If you're familiar with Python
and `Jupyter Notebooks `__ and are willing to install Docker you
can:
-* `Download a PUDL data release `__ from
+* `Download a PUDL data release `__ from
CERN's `Zenodo `__ archiving service.
* `Install Docker `__
* Run the archived image using ``docker-compose up``
diff --git a/devtools/ferc1-eia-glue/training_data/create_FERC1-EIA_manual_mapping_spreadsheets.ipynb b/devtools/ferc1-eia-glue/training_data/create_FERC1-EIA_manual_mapping_spreadsheets.ipynb
index a27bbd394d..c45e2e008f 100644
--- a/devtools/ferc1-eia-glue/training_data/create_FERC1-EIA_manual_mapping_spreadsheets.ipynb
+++ b/devtools/ferc1-eia-glue/training_data/create_FERC1-EIA_manual_mapping_spreadsheets.ipynb
@@ -42,6 +42,7 @@
"\n",
"# Local libraries\n",
"import pudl\n",
+ "from pudl.workspace.setup import PudlPaths\n",
"from pudl.analysis.ferc1_eia_train import *"
]
},
@@ -54,8 +55,7 @@
},
"outputs": [],
"source": [
- "pudl_settings = pudl.workspace.setup.get_defaults()\n",
- "pudl_engine = sa.create_engine(pudl_settings['pudl_db'])\n",
+ "pudl_engine = sa.create_engine(PudlPaths().pudl_db)\n",
"pudl_out = pudl.output.pudltabl.PudlTabl(pudl_engine, freq='AS', fill_net_gen=True)"
]
},
diff --git a/devtools/ferc1-eia-glue/training_data/validate_and_integrate_FERC1-EIA_manually_mapped_records.ipynb b/devtools/ferc1-eia-glue/training_data/validate_and_integrate_FERC1-EIA_manually_mapped_records.ipynb
index 171e01512b..22149567ec 100644
--- a/devtools/ferc1-eia-glue/training_data/validate_and_integrate_FERC1-EIA_manually_mapped_records.ipynb
+++ b/devtools/ferc1-eia-glue/training_data/validate_and_integrate_FERC1-EIA_manually_mapped_records.ipynb
@@ -43,6 +43,7 @@
"\n",
"# Local libraries\n",
"import pudl\n",
+ "from pudl.workspace.setup import PudlPaths\n",
"from pudl.analysis.ferc1_eia_train import *"
]
},
@@ -55,8 +56,7 @@
},
"outputs": [],
"source": [
- "pudl_settings = pudl.workspace.setup.get_defaults()\n",
- "pudl_engine = sa.create_engine(pudl_settings['pudl_db'])\n",
+ "pudl_engine = sa.create_engine(PudlPaths().pudl_db)\n",
"pudl_out = pudl.output.pudltabl.PudlTabl(pudl_engine, freq='AS', fill_net_gen=True)"
]
},
diff --git a/docs/data_access.rst b/docs/data_access.rst
index 26b7c92545..92befc2829 100644
--- a/docs/data_access.rst
+++ b/docs/data_access.rst
@@ -83,7 +83,7 @@ AWS CLI, or programmatically via the S3 API. They can also be downloaded directl
HTTPS using the following links:
* `PUDL SQLite DB `__
-* `EPA CEMS Hourly Emissions Parquet (1995-2021) `__
+* `EPA CEMS Hourly Emissions Parquet (1995-2022) `__
* `Census DP1 SQLite DB (2010) `__
* Raw FERC Form 1:
diff --git a/docs/dev/datastore.rst b/docs/dev/datastore.rst
index e9411537f6..31e1e6f5b0 100644
--- a/docs/dev/datastore.rst
+++ b/docs/dev/datastore.rst
@@ -38,15 +38,17 @@ For more detailed usage information, see:
$ pudl_datastore --help
The downloaded data will be used by the script to populate a datastore under
-the ``data`` directory in your workspace, organized by data source, form, and
-date::
+your ``$PUDL_INPUT`` directory, organized by data source, form, and DOI::
data/censusdp1tract/
data/eia860/
+ data/eia860m/
data/eia861/
data/eia923/
data/epacems/
data/ferc1/
+ data/ferc2/
+ data/ferc60/
data/ferc714/
If the download fails to complete successfully, the script can be run repeatedly until
@@ -64,28 +66,13 @@ archival and versioning of datasets. See the `documentation
for information on adding datasets to the datastore.
-Prepare the Datastore
-^^^^^^^^^^^^^^^^^^^^^
+Tell PUDL about the archive
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
-If you have used pudl-archiver to prepare a Zenodo archive as above, you
-can add support for your archive to the datastore by adding the DOI to
-pudl.workspace.datastore.DOI, under "sandbox" or "production" as appropriate.
-
-If you want to prepare an archive for the datastore separately, the following
-are required.
-
-#. The root path must contain a ``datapackage.json`` file that conforms to the
-`frictionless datapackage spec `__
-#. Each listed resource among the ``datapackage.json`` resources must include:
-
- * ``path`` containing the zenodo download url for the specific file.
- * ``remote_url`` with the same url as the ``path``
- * ``name`` of the file
- * ``hash`` with the md5 hash of the file
- * ``parts`` a set of key / value pairs defining additional attributes that
- can be used to select a subset of the whole datapackage. For example, the
- ``epacems`` dataset is partitioned by year and state, and
- ``"parts": {"year": 2010, "state": "ca"}`` would indicate that the
- resource contains data for the state of California in the year 2010.
- Unpartitioned datasets like the ``ferc714`` which includes all years in
- a single file, would have an empty ``"parts": {}``
+Once you have used pudl-archiver to prepare a Zenodo archive as above, you
+can make the PUDL Datastore aware of it by updating the appropriate DOI in
+:class:`pudl.workspace.datastore.ZenodoFetcher`. DOIs can refer to resources from the
+`Zenodo sandbox server `__ for archives that are still in
+testing or development (sandbox DOIs have a prefix of ``10.5072``), or the
+`Zenodo production server `__ server if the archive is ready for
+public use (production DOIs hae a prefix of ``10.5281``).
diff --git a/docs/dev/testing.rst b/docs/dev/testing.rst
index 79439e468f..679074661f 100644
--- a/docs/dev/testing.rst
+++ b/docs/dev/testing.rst
@@ -304,7 +304,6 @@ You can always check to see what custom flags exist by running
Path to a non-standard ETL settings file to use.
--gcs-cache-path=GCS_CACHE_PATH
If set, use this GCS path as a datastore cache layer.
- --sandbox Use raw inputs from the Zenodo sandbox server.
The main flexibility that these custom options provide is in selecting where
the raw input data comes from and what data the tests should be run
diff --git a/docs/release_notes.rst b/docs/release_notes.rst
index bd6a802217..48207381f3 100644
--- a/docs/release_notes.rst
+++ b/docs/release_notes.rst
@@ -71,6 +71,8 @@ Data Coverage
* Updated :doc:`data_sources/eia860` to include early release data from 2022.
* Updated :doc:`data_sources/eia923` to include early release data from 2022.
+* Updated :doc:`data_sources/epacems` to switch from the old FTP server to the new
+ CAMPD API, and to include 2022 data.
* New :ref:`epacamd_eia` crosswalk version v0.3, see issue :issue:`2317` and PR
:pr:`2316`. EPA's updates add manual matches and exclusions focusing on operating
units with a generator ID as of 2018.
diff --git a/migrations/env.py b/migrations/env.py
index 19ec0dfbfd..f99a0b3e29 100644
--- a/migrations/env.py
+++ b/migrations/env.py
@@ -5,7 +5,7 @@
from sqlalchemy import engine_from_config, pool
from pudl.metadata.classes import Package
-from pudl.workspace.setup import get_defaults
+from pudl.workspace.setup import PudlPaths
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
@@ -28,7 +28,7 @@
# my_important_option = config.get_main_option("my_important_option")
# ... etc.
-db_location = get_defaults()["pudl_db"]
+db_location = PudlPaths().pudl_db
logger.info(f"alembic config.sqlalchemy.url: {db_location}")
config.set_main_option("sqlalchemy.url", db_location)
diff --git a/migrations/versions/3c458b36094e_start_over_with_new_pk_in_emissions_.py b/migrations/versions/16948340e558_regenerate_migrations_to_name_all_.py
similarity index 79%
rename from migrations/versions/3c458b36094e_start_over_with_new_pk_in_emissions_.py
rename to migrations/versions/16948340e558_regenerate_migrations_to_name_all_.py
index 01a3d2762a..1d2f5bb1a0 100644
--- a/migrations/versions/3c458b36094e_start_over_with_new_pk_in_emissions_.py
+++ b/migrations/versions/16948340e558_regenerate_migrations_to_name_all_.py
@@ -1,8 +1,8 @@
-"""Start over with new PK in emissions_control_equipment_types_eia
+"""Regenerate migrations to name all unnamed constraints.
-Revision ID: 3c458b36094e
+Revision ID: 16948340e558
Revises:
-Create Date: 2023-06-12 15:32:46.636042
+Create Date: 2023-08-17 12:05:15.020719
"""
from alembic import op
@@ -10,7 +10,7 @@
from sqlalchemy.dialects import sqlite
# revision identifiers, used by Alembic.
-revision = '3c458b36094e'
+revision = '16948340e558'
down_revision = None
branch_labels = None
depends_on = None
@@ -22,75 +22,99 @@ def upgrade() -> None:
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_averaging_periods_eia'))
)
op.create_table('balancing_authorities_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_balancing_authorities_eia'))
)
op.create_table('balancing_authority_assn_eia861',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
sa.Column('balancing_authority_id_eia', sa.Integer(), nullable=False, comment='EIA balancing authority ID. This is often (but not always!) the same as the utility ID associated with the same legal entity.'),
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
sa.Column('state', sa.Text(), nullable=False, comment='Two letter US state abbreviation.'),
- sa.PrimaryKeyConstraint('report_date', 'balancing_authority_id_eia', 'utility_id_eia', 'state')
+ sa.PrimaryKeyConstraint('report_date', 'balancing_authority_id_eia', 'utility_id_eia', 'state', name=op.f('pk_balancing_authority_assn_eia861'))
)
op.create_table('balancing_authority_eia861',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
sa.Column('balancing_authority_id_eia', sa.Integer(), nullable=False, comment='EIA balancing authority ID. This is often (but not always!) the same as the utility ID associated with the same legal entity.'),
sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
sa.Column('balancing_authority_name_eia', sa.Text(), nullable=True, comment='Name of the balancing authority.'),
- sa.PrimaryKeyConstraint('report_date', 'balancing_authority_id_eia')
+ sa.PrimaryKeyConstraint('report_date', 'balancing_authority_id_eia', name=op.f('pk_balancing_authority_eia861'))
)
op.create_table('boiler_generator_assn_types_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_boiler_generator_assn_types_eia'))
)
op.create_table('boiler_status_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_boiler_status_eia'))
)
op.create_table('boiler_types_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_boiler_types_eia'))
)
op.create_table('coalmine_types_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_coalmine_types_eia'))
+ )
+ op.create_table('compiled_geometry_balancing_authority_eia861',
+ sa.Column('county_id_fips', sa.Text(), nullable=False, comment='County ID from the Federal Information Processing Standard Publication 6-4.'),
+ sa.Column('county_name_census', sa.Text(), nullable=True, comment='County name as specified in Census DP1 Data.'),
+ sa.Column('population', sa.Float(), nullable=True, comment='County population, sourced from Census DP1 data.'),
+ sa.Column('area_km2', sa.Float(), nullable=True, comment='County area in km2.'),
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('balancing_authority_id_eia', sa.Integer(), nullable=False, comment='EIA balancing authority ID. This is often (but not always!) the same as the utility ID associated with the same legal entity.'),
+ sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
+ sa.Column('county', sa.Text(), nullable=False, comment='County name.'),
+ sa.Column('state_id_fips', sa.Text(), nullable=True, comment='Two digit state FIPS code.'),
+ sa.PrimaryKeyConstraint('balancing_authority_id_eia', 'report_date', 'county_id_fips', 'county', name=op.f('pk_compiled_geometry_balancing_authority_eia861'))
+ )
+ op.create_table('compiled_geometry_utility_eia861',
+ sa.Column('county_id_fips', sa.Text(), nullable=False, comment='County ID from the Federal Information Processing Standard Publication 6-4.'),
+ sa.Column('county_name_census', sa.Text(), nullable=True, comment='County name as specified in Census DP1 Data.'),
+ sa.Column('population', sa.Float(), nullable=True, comment='County population, sourced from Census DP1 data.'),
+ sa.Column('area_km2', sa.Float(), nullable=True, comment='County area in km2.'),
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
+ sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
+ sa.Column('county', sa.Text(), nullable=True, comment='County name.'),
+ sa.Column('state_id_fips', sa.Text(), nullable=True, comment='Two digit state FIPS code.'),
+ sa.PrimaryKeyConstraint('utility_id_eia', 'report_date', 'county_id_fips', name=op.f('pk_compiled_geometry_utility_eia861'))
)
op.create_table('contract_types_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_contract_types_eia'))
)
op.create_table('data_maturities',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_data_maturities'))
)
op.create_table('datasources',
sa.Column('datasource', sa.Enum('censusdp1tract', 'eia176', 'eia860', 'eia860m', 'eia861', 'eia923', 'eia_bulk_elec', 'eiawater', 'epacems', 'epacamd_eia', 'ferc1', 'ferc2', 'ferc6', 'ferc60', 'ferc714', 'ferceqr', 'mshamines', 'phmsagas', 'pudl'), nullable=False, comment='Code identifying a dataset available within PUDL.'),
sa.Column('partitions', sa.Text(), nullable=True, comment='The data parititions used to generate this instance of the database.'),
sa.Column('doi', sa.Text(), nullable=True, comment='Unique digitial object identifier of Zenodo archive.'),
sa.Column('pudl_version', sa.Text(), nullable=True, comment='The version of PUDL used to generate this database.'),
- sa.PrimaryKeyConstraint('datasource')
+ sa.PrimaryKeyConstraint('datasource', name=op.f('pk_datasources'))
)
op.create_table('emission_control_equipment_types_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_emission_control_equipment_types_eia'))
)
op.create_table('energy_sources_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
@@ -103,13 +127,13 @@ def upgrade() -> None:
sa.Column('fuel_phase', sa.Enum('gas', 'liquid', 'solid'), nullable=True, comment='Physical phase of matter of the fuel.'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_energy_sources_eia'))
)
op.create_table('environmental_equipment_manufacturers_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_environmental_equipment_manufacturers_eia'))
)
op.create_table('epacamd_eia_subplant_ids',
sa.Column('plant_id_eia', sa.Integer(), nullable=True, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
@@ -122,13 +146,13 @@ def upgrade() -> None:
op.create_table('ferc_accounts',
sa.Column('ferc_account_id', sa.Text(), nullable=False, comment="Account identifier from FERC's Uniform System of Accounts for Electric Plant. Includes higher level labeled categories."),
sa.Column('ferc_account_description', sa.Text(), nullable=True),
- sa.PrimaryKeyConstraint('ferc_account_id')
+ sa.PrimaryKeyConstraint('ferc_account_id', name=op.f('pk_ferc_accounts'))
)
op.create_table('firing_types_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_firing_types_eia'))
)
op.create_table('fuel_receipts_costs_aggs_eia',
sa.Column('fuel_agg', sa.Text(), nullable=False, comment='Category of fuel aggregation in EIA bulk electricity data.'),
@@ -138,67 +162,67 @@ def upgrade() -> None:
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
sa.Column('fuel_received_mmbtu', sa.Float(), nullable=True, comment='Aggregated fuel receipts, in MMBtu, in EIA bulk electricity data.'),
sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
- sa.PrimaryKeyConstraint('fuel_agg', 'geo_agg', 'sector_agg', 'temporal_agg', 'report_date')
+ sa.PrimaryKeyConstraint('fuel_agg', 'geo_agg', 'sector_agg', 'temporal_agg', 'report_date', name=op.f('pk_fuel_receipts_costs_aggs_eia'))
)
op.create_table('fuel_transportation_modes_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_fuel_transportation_modes_eia'))
)
op.create_table('fuel_types_aer_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_fuel_types_aer_eia'))
)
op.create_table('mercury_compliance_strategies_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_mercury_compliance_strategies_eia'))
)
op.create_table('momentary_interruptions_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_momentary_interruptions_eia'))
)
op.create_table('nox_compliance_strategies_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_nox_compliance_strategies_eia'))
)
op.create_table('nox_control_status_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_nox_control_status_eia'))
)
op.create_table('nox_units_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_nox_units_eia'))
)
op.create_table('operational_status_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
sa.Column('operational_status', sa.Text(), nullable=True, comment='The operating status of the asset. For generators this is based on which tab the generator was listed in in EIA 860.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_operational_status_eia'))
)
op.create_table('particulate_compliance_strategies_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_particulate_compliance_strategies_eia'))
)
op.create_table('particulate_units_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_particulate_units_eia'))
)
op.create_table('plants_entity_eia',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
@@ -211,102 +235,109 @@ def upgrade() -> None:
sa.Column('street_address', sa.Text(), nullable=True),
sa.Column('zip_code', sa.Text(), nullable=True, comment='Five digit US Zip Code.'),
sa.Column('timezone', sa.Enum('Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Timbuktu', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/ComodRivadavia', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Atka', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Buenos_Aires', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Catamarca', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Coral_Harbour', 'America/Cordoba', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Ensenada', 'America/Fort_Nelson', 'America/Fort_Wayne', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indianapolis', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Jujuy', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Knox_IN', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Louisville', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Mendoza', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montreal', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Acre', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Rosario', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Shiprock', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Virgin', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Ashkhabad', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Calcutta', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Chongqing', 'Asia/Chungking', 'Asia/Colombo', 'Asia/Dacca', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Harbin', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Istanbul', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kashgar', 'Asia/Kathmandu', 'Asia/Katmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macao', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Saigon', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tel_Aviv', 'Asia/Thimbu', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ujung_Pandang', 'Asia/Ulaanbaatar', 'Asia/Ulan_Bator', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faeroe', 'Atlantic/Faroe', 'Atlantic/Jan_Mayen', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/ACT', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Canberra', 'Australia/Currie', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/LHI', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/NSW', 'Australia/North', 'Australia/Perth', 'Australia/Queensland', 'Australia/South', 'Australia/Sydney', 'Australia/Tasmania', 'Australia/Victoria', 'Australia/West', 'Australia/Yancowinna', 'Brazil/Acre', 'Brazil/DeNoronha', 'Brazil/East', 'Brazil/West', 'CET', 'CST6CDT', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Canada/Saskatchewan', 'Canada/Yukon', 'Chile/Continental', 'Chile/EasterIsland', 'Cuba', 'EET', 'EST', 'EST5EDT', 'Egypt', 'Eire', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT+1', 'Etc/GMT+10', 'Etc/GMT+11', 'Etc/GMT+12', 'Etc/GMT+2', 'Etc/GMT+3', 'Etc/GMT+4', 'Etc/GMT+5', 'Etc/GMT+6', 'Etc/GMT+7', 'Etc/GMT+8', 'Etc/GMT+9', 'Etc/GMT-0', 'Etc/GMT-1', 'Etc/GMT-10', 'Etc/GMT-11', 'Etc/GMT-12', 'Etc/GMT-13', 'Etc/GMT-14', 'Etc/GMT-2', 'Etc/GMT-3', 'Etc/GMT-4', 'Etc/GMT-5', 'Etc/GMT-6', 'Etc/GMT-7', 'Etc/GMT-8', 'Etc/GMT-9', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/UTC', 'Etc/Universal', 'Etc/Zulu', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belfast', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Kirov', 'Europe/Kyiv', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Nicosia', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Tiraspol', 'Europe/Ulyanovsk', 'Europe/Uzhgorod', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'GB', 'GB-Eire', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'HST', 'Hongkong', 'Iceland', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Iran', 'Israel', 'Jamaica', 'Japan', 'Kwajalein', 'Libya', 'MET', 'MST', 'MST7MDT', 'Mexico/BajaNorte', 'Mexico/BajaSur', 'Mexico/General', 'NZ', 'NZ-CHAT', 'Navajo', 'PRC', 'PST8PDT', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Johnston', 'Pacific/Kanton', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Ponape', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Samoa', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Truk', 'Pacific/Wake', 'Pacific/Wallis', 'Pacific/Yap', 'Poland', 'Portugal', 'ROC', 'ROK', 'Singapore', 'Turkey', 'UCT', 'US/Alaska', 'US/Aleutian', 'US/Arizona', 'US/Central', 'US/East-Indiana', 'US/Eastern', 'US/Hawaii', 'US/Indiana-Starke', 'US/Michigan', 'US/Mountain', 'US/Pacific', 'US/Samoa', 'UTC', 'Universal', 'W-SU', 'WET', 'Zulu'), nullable=True, comment='IANA timezone name'),
- sa.PrimaryKeyConstraint('plant_id_eia')
+ sa.PrimaryKeyConstraint('plant_id_eia', name=op.f('pk_plants_entity_eia'))
)
op.create_table('plants_pudl',
sa.Column('plant_id_pudl', sa.Integer(), nullable=False, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
sa.Column('plant_name_pudl', sa.Text(), nullable=True, comment='Plant name, chosen arbitrarily from the several possible plant names available in the plant matching process. Included for human readability only.'),
- sa.PrimaryKeyConstraint('plant_id_pudl')
+ sa.PrimaryKeyConstraint('plant_id_pudl', name=op.f('pk_plants_pudl'))
)
op.create_table('political_subdivisions',
sa.Column('country_code', sa.Enum('USA', 'CAN'), nullable=False, comment='Three letter ISO-3166 country code (e.g. USA or CAN).'),
sa.Column('country_name', sa.Text(), nullable=True, comment='Full country name (e.g. United States of America).'),
- sa.Column('subdivision_code', sa.Enum('VA', 'VI', 'SK', 'PR', 'MT', 'DC', 'VT', 'KY', 'NY', 'KS', 'ME', 'ON', 'WY', 'NU', 'MN', 'WV', 'AL', 'LA', 'MP', 'QC', 'SC', 'SD', 'NE', 'TN', 'NM', 'YT', 'OH', 'AB', 'MO', 'NC', 'NS', 'CA', 'MD', 'NB', 'FL', 'BC', 'ID', 'IN', 'NL', 'GA', 'OK', 'UT', 'IA', 'MI', 'NH', 'NV', 'IL', 'NJ', 'AZ', 'MS', 'PE', 'MA', 'AK', 'CO', 'RI', 'GU', 'ND', 'PA', 'TX', 'HI', 'WI', 'NT', 'OR', 'DE', 'WA', 'MB', 'AS', 'AR', 'CT'), nullable=False, comment='Two-letter ISO-3166 political subdivision code (e.g. US state or Canadian provice abbreviations like CA or AB).'),
+ sa.Column('subdivision_code', sa.Enum('GU', 'WI', 'AZ', 'RI', 'MO', 'SC', 'KS', 'PE', 'UT', 'PA', 'ME', 'NH', 'SD', 'LA', 'NJ', 'DC', 'FL', 'IL', 'MS', 'ND', 'BC', 'NL', 'NU', 'OH', 'CT', 'NC', 'VI', 'SK', 'NY', 'NV', 'NE', 'IA', 'AK', 'HI', 'ON', 'TN', 'VA', 'AR', 'DE', 'AS', 'NS', 'GA', 'TX', 'MA', 'OR', 'QC', 'MT', 'WV', 'IN', 'MP', 'MB', 'MI', 'KY', 'ID', 'WY', 'NM', 'NB', 'AL', 'MD', 'AB', 'WA', 'YT', 'CA', 'CO', 'MN', 'OK', 'PR', 'NT', 'VT'), nullable=False, comment='Two-letter ISO-3166 political subdivision code (e.g. US state or Canadian provice abbreviations like CA or AB).'),
sa.Column('subdivision_name', sa.Text(), nullable=True, comment='Full name of political subdivision (e.g. US state or Canadian province names like California or Alberta.'),
sa.Column('subdivision_type', sa.Text(), nullable=True, comment='ISO-3166 political subdivision type. E.g. state, province, outlying_area.'),
sa.Column('timezone_approx', sa.Enum('Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Timbuktu', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/ComodRivadavia', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Atka', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Buenos_Aires', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Catamarca', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Coral_Harbour', 'America/Cordoba', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Ensenada', 'America/Fort_Nelson', 'America/Fort_Wayne', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indianapolis', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Jujuy', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Knox_IN', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Louisville', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Mendoza', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montreal', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Acre', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Rosario', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Shiprock', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Virgin', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Ashkhabad', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Calcutta', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Chongqing', 'Asia/Chungking', 'Asia/Colombo', 'Asia/Dacca', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Harbin', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Istanbul', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kashgar', 'Asia/Kathmandu', 'Asia/Katmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macao', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Saigon', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tel_Aviv', 'Asia/Thimbu', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ujung_Pandang', 'Asia/Ulaanbaatar', 'Asia/Ulan_Bator', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faeroe', 'Atlantic/Faroe', 'Atlantic/Jan_Mayen', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/ACT', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Canberra', 'Australia/Currie', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/LHI', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/NSW', 'Australia/North', 'Australia/Perth', 'Australia/Queensland', 'Australia/South', 'Australia/Sydney', 'Australia/Tasmania', 'Australia/Victoria', 'Australia/West', 'Australia/Yancowinna', 'Brazil/Acre', 'Brazil/DeNoronha', 'Brazil/East', 'Brazil/West', 'CET', 'CST6CDT', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Canada/Saskatchewan', 'Canada/Yukon', 'Chile/Continental', 'Chile/EasterIsland', 'Cuba', 'EET', 'EST', 'EST5EDT', 'Egypt', 'Eire', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT+1', 'Etc/GMT+10', 'Etc/GMT+11', 'Etc/GMT+12', 'Etc/GMT+2', 'Etc/GMT+3', 'Etc/GMT+4', 'Etc/GMT+5', 'Etc/GMT+6', 'Etc/GMT+7', 'Etc/GMT+8', 'Etc/GMT+9', 'Etc/GMT-0', 'Etc/GMT-1', 'Etc/GMT-10', 'Etc/GMT-11', 'Etc/GMT-12', 'Etc/GMT-13', 'Etc/GMT-14', 'Etc/GMT-2', 'Etc/GMT-3', 'Etc/GMT-4', 'Etc/GMT-5', 'Etc/GMT-6', 'Etc/GMT-7', 'Etc/GMT-8', 'Etc/GMT-9', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/UTC', 'Etc/Universal', 'Etc/Zulu', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belfast', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Kirov', 'Europe/Kyiv', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Nicosia', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Tiraspol', 'Europe/Ulyanovsk', 'Europe/Uzhgorod', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'GB', 'GB-Eire', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'HST', 'Hongkong', 'Iceland', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Iran', 'Israel', 'Jamaica', 'Japan', 'Kwajalein', 'Libya', 'MET', 'MST', 'MST7MDT', 'Mexico/BajaNorte', 'Mexico/BajaSur', 'Mexico/General', 'NZ', 'NZ-CHAT', 'Navajo', 'PRC', 'PST8PDT', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Johnston', 'Pacific/Kanton', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Ponape', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Samoa', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Truk', 'Pacific/Wake', 'Pacific/Wallis', 'Pacific/Yap', 'Poland', 'Portugal', 'ROC', 'ROK', 'Singapore', 'Turkey', 'UCT', 'US/Alaska', 'US/Aleutian', 'US/Arizona', 'US/Central', 'US/East-Indiana', 'US/Eastern', 'US/Hawaii', 'US/Indiana-Starke', 'US/Michigan', 'US/Mountain', 'US/Pacific', 'US/Samoa', 'UTC', 'Universal', 'W-SU', 'WET', 'Zulu'), nullable=True, comment='IANA timezone name of the timezone which encompasses the largest portion of the population in the associated geographic area.'),
sa.Column('state_id_fips', sa.Text(), nullable=True, comment='Two digit state FIPS code.'),
sa.Column('division_name_us_census', sa.Text(), nullable=True, comment='Longer human readable name describing the US Census division.'),
- sa.Column('division_code_us_census', sa.Enum('PCN', 'SAT', 'ESC', 'NEW', 'WSC', 'MAT', 'WNC', 'MTN', 'PCC', 'ENC'), nullable=True, comment='Three-letter US Census division code as it appears in the bulk electricity data published by the EIA. Note that EIA splits the Pacific division into distinct contiguous (CA, OR, WA) and non-contiguous (AK, HI) states. For reference see this US Census region and division map: https://www2.census.gov/geo/pdfs/maps-data/maps/reference/us_regdiv.pdf'),
+ sa.Column('division_code_us_census', sa.Enum('PCC', 'NEW', 'ESC', 'MAT', 'WSC', 'SAT', 'WNC', 'PCN', 'ENC', 'MTN'), nullable=True, comment='Three-letter US Census division code as it appears in the bulk electricity data published by the EIA. Note that EIA splits the Pacific division into distinct contiguous (CA, OR, WA) and non-contiguous (AK, HI) states. For reference see this US Census region and division map: https://www2.census.gov/geo/pdfs/maps-data/maps/reference/us_regdiv.pdf'),
sa.Column('region_name_us_census', sa.Text(), nullable=True, comment='Human-readable name of a US Census region.'),
sa.Column('is_epacems_state', sa.Boolean(), nullable=True, comment="Indicates whether the associated state reports data within the EPA's Continuous Emissions Monitoring System."),
- sa.PrimaryKeyConstraint('country_code', 'subdivision_code')
+ sa.PrimaryKeyConstraint('country_code', 'subdivision_code', name=op.f('pk_political_subdivisions'))
)
op.create_table('power_purchase_types_ferc1',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_power_purchase_types_ferc1'))
+ )
+ op.create_table('predicted_state_hourly_demand',
+ sa.Column('state_id_fips', sa.Text(), nullable=False, comment='Two digit state FIPS code.'),
+ sa.Column('utc_datetime', sqlite.DATETIME(), nullable=False),
+ sa.Column('demand_mwh', sa.Float(), nullable=True),
+ sa.Column('scaled_demand_mwh', sa.Float(), nullable=True, comment='Estimated electricity demand scaled by the total sales within a state.'),
+ sa.PrimaryKeyConstraint('state_id_fips', 'utc_datetime', name=op.f('pk_predicted_state_hourly_demand'))
)
op.create_table('prime_movers_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_prime_movers_eia'))
)
op.create_table('regulations_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_regulations_eia'))
)
op.create_table('reporting_frequencies_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_reporting_frequencies_eia'))
)
op.create_table('respondent_id_ferc714',
sa.Column('respondent_id_ferc714', sa.Integer(), nullable=False),
sa.Column('respondent_name_ferc714', sa.Text(), nullable=True),
sa.Column('eia_code', sa.Integer(), nullable=True),
- sa.PrimaryKeyConstraint('respondent_id_ferc714')
+ sa.PrimaryKeyConstraint('respondent_id_ferc714', name=op.f('pk_respondent_id_ferc714'))
)
op.create_table('sector_consolidated_eia',
sa.Column('code', sa.Integer(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_sector_consolidated_eia'))
)
op.create_table('so2_compliance_strategies_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_so2_compliance_strategies_eia'))
)
op.create_table('so2_units_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_so2_units_eia'))
)
op.create_table('steam_plant_types_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_steam_plant_types_eia'))
)
op.create_table('utilities_entity_eia',
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.PrimaryKeyConstraint('utility_id_eia')
+ sa.PrimaryKeyConstraint('utility_id_eia', name=op.f('pk_utilities_entity_eia'))
)
op.create_table('utilities_pudl',
sa.Column('utility_id_pudl', sa.Integer(), nullable=False, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
sa.Column('utility_name_pudl', sa.Text(), nullable=True, comment='Utility name, chosen arbitrarily from the several possible utility names available in the utility matching process. Included for human readability only.'),
- sa.PrimaryKeyConstraint('utility_id_pudl')
+ sa.PrimaryKeyConstraint('utility_id_pudl', name=op.f('pk_utilities_pudl'))
)
op.create_table('utility_assn_eia861',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
sa.Column('state', sa.Text(), nullable=False, comment='Two letter US state abbreviation.'),
- sa.PrimaryKeyConstraint('report_date', 'utility_id_eia', 'state')
+ sa.PrimaryKeyConstraint('report_date', 'utility_id_eia', 'state', name=op.f('pk_utility_assn_eia861'))
)
op.create_table('wet_dry_bottom_eia',
sa.Column('code', sa.Text(), nullable=False, comment='Originally reported short code.'),
sa.Column('label', sa.Text(), nullable=True, comment='Longer human-readable code using snake_case'),
sa.Column('description', sa.Text(), nullable=True, comment='Long human-readable description of the meaning of a code/label.'),
- sa.PrimaryKeyConstraint('code')
+ sa.PrimaryKeyConstraint('code', name=op.f('pk_wet_dry_bottom_eia'))
)
op.create_table('advanced_metering_infrastructure_eia861',
sa.Column('advanced_metering_infrastructure', sa.Integer(), nullable=True),
@@ -325,17 +356,17 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.PrimaryKeyConstraint('balancing_authority_code_eia', 'customer_class', 'report_date', 'state', 'utility_id_eia')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_advanced_metering_infrastructure_eia861_data_maturity_data_maturities')),
+ sa.PrimaryKeyConstraint('balancing_authority_code_eia', 'customer_class', 'report_date', 'state', 'utility_id_eia', name=op.f('pk_advanced_metering_infrastructure_eia861'))
)
op.create_table('boilers_entity_eia',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
sa.Column('boiler_id', sa.Text(), nullable=False, comment='Alphanumeric boiler ID.'),
sa.Column('boiler_manufacturer', sa.Text(), nullable=True, comment='Name of boiler manufacturer.'),
sa.Column('boiler_manufacturer_code', sa.Text(), nullable=True, comment='EIA short code for boiler manufacturer.'),
- sa.ForeignKeyConstraint(['boiler_manufacturer_code'], ['environmental_equipment_manufacturers_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id')
+ sa.ForeignKeyConstraint(['boiler_manufacturer_code'], ['environmental_equipment_manufacturers_eia.code'], name=op.f('fk_boilers_entity_eia_boiler_manufacturer_code_environmental_equipment_manufacturers_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_boilers_entity_eia_plant_id_eia_plants_entity_eia')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', name=op.f('pk_boilers_entity_eia'))
)
op.create_table('coalmine_eia923',
sa.Column('mine_id_pudl', sa.Integer(), nullable=False, comment='Dynamically assigned PUDL mine identifier.'),
@@ -345,9 +376,9 @@ def upgrade() -> None:
sa.Column('county_id_fips', sa.Text(), nullable=True, comment='County ID from the Federal Information Processing Standard Publication 6-4.'),
sa.Column('mine_id_msha', sa.Integer(), nullable=True, comment='MSHA issued mine identifier.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['mine_type_code'], ['coalmine_types_eia.code'], ),
- sa.PrimaryKeyConstraint('mine_id_pudl')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_coalmine_eia923_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['mine_type_code'], ['coalmine_types_eia.code'], name=op.f('fk_coalmine_eia923_mine_type_code_coalmine_types_eia')),
+ sa.PrimaryKeyConstraint('mine_id_pudl', name=op.f('pk_coalmine_eia923'))
)
op.create_table('demand_hourly_pa_ferc714',
sa.Column('respondent_id_ferc714', sa.Integer(), nullable=False),
@@ -355,8 +386,8 @@ def upgrade() -> None:
sa.Column('utc_datetime', sqlite.DATETIME(), nullable=False),
sa.Column('timezone', sa.Enum('America/New_York', 'America/Chicago', 'America/Denver', 'America/Los_Angeles', 'America/Anchorage', 'Pacific/Honolulu'), nullable=True, comment='IANA timezone name'),
sa.Column('demand_mwh', sa.Float(), nullable=True),
- sa.ForeignKeyConstraint(['respondent_id_ferc714'], ['respondent_id_ferc714.respondent_id_ferc714'], ),
- sa.PrimaryKeyConstraint('respondent_id_ferc714', 'utc_datetime')
+ sa.ForeignKeyConstraint(['respondent_id_ferc714'], ['respondent_id_ferc714.respondent_id_ferc714'], name=op.f('fk_demand_hourly_pa_ferc714_respondent_id_ferc714_respondent_id_ferc714')),
+ sa.PrimaryKeyConstraint('respondent_id_ferc714', 'utc_datetime', name=op.f('pk_demand_hourly_pa_ferc714'))
)
op.create_table('demand_response_eia861',
sa.Column('actual_peak_demand_savings_mw', sa.Float(), nullable=True),
@@ -373,8 +404,8 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.PrimaryKeyConstraint('balancing_authority_code_eia', 'customer_class', 'report_date', 'state', 'utility_id_eia')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_demand_response_eia861_data_maturity_data_maturities')),
+ sa.PrimaryKeyConstraint('balancing_authority_code_eia', 'customer_class', 'report_date', 'state', 'utility_id_eia', name=op.f('pk_demand_response_eia861'))
)
op.create_table('demand_response_water_heater_eia861',
sa.Column('balancing_authority_code_eia', sa.Text(), nullable=False, comment='EIA short code identifying a balancing authority.'),
@@ -383,8 +414,8 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
sa.Column('water_heater', sa.Integer(), nullable=True),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.PrimaryKeyConstraint('balancing_authority_code_eia', 'report_date', 'state', 'utility_id_eia')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_demand_response_water_heater_eia861_data_maturity_data_maturities')),
+ sa.PrimaryKeyConstraint('balancing_authority_code_eia', 'report_date', 'state', 'utility_id_eia', name=op.f('pk_demand_response_water_heater_eia861'))
)
op.create_table('demand_side_management_ee_dr_eia861',
sa.Column('annual_indirect_program_cost', sa.Float(), nullable=True),
@@ -411,7 +442,7 @@ def upgrade() -> None:
sa.Column('time_responsiveness_customers', sa.Integer(), nullable=True),
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_demand_side_management_ee_dr_eia861_data_maturity_data_maturities'))
)
op.create_table('demand_side_management_misc_eia861',
sa.Column('energy_savings_estimates_independently_verified', sa.Boolean(), nullable=True),
@@ -428,7 +459,7 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_demand_side_management_misc_eia861_data_maturity_data_maturities'))
)
op.create_table('demand_side_management_sales_eia861',
sa.Column('nerc_region', sa.Enum('BASN', 'CALN', 'CALS', 'DSW', 'ASCC', 'ISONE', 'ERCOT', 'NORW', 'NYISO', 'PJM', 'ROCK', 'ECAR', 'FRCC', 'HICC', 'MAAC', 'MAIN', 'MAPP', 'MRO', 'NPCC', 'RFC', 'SERC', 'SPP', 'TRE', 'WECC', 'WSCC', 'MISO', 'ECAR_MAAC', 'MAPP_WECC', 'RFC_SERC', 'SPP_WECC', 'MRO_WECC', 'ERCOT_SPP', 'SPP_TRE', 'ERCOT_TRE', 'MISO_TRE', 'VI', 'GU', 'PR', 'AS', 'UNK'), nullable=True, comment='NERC region in which the plant is located'),
@@ -438,7 +469,7 @@ def upgrade() -> None:
sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_demand_side_management_sales_eia861_data_maturity_data_maturities'))
)
op.create_table('denorm_emissions_control_equipment_eia860',
sa.Column('report_year', sa.Integer(), nullable=False, comment='Four-digit year in which the data was reported.'),
@@ -461,14 +492,14 @@ def upgrade() -> None:
sa.Column('emission_control_equipment_cost', sa.Float(), nullable=True, comment='The total cost to install a piece of emission control equipment.'),
sa.Column('emission_control_operating_date', sa.Date(), nullable=True, comment='The date a piece of emissions control equipment began operating. Derived from month and year columns in the raw data.'),
sa.Column('emission_control_retirement_date', sa.Date(), nullable=True, comment='The expected or actual retirement date for a piece of emissions control equipment. Derived from month and year columns in the raw data.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['emission_control_equipment_type_code'], ['emission_control_equipment_types_eia.code'], ),
- sa.ForeignKeyConstraint(['operational_status_code'], ['operational_status_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_year', 'plant_id_eia', 'emission_control_id_pudl')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_denorm_emissions_control_equipment_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['emission_control_equipment_type_code'], ['emission_control_equipment_types_eia.code'], name=op.f('fk_denorm_emissions_control_equipment_eia860_emission_control_equipment_type_code_emission_control_equipment_types_eia')),
+ sa.ForeignKeyConstraint(['operational_status_code'], ['operational_status_eia.code'], name=op.f('fk_denorm_emissions_control_equipment_eia860_operational_status_code_operational_status_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_denorm_emissions_control_equipment_eia860_plant_id_eia_plants_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_emissions_control_equipment_eia860_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_denorm_emissions_control_equipment_eia860_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_emissions_control_equipment_eia860_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_year', 'plant_id_eia', 'emission_control_id_pudl', name=op.f('pk_denorm_emissions_control_equipment_eia860'))
)
op.create_table('denorm_fuel_receipts_costs_eia923',
sa.Column('report_date', sa.Date(), nullable=True, comment='Date reported.'),
@@ -481,7 +512,7 @@ def upgrade() -> None:
sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
sa.Column('contract_type_code', sa.Enum('S', 'C', 'NC', 'T'), nullable=True, comment='Purchase type under which receipts occurred in the reporting month. C: Contract, NC: New Contract, S: Spot Purchase, T: Tolling Agreement.'),
sa.Column('contract_expiration_date', sa.Date(), nullable=True, comment='Date contract expires.Format: MMYY.'),
- sa.Column('energy_source_code', sa.Text(), nullable=True, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=True, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('fuel_group_code', sa.Enum('petroleum', 'other_gas', 'petroleum_coke', 'natural_gas', 'coal'), nullable=True, comment='Fuel groups used in the Electric Power Monthly'),
sa.Column('supplier_name', sa.Text(), nullable=True, comment='Company that sold the fuel to the plant or, in the case of Natural Gas, pipline owner.'),
@@ -507,16 +538,16 @@ def upgrade() -> None:
sa.Column('mine_state', sa.Text(), nullable=True, comment='State where the coal mine is located. Two letter abbreviation.'),
sa.Column('coalmine_county_id_fips', sa.Text(), nullable=True, comment='County ID from the Federal Information Processing Standard Publication 6-4. This is the county where the coal mine is located.'),
sa.Column('mine_type_code', sa.Text(), nullable=True, comment='Type of coal mine.'),
- sa.ForeignKeyConstraint(['contract_type_code'], ['contract_types_eia.code'], ),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['mine_type_code'], ['coalmine_types_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['primary_transportation_mode_code'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['secondary_transportation_mode_code'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], )
+ sa.ForeignKeyConstraint(['contract_type_code'], ['contract_types_eia.code'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_contract_type_code_contract_types_eia')),
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['mine_type_code'], ['coalmine_types_eia.code'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_mine_type_code_coalmine_types_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_plant_id_eia_plants_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['primary_transportation_mode_code'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_primary_transportation_mode_code_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['secondary_transportation_mode_code'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_secondary_transportation_mode_code_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_fuel_receipts_costs_eia923_utility_id_pudl_utilities_pudl'))
)
op.create_table('denorm_fuel_receipts_costs_monthly_eia923',
sa.Column('report_date', sa.Date(), nullable=True, comment='Date reported.'),
@@ -539,10 +570,10 @@ def upgrade() -> None:
sa.Column('mercury_content_ppm', sa.Float(), nullable=True, comment='Mercury content in parts per million (ppm) to the nearest 0.001 ppm.'),
sa.Column('moisture_content_pct', sa.Float(), nullable=True),
sa.Column('chlorine_content_ppm', sa.Float(), nullable=True),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], )
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_denorm_fuel_receipts_costs_monthly_eia923_plant_id_eia_plants_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_fuel_receipts_costs_monthly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_denorm_fuel_receipts_costs_monthly_eia923_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_fuel_receipts_costs_monthly_eia923_utility_id_pudl_utilities_pudl'))
)
op.create_table('denorm_generation_fuel_combined_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -552,7 +583,7 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('fuel_type_code_aer', sa.Text(), nullable=True, comment='A partial aggregation of the reported fuel type codes into larger categories used by EIA in, for example, the Annual Energy Review (AER). Two or three letter alphanumeric.'),
sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
@@ -563,15 +594,15 @@ def upgrade() -> None:
sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['fuel_type_code_aer'], ['fuel_types_aer_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'prime_mover_code', 'energy_source_code')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_denorm_generation_fuel_combined_eia923_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generation_fuel_combined_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['fuel_type_code_aer'], ['fuel_types_aer_eia.code'], name=op.f('fk_denorm_generation_fuel_combined_eia923_fuel_type_code_aer_fuel_types_aer_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_denorm_generation_fuel_combined_eia923_plant_id_eia_plants_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_generation_fuel_combined_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_denorm_generation_fuel_combined_eia923_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_denorm_generation_fuel_combined_eia923_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_generation_fuel_combined_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'prime_mover_code', 'energy_source_code', name=op.f('pk_denorm_generation_fuel_combined_eia923'))
)
op.create_table('denorm_generation_fuel_combined_monthly_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -581,7 +612,7 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
sa.Column('fuel_consumed_units', sa.Float(), nullable=True, comment='Consumption of the fuel type in physical unit. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
@@ -590,13 +621,13 @@ def upgrade() -> None:
sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'prime_mover_code', 'energy_source_code')
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generation_fuel_combined_monthly_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_denorm_generation_fuel_combined_monthly_eia923_plant_id_eia_plants_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_generation_fuel_combined_monthly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_denorm_generation_fuel_combined_monthly_eia923_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_denorm_generation_fuel_combined_monthly_eia923_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_generation_fuel_combined_monthly_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'prime_mover_code', 'energy_source_code', name=op.f('pk_denorm_generation_fuel_combined_monthly_eia923'))
)
op.create_table('distributed_generation_fuel_eia861',
sa.Column('estimated_or_actual_fuel_data', sa.Enum('estimated', 'actual'), nullable=True),
@@ -606,7 +637,7 @@ def upgrade() -> None:
sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_distributed_generation_fuel_eia861_data_maturity_data_maturities'))
)
op.create_table('distributed_generation_misc_eia861',
sa.Column('backup_capacity_mw', sa.Float(), nullable=True),
@@ -620,7 +651,7 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_distributed_generation_misc_eia861_data_maturity_data_maturities'))
)
op.create_table('distributed_generation_tech_eia861',
sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
@@ -630,7 +661,7 @@ def upgrade() -> None:
sa.Column('tech_class', sa.Enum('backup', 'chp_cogen', 'combustion_turbine', 'fuel_cell', 'hydro', 'internal_combustion', 'other', 'pv', 'steam', 'storage_pv', 'all_storage', 'total', 'virtual_pv', 'wind'), nullable=True),
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_distributed_generation_tech_eia861_data_maturity_data_maturities'))
)
op.create_table('distribution_systems_eia861',
sa.Column('circuits_with_voltage_optimization', sa.Integer(), nullable=True),
@@ -641,7 +672,7 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_distribution_systems_eia861_data_maturity_data_maturities'))
)
op.create_table('dynamic_pricing_eia861',
sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
@@ -658,7 +689,7 @@ def upgrade() -> None:
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('variable_peak_pricing', sa.Boolean(), nullable=True),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_dynamic_pricing_eia861_data_maturity_data_maturities'))
)
op.create_table('emissions_control_equipment_eia860',
sa.Column('report_year', sa.Integer(), nullable=False, comment='Four-digit year in which the data was reported.'),
@@ -675,11 +706,11 @@ def upgrade() -> None:
sa.Column('emission_control_equipment_cost', sa.Float(), nullable=True, comment='The total cost to install a piece of emission control equipment.'),
sa.Column('emission_control_operating_date', sa.Date(), nullable=True, comment='The date a piece of emissions control equipment began operating. Derived from month and year columns in the raw data.'),
sa.Column('emission_control_retirement_date', sa.Date(), nullable=True, comment='The expected or actual retirement date for a piece of emissions control equipment. Derived from month and year columns in the raw data.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['emission_control_equipment_type_code'], ['emission_control_equipment_types_eia.code'], ),
- sa.ForeignKeyConstraint(['operational_status_code'], ['operational_status_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.PrimaryKeyConstraint('report_year', 'plant_id_eia', 'emission_control_id_pudl')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_emissions_control_equipment_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['emission_control_equipment_type_code'], ['emission_control_equipment_types_eia.code'], name=op.f('fk_emissions_control_equipment_eia860_emission_control_equipment_type_code_emission_control_equipment_types_eia')),
+ sa.ForeignKeyConstraint(['operational_status_code'], ['operational_status_eia.code'], name=op.f('fk_emissions_control_equipment_eia860_operational_status_code_operational_status_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_emissions_control_equipment_eia860_plant_id_eia_plants_entity_eia')),
+ sa.PrimaryKeyConstraint('report_year', 'plant_id_eia', 'emission_control_id_pudl', name=op.f('pk_emissions_control_equipment_eia860'))
)
op.create_table('energy_efficiency_eia861',
sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
@@ -699,12 +730,29 @@ def upgrade() -> None:
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('weighted_average_life_years', sa.Float(), nullable=True),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_energy_efficiency_eia861_data_maturity_data_maturities'))
+ )
+ op.create_table('fipsified_respondents_ferc714',
+ sa.Column('eia_code', sa.Integer(), nullable=True),
+ sa.Column('respondent_type', sa.Enum('utility', 'balancing_authority'), nullable=True),
+ sa.Column('respondent_id_ferc714', sa.Integer(), nullable=True),
+ sa.Column('respondent_name_ferc714', sa.Text(), nullable=True),
+ sa.Column('report_date', sa.Date(), nullable=True, comment='Date reported.'),
+ sa.Column('balancing_authority_id_eia', sa.Integer(), nullable=True, comment='EIA balancing authority ID. This is often (but not always!) the same as the utility ID associated with the same legal entity.'),
+ sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
+ sa.Column('balancing_authority_name_eia', sa.Text(), nullable=True, comment='Name of the balancing authority.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
+ sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
+ sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
+ sa.Column('county', sa.Text(), nullable=True, comment='County name.'),
+ sa.Column('state_id_fips', sa.Text(), nullable=True, comment='Two digit state FIPS code.'),
+ sa.Column('county_id_fips', sa.Text(), nullable=True, comment='County ID from the Federal Information Processing Standard Publication 6-4.'),
+ sa.ForeignKeyConstraint(['respondent_id_ferc714'], ['respondent_id_ferc714.respondent_id_ferc714'], name=op.f('fk_fipsified_respondents_ferc714_respondent_id_ferc714_respondent_id_ferc714'))
)
op.create_table('generation_fuel_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('fuel_type_code_aer', sa.Text(), nullable=True, comment='A partial aggregation of the reported fuel type codes into larger categories used by EIA in, for example, the Annual Energy Review (AER). Two or three letter alphanumeric.'),
sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
@@ -715,18 +763,18 @@ def upgrade() -> None:
sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['fuel_type_code_aer'], ['fuel_types_aer_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'prime_mover_code', 'energy_source_code')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_generation_fuel_eia923_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_generation_fuel_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['fuel_type_code_aer'], ['fuel_types_aer_eia.code'], name=op.f('fk_generation_fuel_eia923_fuel_type_code_aer_fuel_types_aer_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_generation_fuel_eia923_plant_id_eia_plants_entity_eia')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_generation_fuel_eia923_prime_mover_code_prime_movers_eia')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'prime_mover_code', 'energy_source_code', name=op.f('pk_generation_fuel_eia923'))
)
op.create_table('generation_fuel_nuclear_eia923',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
sa.Column('nuclear_unit_id', sa.Text(), nullable=False, comment='For nuclear plants only, the unit number .One digit numeric. Nuclear plants are the only type of plants for which data are shown explicitly at the generating unit level.'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('fuel_type_code_aer', sa.Text(), nullable=True, comment='A partial aggregation of the reported fuel type codes into larger categories used by EIA in, for example, the Annual Energy Review (AER). Two or three letter alphanumeric.'),
sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
@@ -737,12 +785,12 @@ def upgrade() -> None:
sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['fuel_type_code_aer'], ['fuel_types_aer_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'nuclear_unit_id', 'energy_source_code', 'prime_mover_code')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_generation_fuel_nuclear_eia923_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_generation_fuel_nuclear_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['fuel_type_code_aer'], ['fuel_types_aer_eia.code'], name=op.f('fk_generation_fuel_nuclear_eia923_fuel_type_code_aer_fuel_types_aer_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_generation_fuel_nuclear_eia923_plant_id_eia_plants_entity_eia')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_generation_fuel_nuclear_eia923_prime_mover_code_prime_movers_eia')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'nuclear_unit_id', 'energy_source_code', 'prime_mover_code', name=op.f('pk_generation_fuel_nuclear_eia923'))
)
op.create_table('generators_entity_eia',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
@@ -765,8 +813,8 @@ def upgrade() -> None:
sa.Column('original_planned_generator_operating_date', sa.Date(), nullable=True, comment='The date the generator was originally scheduled to be operational'),
sa.Column('operating_switch', sa.Text(), nullable=True, comment='Indicates whether the fuel switching generator can switch when operating'),
sa.Column('previously_canceled', sa.Boolean(), nullable=True, comment='Indicates whether the generator was previously reported as indefinitely postponed or canceled'),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id')
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_generators_entity_eia_plant_id_eia_plants_entity_eia')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', name=op.f('pk_generators_entity_eia'))
)
op.create_table('green_pricing_eia861',
sa.Column('customer_class', sa.Enum('commercial', 'industrial', 'direct_connection', 'other', 'residential', 'total', 'transportation'), nullable=True, comment='High level categorization of customer type.'),
@@ -780,7 +828,17 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_green_pricing_eia861_data_maturity_data_maturities'))
+ )
+ op.create_table('heat_rate_by_unit_monthly',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=False, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_heat_rate_by_unit_monthly_plant_id_eia_plants_entity_eia')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'unit_id_pudl', name=op.f('pk_heat_rate_by_unit_monthly'))
)
op.create_table('mergers_eia861',
sa.Column('entity_type', sa.Text(), nullable=True, comment='Entity type of principal owner.'),
@@ -797,7 +855,7 @@ def upgrade() -> None:
sa.Column('zip_code', sa.Text(), nullable=True, comment='Five digit US Zip Code.'),
sa.Column('zip_code_4', sa.Text(), nullable=True, comment='Four digit US Zip Code suffix.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_mergers_eia861_data_maturity_data_maturities'))
)
op.create_table('net_metering_customer_fuel_class_eia861',
sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
@@ -813,7 +871,7 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_net_metering_customer_fuel_class_eia861_data_maturity_data_maturities'))
)
op.create_table('net_metering_misc_eia861',
sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
@@ -822,7 +880,7 @@ def upgrade() -> None:
sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_net_metering_misc_eia861_data_maturity_data_maturities'))
)
op.create_table('non_net_metering_customer_fuel_class_eia861',
sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
@@ -834,7 +892,7 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_non_net_metering_customer_fuel_class_eia861_data_maturity_data_maturities'))
)
op.create_table('non_net_metering_misc_eia861',
sa.Column('backup_capacity_mw', sa.Float(), nullable=True),
@@ -846,7 +904,7 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_owned_capacity_mw', sa.Float(), nullable=True),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_non_net_metering_misc_eia861_data_maturity_data_maturities'))
)
op.create_table('operational_data_misc_eia861',
sa.Column('consumed_by_facility_mwh', sa.Float(), nullable=True),
@@ -877,7 +935,7 @@ def upgrade() -> None:
sa.Column('wholesale_power_purchases_mwh', sa.Float(), nullable=True),
sa.Column('winter_peak_demand_mw', sa.Float(), nullable=True),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_operational_data_misc_eia861_data_maturity_data_maturities'))
)
op.create_table('operational_data_revenue_eia861',
sa.Column('nerc_region', sa.Enum('BASN', 'CALN', 'CALS', 'DSW', 'ASCC', 'ISONE', 'ERCOT', 'NORW', 'NYISO', 'PJM', 'ROCK', 'ECAR', 'FRCC', 'HICC', 'MAAC', 'MAIN', 'MAPP', 'MRO', 'NPCC', 'RFC', 'SERC', 'SPP', 'TRE', 'WECC', 'WSCC', 'MISO', 'ECAR_MAAC', 'MAPP_WECC', 'RFC_SERC', 'SPP_WECC', 'MRO_WECC', 'ERCOT_SPP', 'SPP_TRE', 'ERCOT_TRE', 'MISO_TRE', 'VI', 'GU', 'PR', 'AS', 'UNK'), nullable=True, comment='NERC region in which the plant is located'),
@@ -887,14 +945,14 @@ def upgrade() -> None:
sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_operational_data_revenue_eia861_data_maturity_data_maturities'))
)
op.create_table('plants_eia',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_plants_eia_plant_id_pudl_plants_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', name=op.f('pk_plants_eia'))
)
op.create_table('reliability_eia861',
sa.Column('caidi_w_major_event_days_minus_loss_of_service_minutes', sa.Float(), nullable=True),
@@ -919,8 +977,8 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['momentary_interruption_definition'], ['momentary_interruptions_eia.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_reliability_eia861_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['momentary_interruption_definition'], ['momentary_interruptions_eia.code'], name=op.f('fk_reliability_eia861_momentary_interruption_definition_momentary_interruptions_eia'))
)
op.create_table('sales_eia861',
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
@@ -938,8 +996,8 @@ def upgrade() -> None:
sa.Column('sales_mwh', sa.Float(), nullable=True, comment='Quantity of electricity sold in MWh.'),
sa.Column('sales_revenue', sa.Float(), nullable=True, comment='Revenue from electricity sold.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.PrimaryKeyConstraint('utility_id_eia', 'state', 'report_date', 'balancing_authority_code_eia', 'customer_class', 'business_model', 'service_type')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_sales_eia861_data_maturity_data_maturities')),
+ sa.PrimaryKeyConstraint('utility_id_eia', 'state', 'report_date', 'balancing_authority_code_eia', 'customer_class', 'business_model', 'service_type', name=op.f('pk_sales_eia861'))
)
op.create_table('service_territory_eia861',
sa.Column('county', sa.Text(), nullable=True, comment='County name.'),
@@ -951,15 +1009,35 @@ def upgrade() -> None:
sa.Column('state_id_fips', sa.Text(), nullable=True, comment='Two digit state FIPS code.'),
sa.Column('county_id_fips', sa.Text(), nullable=False, comment='County ID from the Federal Information Processing Standard Publication 6-4.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.PrimaryKeyConstraint('report_date', 'utility_id_eia', 'county_id_fips')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_service_territory_eia861_data_maturity_data_maturities')),
+ sa.PrimaryKeyConstraint('report_date', 'utility_id_eia', 'county_id_fips', name=op.f('pk_service_territory_eia861'))
+ )
+ op.create_table('summarized_demand_ferc714',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('respondent_id_ferc714', sa.Integer(), nullable=False),
+ sa.Column('demand_annual_mwh', sa.Float(), nullable=True),
+ sa.Column('population', sa.Float(), nullable=True, comment='County population, sourced from Census DP1 data.'),
+ sa.Column('area_km2', sa.Float(), nullable=True, comment='County area in km2.'),
+ sa.Column('population_density_km2', sa.Float(), nullable=True, comment='Average population per sq. km area of a service territory.'),
+ sa.Column('demand_annual_per_capita_mwh', sa.Float(), nullable=True, comment='Per-capita annual demand, averaged using Census county-level population estimates.'),
+ sa.Column('demand_density_mwh_km2', sa.Float(), nullable=True, comment='Annual demand per km2 of a given service territory.'),
+ sa.Column('eia_code', sa.Integer(), nullable=True),
+ sa.Column('respondent_type', sa.Enum('utility', 'balancing_authority'), nullable=True),
+ sa.Column('respondent_name_ferc714', sa.Text(), nullable=True),
+ sa.Column('balancing_authority_id_eia', sa.Integer(), nullable=True, comment='EIA balancing authority ID. This is often (but not always!) the same as the utility ID associated with the same legal entity.'),
+ sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
+ sa.Column('balancing_authority_name_eia', sa.Text(), nullable=True, comment='Name of the balancing authority.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
+ sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
+ sa.ForeignKeyConstraint(['respondent_id_ferc714'], ['respondent_id_ferc714.respondent_id_ferc714'], name=op.f('fk_summarized_demand_ferc714_respondent_id_ferc714_respondent_id_ferc714')),
+ sa.PrimaryKeyConstraint('respondent_id_ferc714', 'report_date', name=op.f('pk_summarized_demand_ferc714'))
)
op.create_table('utilities_eia',
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_eia')
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_utilities_eia_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_eia', name=op.f('pk_utilities_eia'))
)
op.create_table('utilities_eia860',
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
@@ -987,16 +1065,16 @@ def upgrade() -> None:
sa.Column('phone_number_2', sa.Text(), nullable=True, comment='Phone number for utility contact 2.'),
sa.Column('phone_extension_2', sa.Text(), nullable=True, comment='Phone extension for utility contact 2'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.PrimaryKeyConstraint('utility_id_eia', 'report_date')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_utilities_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_utilities_eia860_utility_id_eia_utilities_entity_eia')),
+ sa.PrimaryKeyConstraint('utility_id_eia', 'report_date', name=op.f('pk_utilities_eia860'))
)
op.create_table('utilities_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
sa.Column('utility_name_ferc1', sa.Text(), nullable=True, comment='Name of the responding utility, as it is reported in FERC Form 1. For human readability only.'),
sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1')
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_utilities_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', name=op.f('pk_utilities_ferc1'))
)
op.create_table('utility_data_misc_eia861',
sa.Column('alternative_fuel_vehicle_2_activity', sa.Boolean(), nullable=True),
@@ -1018,7 +1096,7 @@ def upgrade() -> None:
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('wholesale_marketing_activity', sa.Boolean(), nullable=True),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_utility_data_misc_eia861_data_maturity_data_maturities'))
)
op.create_table('utility_data_nerc_eia861',
sa.Column('nerc_region', sa.Enum('BASN', 'CALN', 'CALS', 'DSW', 'ASCC', 'ISONE', 'ERCOT', 'NORW', 'NYISO', 'PJM', 'ROCK', 'ECAR', 'FRCC', 'HICC', 'MAAC', 'MAIN', 'MAPP', 'MRO', 'NPCC', 'RFC', 'SERC', 'SPP', 'TRE', 'WECC', 'WSCC', 'MISO', 'ECAR_MAAC', 'MAPP_WECC', 'RFC_SERC', 'SPP_WECC', 'MRO_WECC', 'ERCOT_SPP', 'SPP_TRE', 'ERCOT_TRE', 'MISO_TRE', 'VI', 'GU', 'PR', 'AS', 'UNK'), nullable=True, comment='NERC region in which the plant is located'),
@@ -1027,7 +1105,7 @@ def upgrade() -> None:
sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_utility_data_nerc_eia861_data_maturity_data_maturities'))
)
op.create_table('utility_data_rto_eia861',
sa.Column('nerc_region', sa.Enum('BASN', 'CALN', 'CALS', 'DSW', 'ASCC', 'ISONE', 'ERCOT', 'NORW', 'NYISO', 'PJM', 'ROCK', 'ECAR', 'FRCC', 'HICC', 'MAAC', 'MAIN', 'MAPP', 'MRO', 'NPCC', 'RFC', 'SERC', 'SPP', 'TRE', 'WECC', 'WSCC', 'MISO', 'ECAR_MAAC', 'MAPP_WECC', 'RFC_SERC', 'SPP_WECC', 'MRO_WECC', 'ERCOT_SPP', 'SPP_TRE', 'ERCOT_TRE', 'MISO_TRE', 'VI', 'GU', 'PR', 'AS', 'UNK'), nullable=True, comment='NERC region in which the plant is located'),
@@ -1036,14 +1114,14 @@ def upgrade() -> None:
sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], )
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_utility_data_rto_eia861_data_maturity_data_maturities'))
)
op.create_table('utility_plant_assn',
sa.Column('utility_id_pudl', sa.Integer(), nullable=False, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
sa.Column('plant_id_pudl', sa.Integer(), nullable=False, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_pudl', 'plant_id_pudl')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_utility_plant_assn_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_utility_plant_assn_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_pudl', 'plant_id_pudl', name=op.f('pk_utility_plant_assn'))
)
op.create_table('balance_sheet_assets_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1055,8 +1133,8 @@ def upgrade() -> None:
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'asset_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_balance_sheet_assets_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'asset_type', name=op.f('pk_balance_sheet_assets_ferc1'))
)
op.create_table('balance_sheet_liabilities_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1068,13 +1146,13 @@ def upgrade() -> None:
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'liability_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_balance_sheet_liabilities_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'liability_type', name=op.f('pk_balance_sheet_liabilities_ferc1'))
)
op.create_table('boiler_fuel_eia923',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
sa.Column('boiler_id', sa.Text(), nullable=False, comment='Alphanumeric boiler ID.'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -1082,10 +1160,20 @@ def upgrade() -> None:
sa.Column('fuel_mmbtu_per_unit', sa.Float(), nullable=True, comment='Heat content of the fuel in millions of Btus per physical unit.'),
sa.Column('sulfur_content_pct', sa.Float(), nullable=True, comment='Sulfur content percentage by weight to the nearest 0.01 percent.'),
sa.Column('ash_content_pct', sa.Float(), nullable=True, comment='Ash content percentage by weight to the nearest 0.1 percent.'),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'energy_source_code', 'prime_mover_code', 'report_date')
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_boiler_fuel_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], name=op.f('fk_boiler_fuel_eia923_plant_id_eia_boilers_entity_eia')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_boiler_fuel_eia923_prime_mover_code_prime_movers_eia')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'energy_source_code', 'prime_mover_code', 'report_date', name=op.f('pk_boiler_fuel_eia923'))
+ )
+ op.create_table('capacity_factor_by_generator_monthly',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
+ sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_capacity_factor_by_generator_monthly_plant_id_eia_generators_entity_eia')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_capacity_factor_by_generator_monthly'))
)
op.create_table('cash_flow_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1095,8 +1183,8 @@ def upgrade() -> None:
sa.Column('amount', sa.Float(), nullable=True, comment='Reported amount of dollars. This could be a balance or a change in value.'),
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'amount_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_cash_flow_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'amount_type', name=op.f('pk_cash_flow_ferc1'))
)
op.create_table('denorm_balance_sheet_assets_ferc1',
sa.Column('report_year', sa.Integer(), nullable=False, comment='Four-digit year in which the data was reported.'),
@@ -1110,9 +1198,9 @@ def upgrade() -> None:
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
sa.Column('starting_balance', sa.Float(), nullable=True, comment='Account balance at beginning of year.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'asset_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_balance_sheet_assets_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_balance_sheet_assets_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'asset_type', name=op.f('pk_denorm_balance_sheet_assets_ferc1'))
)
op.create_table('denorm_balance_sheet_liabilities_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1126,9 +1214,9 @@ def upgrade() -> None:
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'liability_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_balance_sheet_liabilities_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_balance_sheet_liabilities_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'liability_type', name=op.f('pk_denorm_balance_sheet_liabilities_ferc1'))
)
op.create_table('denorm_boiler_fuel_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -1140,7 +1228,7 @@ def upgrade() -> None:
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('boiler_id', sa.Text(), nullable=False, comment='Alphanumeric boiler ID.'),
sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('fuel_consumed_units', sa.Float(), nullable=True, comment='Consumption of the fuel type in physical unit. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
@@ -1148,13 +1236,13 @@ def upgrade() -> None:
sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
sa.Column('sulfur_content_pct', sa.Float(), nullable=True, comment='Sulfur content percentage by weight to the nearest 0.01 percent.'),
sa.Column('ash_content_pct', sa.Float(), nullable=True, comment='Ash content percentage by weight to the nearest 0.1 percent.'),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'energy_source_code', 'prime_mover_code', 'report_date')
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_denorm_boiler_fuel_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], name=op.f('fk_denorm_boiler_fuel_eia923_plant_id_eia_boilers_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_boiler_fuel_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_denorm_boiler_fuel_eia923_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_denorm_boiler_fuel_eia923_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_boiler_fuel_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'energy_source_code', 'prime_mover_code', 'report_date', name=op.f('pk_denorm_boiler_fuel_eia923'))
)
op.create_table('denorm_boiler_fuel_monthly_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -1166,7 +1254,7 @@ def upgrade() -> None:
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('boiler_id', sa.Text(), nullable=False, comment='Alphanumeric boiler ID.'),
sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('fuel_consumed_units', sa.Float(), nullable=True, comment='Consumption of the fuel type in physical unit. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
@@ -1174,13 +1262,13 @@ def upgrade() -> None:
sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
sa.Column('sulfur_content_pct', sa.Float(), nullable=True, comment='Sulfur content percentage by weight to the nearest 0.01 percent.'),
sa.Column('ash_content_pct', sa.Float(), nullable=True, comment='Ash content percentage by weight to the nearest 0.1 percent.'),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'energy_source_code', 'prime_mover_code', 'report_date')
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_denorm_boiler_fuel_monthly_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], name=op.f('fk_denorm_boiler_fuel_monthly_eia923_plant_id_eia_boilers_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_boiler_fuel_monthly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_denorm_boiler_fuel_monthly_eia923_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_denorm_boiler_fuel_monthly_eia923_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_boiler_fuel_monthly_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'energy_source_code', 'prime_mover_code', 'report_date', name=op.f('pk_denorm_boiler_fuel_monthly_eia923'))
)
op.create_table('denorm_cash_flow_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1192,9 +1280,9 @@ def upgrade() -> None:
sa.Column('amount', sa.Float(), nullable=True, comment='Reported amount of dollars. This could be a balance or a change in value.'),
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'amount_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_cash_flow_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_cash_flow_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'amount_type', name=op.f('pk_denorm_cash_flow_ferc1'))
)
op.create_table('denorm_depreciation_amortization_summary_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1206,9 +1294,9 @@ def upgrade() -> None:
sa.Column('ferc_account_label', sa.Text(), nullable=False, comment='Long FERC account identifier derived from values reported in the XBRL taxonomies. May also refer to aggregations of individual FERC accounts.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('dollar_value', sa.Float(), nullable=True, comment='Dollar value of reported income, expense, asset, or liability.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'ferc_account_label')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_depreciation_amortization_summary_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_depreciation_amortization_summary_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'ferc_account_label', name=op.f('pk_denorm_depreciation_amortization_summary_ferc1'))
)
op.create_table('denorm_electric_energy_dispositions_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1219,9 +1307,9 @@ def upgrade() -> None:
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
sa.Column('energy_mwh', sa.Float(), nullable=True, comment='Sources and uses of energy in MWh.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_disposition_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_electric_energy_dispositions_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_electric_energy_dispositions_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_disposition_type', name=op.f('pk_denorm_electric_energy_dispositions_ferc1'))
)
op.create_table('denorm_electric_energy_sources_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1232,9 +1320,9 @@ def upgrade() -> None:
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
sa.Column('energy_mwh', sa.Float(), nullable=True, comment='Sources and uses of energy in MWh.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_source_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_electric_energy_sources_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_electric_energy_sources_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_source_type', name=op.f('pk_denorm_electric_energy_sources_ferc1'))
)
op.create_table('denorm_electric_operating_expenses_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1246,9 +1334,9 @@ def upgrade() -> None:
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'expense_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_electric_operating_expenses_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_electric_operating_expenses_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'expense_type', name=op.f('pk_denorm_electric_operating_expenses_ferc1'))
)
op.create_table('denorm_electric_operating_revenues_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1262,9 +1350,9 @@ def upgrade() -> None:
sa.Column('avg_customers_per_month', sa.Float(), nullable=True, comment='Average number of customers per month.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'revenue_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_electric_operating_revenues_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_electric_operating_revenues_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'revenue_type', name=op.f('pk_denorm_electric_operating_revenues_ferc1'))
)
op.create_table('denorm_electric_plant_depreciation_changes_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1274,14 +1362,14 @@ def upgrade() -> None:
sa.Column('depreciation_type', sa.Text(), nullable=False, comment='Type of depreciation provision within FERC Account 108, including cost ofremoval, depreciation expenses, salvage, cost of retired plant, etc.'),
sa.Column('plant_status', sa.Text(), nullable=False, comment='Utility plant financial status (in service, future, leased, total).'),
sa.Column('utility_type', sa.Text(), nullable=False, comment='Listing of utility plant types. Examples include Electric Utility, Gas Utility, and Other Utility.'),
- sa.Column('utility_plant_value', sa.Float(), nullable=True, comment='Utility plant value.'),
+ sa.Column('dollar_value', sa.Float(), nullable=True, comment='Dollar value of reported income, expense, asset, or liability.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'depreciation_type', 'plant_status', 'utility_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_electric_plant_depreciation_changes_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_electric_plant_depreciation_changes_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'depreciation_type', 'plant_status', 'utility_type', name=op.f('pk_denorm_electric_plant_depreciation_changes_ferc1'))
)
op.create_table('denorm_electric_plant_depreciation_functional_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1296,9 +1384,9 @@ def upgrade() -> None:
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'plant_status', 'utility_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_electric_plant_depreciation_functional_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_electric_plant_depreciation_functional_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'plant_status', 'utility_type', name=op.f('pk_denorm_electric_plant_depreciation_functional_ferc1'))
)
op.create_table('denorm_electricity_sales_by_rate_schedule_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=True, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1314,8 +1402,8 @@ def upgrade() -> None:
sa.Column('kwh_per_customer', sa.Float(), nullable=True, comment='kwh per customer.'),
sa.Column('revenue_per_kwh', sa.Float(), nullable=True),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_electricity_sales_by_rate_schedule_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_electricity_sales_by_rate_schedule_ferc1_utility_id_pudl_utilities_pudl'))
)
op.create_table('denorm_generation_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -1329,12 +1417,12 @@ def upgrade() -> None:
sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_denorm_generation_eia923_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_denorm_generation_eia923_plant_id_eia_generators_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_generation_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_denorm_generation_eia923_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_generation_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date', name=op.f('pk_denorm_generation_eia923'))
)
op.create_table('denorm_generation_monthly_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -1347,11 +1435,11 @@ def upgrade() -> None:
sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date')
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_denorm_generation_monthly_eia923_plant_id_eia_generators_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_generation_monthly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_denorm_generation_monthly_eia923_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_generation_monthly_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date', name=op.f('pk_denorm_generation_monthly_eia923'))
)
op.create_table('denorm_income_statement_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1365,9 +1453,9 @@ def upgrade() -> None:
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'income_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_income_statement_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_income_statement_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'income_type', name=op.f('pk_denorm_income_statement_ferc1'))
)
op.create_table('denorm_other_regulatory_liabilities_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=True, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1380,8 +1468,8 @@ def upgrade() -> None:
sa.Column('increase_in_other_regulatory_liabilities', sa.Float(), nullable=True, comment='The increase during the reporting period of other regulatory liabilities.'),
sa.Column('account_detail', sa.Text(), nullable=True, comment='Description of the account number credited from making debit adjustment to other regulatory liabilities.'),
sa.Column('decrease_in_other_regulatory_liabilities', sa.Float(), nullable=True, comment='The decrease during the reporting period of other regulatory liabilities.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_other_regulatory_liabilities_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_other_regulatory_liabilities_ferc1_utility_id_pudl_utilities_pudl'))
)
op.create_table('denorm_plant_in_service_ferc1',
sa.Column('report_year', sa.Integer(), nullable=False, comment='Four-digit year in which the data was reported.'),
@@ -1398,9 +1486,9 @@ def upgrade() -> None:
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
sa.Column('starting_balance', sa.Float(), nullable=True, comment='Account balance at beginning of year.'),
sa.Column('transfers', sa.Float(), nullable=True, comment='Cost of transfers into (out of) the account.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'ferc_account_label')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_plant_in_service_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_plant_in_service_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'ferc_account_label', name=op.f('pk_denorm_plant_in_service_ferc1'))
)
op.create_table('denorm_purchased_power_ferc1',
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
@@ -1421,9 +1509,9 @@ def upgrade() -> None:
sa.Column('received_mwh', sa.Float(), nullable=True, comment='Gross megawatt-hours received in power exchanges and used as the basis for settlement.'),
sa.Column('tariff', sa.Text(), nullable=True, comment='FERC Rate Schedule Number or Tariff. (Note: may be incomplete if originally reported on multiple lines.)'),
sa.Column('total_settlement', sa.Float(), nullable=True, comment='Sum of demand, energy, and other charges (USD). For power exchanges, the settlement amount for the net receipt of energy. If more energy was delivered than received, this amount is negative.'),
- sa.ForeignKeyConstraint(['purchase_type_code'], ['power_purchase_types_ferc1.code'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], )
+ sa.ForeignKeyConstraint(['purchase_type_code'], ['power_purchase_types_ferc1.code'], name=op.f('fk_denorm_purchased_power_ferc1_purchase_type_code_power_purchase_types_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_purchased_power_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_purchased_power_ferc1_utility_id_pudl_utilities_pudl'))
)
op.create_table('denorm_retained_earnings_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1432,15 +1520,14 @@ def upgrade() -> None:
sa.Column('report_year', sa.Integer(), nullable=False, comment='Four-digit year in which the data was reported.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
sa.Column('earnings_type', sa.Text(), nullable=False, comment='Label describing types of earnings.'),
- sa.Column('amount', sa.Float(), nullable=True, comment='Reported amount of dollars. This could be a balance or a change in value.'),
sa.Column('starting_balance', sa.Float(), nullable=True, comment='Account balance at beginning of year.'),
sa.Column('ending_balance', sa.Float(), nullable=True, comment='Account balance at end of year.'),
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'earnings_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_retained_earnings_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_retained_earnings_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'earnings_type', name=op.f('pk_denorm_retained_earnings_ferc1'))
)
op.create_table('denorm_transmission_statistics_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1464,8 +1551,8 @@ def upgrade() -> None:
sa.Column('opex_maintenance', sa.Float(), nullable=True, comment='Production expenses: Maintenance (USD).'),
sa.Column('opex_rents', sa.Float(), nullable=True, comment='Production expenses: rents (USD).'),
sa.Column('opex_total', sa.Float(), nullable=True, comment='Total production expenses, excluding fuel (USD).'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_transmission_statistics_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_transmission_statistics_ferc1_utility_id_pudl_utilities_pudl'))
)
op.create_table('denorm_utilities_eia',
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
@@ -1495,10 +1582,10 @@ def upgrade() -> None:
sa.Column('phone_number_2', sa.Text(), nullable=True, comment='Phone number for utility contact 2.'),
sa.Column('phone_extension_2', sa.Text(), nullable=True, comment='Phone extension for utility contact 2'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_eia', 'report_date')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_denorm_utilities_eia_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_utilities_eia_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_utilities_eia_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_eia', 'report_date', name=op.f('pk_denorm_utilities_eia'))
)
op.create_table('denorm_utility_plant_summary_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1511,9 +1598,9 @@ def upgrade() -> None:
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
sa.Column('ending_balance', sa.Float(), nullable=True, comment='Account balance at end of year.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'utility_plant_asset_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_denorm_utility_plant_summary_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_utility_plant_summary_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'utility_plant_asset_type', name=op.f('pk_denorm_utility_plant_summary_ferc1'))
)
op.create_table('depreciation_amortization_summary_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1523,8 +1610,8 @@ def upgrade() -> None:
sa.Column('ferc_account_label', sa.Text(), nullable=False, comment='Long FERC account identifier derived from values reported in the XBRL taxonomies. May also refer to aggregations of individual FERC accounts.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('dollar_value', sa.Float(), nullable=True, comment='Dollar value of reported income, expense, asset, or liability.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'ferc_account_label')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_depreciation_amortization_summary_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'ferc_account_label', name=op.f('pk_depreciation_amortization_summary_ferc1'))
)
op.create_table('electric_energy_dispositions_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1533,8 +1620,8 @@ def upgrade() -> None:
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
sa.Column('energy_mwh', sa.Float(), nullable=True, comment='Sources and uses of energy in MWh.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_disposition_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_electric_energy_dispositions_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_disposition_type', name=op.f('pk_electric_energy_dispositions_ferc1'))
)
op.create_table('electric_energy_sources_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1543,8 +1630,8 @@ def upgrade() -> None:
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
sa.Column('energy_mwh', sa.Float(), nullable=True, comment='Sources and uses of energy in MWh.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_source_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_electric_energy_sources_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_source_type', name=op.f('pk_electric_energy_sources_ferc1'))
)
op.create_table('electric_operating_expenses_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1554,8 +1641,8 @@ def upgrade() -> None:
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'expense_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_electric_operating_expenses_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'expense_type', name=op.f('pk_electric_operating_expenses_ferc1'))
)
op.create_table('electric_operating_revenues_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1567,8 +1654,8 @@ def upgrade() -> None:
sa.Column('avg_customers_per_month', sa.Float(), nullable=True, comment='Average number of customers per month.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'revenue_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_electric_operating_revenues_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'revenue_type', name=op.f('pk_electric_operating_revenues_ferc1'))
)
op.create_table('electric_plant_depreciation_changes_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1576,13 +1663,13 @@ def upgrade() -> None:
sa.Column('depreciation_type', sa.Text(), nullable=False, comment='Type of depreciation provision within FERC Account 108, including cost ofremoval, depreciation expenses, salvage, cost of retired plant, etc.'),
sa.Column('plant_status', sa.Text(), nullable=False, comment='Utility plant financial status (in service, future, leased, total).'),
sa.Column('utility_type', sa.Text(), nullable=False, comment='Listing of utility plant types. Examples include Electric Utility, Gas Utility, and Other Utility.'),
- sa.Column('utility_plant_value', sa.Float(), nullable=True, comment='Utility plant value.'),
+ sa.Column('dollar_value', sa.Float(), nullable=True, comment='Dollar value of reported income, expense, asset, or liability.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'depreciation_type', 'plant_status', 'utility_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_electric_plant_depreciation_changes_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'depreciation_type', 'plant_status', 'utility_type', name=op.f('pk_electric_plant_depreciation_changes_ferc1'))
)
op.create_table('electric_plant_depreciation_functional_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1595,8 +1682,8 @@ def upgrade() -> None:
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'plant_status', 'utility_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_electric_plant_depreciation_functional_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'plant_status', 'utility_type', name=op.f('pk_electric_plant_depreciation_functional_ferc1'))
)
op.create_table('electricity_sales_by_rate_schedule_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=True, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1610,7 +1697,7 @@ def upgrade() -> None:
sa.Column('kwh_per_customer', sa.Float(), nullable=True, comment='kwh per customer.'),
sa.Column('revenue_per_kwh', sa.Float(), nullable=True),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_electricity_sales_by_rate_schedule_ferc1_utility_id_ferc1_utilities_ferc1'))
)
op.create_table('epacamd_eia',
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
@@ -1620,15 +1707,37 @@ def upgrade() -> None:
sa.Column('plant_id_eia', sa.Integer(), nullable=True, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
sa.Column('boiler_id', sa.Text(), nullable=True, comment='Alphanumeric boiler ID.'),
sa.Column('generator_id', sa.Text(), nullable=True, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], )
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], name=op.f('fk_epacamd_eia_plant_id_eia_boilers_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_epacamd_eia_plant_id_eia_generators_entity_eia'))
+ )
+ op.create_table('fuel_cost_by_generator_monthly',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
+ sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
+ sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
+ sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
+ sa.Column('fuel_type_count', sa.Integer(), nullable=True, comment='A count of how many different simple energy sources there are associated with a generator.'),
+ sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
+ sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
+ sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_fuel_cost_by_generator_monthly_plant_id_eia_generators_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_fuel_cost_by_generator_monthly_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_fuel_cost_by_generator_monthly_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_fuel_cost_by_generator_monthly_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_fuel_cost_by_generator_monthly'))
)
op.create_table('fuel_receipts_costs_eia923',
sa.Column('plant_id_eia', sa.Integer(), nullable=True, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
sa.Column('report_date', sa.Date(), nullable=True, comment='Date reported.'),
sa.Column('contract_type_code', sa.Enum('S', 'C', 'NC', 'T'), nullable=True, comment='Purchase type under which receipts occurred in the reporting month. C: Contract, NC: New Contract, S: Spot Purchase, T: Tolling Agreement.'),
sa.Column('contract_expiration_date', sa.Date(), nullable=True, comment='Date contract expires.Format: MMYY.'),
- sa.Column('energy_source_code', sa.Text(), nullable=True, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=True, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('fuel_group_code', sa.Enum('petroleum', 'other_gas', 'petroleum_coke', 'natural_gas', 'coal'), nullable=True, comment='Fuel groups used in the Electric Power Monthly'),
sa.Column('mine_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL mine identifier.'),
@@ -1646,13 +1755,13 @@ def upgrade() -> None:
sa.Column('moisture_content_pct', sa.Float(), nullable=True),
sa.Column('chlorine_content_ppm', sa.Float(), nullable=True),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['contract_type_code'], ['contract_types_eia.code'], ),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['mine_id_pudl'], ['coalmine_eia923.mine_id_pudl'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.ForeignKeyConstraint(['primary_transportation_mode_code'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['secondary_transportation_mode_code'], ['fuel_transportation_modes_eia.code'], )
+ sa.ForeignKeyConstraint(['contract_type_code'], ['contract_types_eia.code'], name=op.f('fk_fuel_receipts_costs_eia923_contract_type_code_contract_types_eia')),
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_fuel_receipts_costs_eia923_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_fuel_receipts_costs_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['mine_id_pudl'], ['coalmine_eia923.mine_id_pudl'], name=op.f('fk_fuel_receipts_costs_eia923_mine_id_pudl_coalmine_eia923')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_fuel_receipts_costs_eia923_plant_id_eia_plants_entity_eia')),
+ sa.ForeignKeyConstraint(['primary_transportation_mode_code'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_fuel_receipts_costs_eia923_primary_transportation_mode_code_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['secondary_transportation_mode_code'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_fuel_receipts_costs_eia923_secondary_transportation_mode_code_fuel_transportation_modes_eia'))
)
op.create_table('generation_eia923',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
@@ -1660,9 +1769,56 @@ def upgrade() -> None:
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_generation_eia923_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_generation_eia923_plant_id_eia_generators_entity_eia')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date', name=op.f('pk_generation_eia923'))
+ )
+ op.create_table('generation_fuel_by_generator_energy_source_monthly_eia923',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
+ sa.Column('energy_source_code_num', sa.Enum('energy_source_code_1', 'energy_source_code_2', 'energy_source_code_3', 'energy_source_code_4', 'energy_source_code_5', 'energy_source_code_6', 'energy_source_code_7', 'energy_source_code_8'), nullable=True, comment='Name of the energy_source_code_N column that this energy source code was reported in for the generator referenced in the same record.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
+ sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_generation_fuel_by_generator_energy_source_monthly_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_generation_fuel_by_generator_energy_source_monthly_eia923_plant_id_eia_generators_entity_eia')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_generation_fuel_by_generator_energy_source_monthly_eia923_prime_mover_code_prime_movers_eia')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'prime_mover_code', 'energy_source_code', name=op.f('pk_generation_fuel_by_generator_energy_source_monthly_eia923'))
+ )
+ op.create_table('generation_fuel_by_generator_monthly_eia923',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
+ sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
+ sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
+ sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
+ sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_generation_fuel_by_generator_monthly_eia923_plant_id_eia_generators_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_generation_fuel_by_generator_monthly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_generation_fuel_by_generator_monthly_eia923_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_generation_fuel_by_generator_monthly_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_generation_fuel_by_generator_monthly_eia923'))
+ )
+ op.create_table('heat_rate_by_generator_monthly',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
+ sa.Column('fuel_type_count', sa.Integer(), nullable=True, comment='A count of how many different simple energy sources there are associated with a generator.'),
+ sa.Column('prime_mover_code', sa.Text(), nullable=True, comment='Code for the type of prime mover (e.g. CT, CG)'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_heat_rate_by_generator_monthly_plant_id_eia_generators_entity_eia')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_heat_rate_by_generator_monthly_prime_mover_code_prime_movers_eia')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_heat_rate_by_generator_monthly'))
)
op.create_table('income_statement_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1674,8 +1830,59 @@ def upgrade() -> None:
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'income_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_income_statement_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'income_type', name=op.f('pk_income_statement_ferc1'))
+ )
+ op.create_table('mcoe_generators_monthly',
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
+ sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
+ sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
+ sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
+ sa.Column('technology_description', sa.Text(), nullable=True, comment='High level description of the technology used by the generator to produce electricity.'),
+ sa.Column('energy_source_code_1', sa.Text(), nullable=True, comment='The code representing the most predominant type of energy that fuels the generator.'),
+ sa.Column('prime_mover_code', sa.Text(), nullable=True, comment='Code for the type of prime mover (e.g. CT, CG)'),
+ sa.Column('generator_operating_date', sa.Date(), nullable=True, comment='Date the generator began commercial operation.'),
+ sa.Column('generator_retirement_date', sa.Date(), nullable=True, comment='Date of the scheduled or effected retirement of the generator.'),
+ sa.Column('operational_status', sa.Text(), nullable=True, comment='The operating status of the asset. For generators this is based on which tab the generator was listed in in EIA 860.'),
+ sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
+ sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
+ sa.Column('planned_generator_retirement_date', sa.Date(), nullable=True, comment='Planned effective date of the scheduled retirement of the generator.'),
+ sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
+ sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
+ sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
+ sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('total_fuel_cost', sa.Float(), nullable=True, comment='Total annual reported fuel costs for the plant part. Includes costs from all fuels.'),
+ sa.Column('total_mmbtu', sa.Float(), nullable=True, comment='Total annual heat content of fuel consumed by a plant part record in the plant parts list.'),
+ sa.ForeignKeyConstraint(['energy_source_code_1'], ['energy_sources_eia.code'], name=op.f('fk_mcoe_generators_monthly_energy_source_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_mcoe_generators_monthly_plant_id_eia_generators_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_mcoe_generators_monthly_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_mcoe_generators_monthly_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], name=op.f('fk_mcoe_generators_monthly_utility_id_eia_utilities_entity_eia')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_mcoe_generators_monthly_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_mcoe_generators_monthly'))
+ )
+ op.create_table('mcoe_monthly',
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
+ sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
+ sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
+ sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('total_fuel_cost', sa.Float(), nullable=True, comment='Total annual reported fuel costs for the plant part. Includes costs from all fuels.'),
+ sa.Column('total_mmbtu', sa.Float(), nullable=True, comment='Total annual heat content of fuel consumed by a plant part record in the plant parts list.'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_mcoe_monthly_plant_id_eia_generators_entity_eia')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_mcoe_monthly'))
)
op.create_table('other_regulatory_liabilities_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=True, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1686,7 +1893,7 @@ def upgrade() -> None:
sa.Column('increase_in_other_regulatory_liabilities', sa.Float(), nullable=True, comment='The increase during the reporting period of other regulatory liabilities.'),
sa.Column('account_detail', sa.Text(), nullable=True, comment='Description of the account number credited from making debit adjustment to other regulatory liabilities.'),
sa.Column('decrease_in_other_regulatory_liabilities', sa.Float(), nullable=True, comment='The decrease during the reporting period of other regulatory liabilities.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_other_regulatory_liabilities_ferc1_utility_id_ferc1_utilities_ferc1'))
)
op.create_table('plant_in_service_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1701,8 +1908,8 @@ def upgrade() -> None:
sa.Column('transfers', sa.Float(), nullable=True, comment='Cost of transfers into (out of) the account.'),
sa.Column('ending_balance', sa.Float(), nullable=True, comment='Account balance at end of year.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'ferc_account_label')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_plant_in_service_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'ferc_account_label', name=op.f('pk_plant_in_service_ferc1'))
)
op.create_table('plants_eia860',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
@@ -1746,21 +1953,21 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('water_source', sa.Text(), nullable=True, comment='Name of water source associated with the plant.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['balancing_authority_code_eia'], ['balancing_authorities_eia.code'], ),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.ForeignKeyConstraint(['reporting_frequency_code'], ['reporting_frequencies_eia.code'], ),
- sa.ForeignKeyConstraint(['sector_id_eia'], ['sector_consolidated_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'report_date')
+ sa.ForeignKeyConstraint(['balancing_authority_code_eia'], ['balancing_authorities_eia.code'], name=op.f('fk_plants_eia860_balancing_authority_code_eia_balancing_authorities_eia')),
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_plants_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], name=op.f('fk_plants_eia860_plant_id_eia_plants_entity_eia')),
+ sa.ForeignKeyConstraint(['reporting_frequency_code'], ['reporting_frequencies_eia.code'], name=op.f('fk_plants_eia860_reporting_frequency_code_reporting_frequencies_eia')),
+ sa.ForeignKeyConstraint(['sector_id_eia'], ['sector_consolidated_eia.code'], name=op.f('fk_plants_eia860_sector_id_eia_sector_consolidated_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_plants_eia860_utility_id_eia_utilities_eia860')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', name=op.f('pk_plants_eia860'))
)
op.create_table('plants_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
sa.Column('plant_name_ferc1', sa.Text(), nullable=False, comment='Name of the plant, as reported to FERC. This is a freeform string, not guaranteed to be consistent across references to the same plant.'),
sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'plant_name_ferc1')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_plants_ferc1_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_plants_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'plant_name_ferc1', name=op.f('pk_plants_ferc1'))
)
op.create_table('purchased_power_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1779,22 +1986,21 @@ def upgrade() -> None:
sa.Column('energy_charges', sa.Float(), nullable=True, comment='Energy charges (USD).'),
sa.Column('other_charges', sa.Float(), nullable=True, comment='Other charges, including out-of-period adjustments (USD).'),
sa.Column('total_settlement', sa.Float(), nullable=True, comment='Sum of demand, energy, and other charges (USD). For power exchanges, the settlement amount for the net receipt of energy. If more energy was delivered than received, this amount is negative.'),
- sa.ForeignKeyConstraint(['purchase_type_code'], ['power_purchase_types_ferc1.code'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], )
+ sa.ForeignKeyConstraint(['purchase_type_code'], ['power_purchase_types_ferc1.code'], name=op.f('fk_purchased_power_ferc1_purchase_type_code_power_purchase_types_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_purchased_power_ferc1_utility_id_ferc1_utilities_ferc1'))
)
op.create_table('retained_earnings_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
sa.Column('report_year', sa.Integer(), nullable=False, comment='Four-digit year in which the data was reported.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
sa.Column('earnings_type', sa.Text(), nullable=False, comment='Label describing types of earnings.'),
- sa.Column('amount', sa.Float(), nullable=True, comment='Reported amount of dollars. This could be a balance or a change in value.'),
sa.Column('starting_balance', sa.Float(), nullable=True, comment='Account balance at beginning of year.'),
sa.Column('ending_balance', sa.Float(), nullable=True, comment='Account balance at end of year.'),
sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'),
sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."),
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'earnings_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_retained_earnings_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'earnings_type', name=op.f('pk_retained_earnings_ferc1'))
)
op.create_table('transmission_statistics_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -1816,19 +2022,19 @@ def upgrade() -> None:
sa.Column('opex_maintenance', sa.Float(), nullable=True, comment='Maintenance expenses for the transmission line.'),
sa.Column('opex_rents', sa.Float(), nullable=True, comment='Rent expenses for the transmission line.'),
sa.Column('opex_total', sa.Float(), nullable=True, comment='Overall expenses for the transmission line.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_transmission_statistics_ferc1_utility_id_ferc1_utilities_ferc1'))
)
op.create_table('utilities_ferc1_dbf',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=True, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
sa.Column('utility_id_ferc1_dbf', sa.Integer(), nullable=False, comment='FERC-assigned respondent_id from DBF reporting years, identifying the reporting entity. Stable from year to year.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1_dbf')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_utilities_ferc1_dbf_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1_dbf', name=op.f('pk_utilities_ferc1_dbf'))
)
op.create_table('utilities_ferc1_xbrl',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=True, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
sa.Column('utility_id_ferc1_xbrl', sa.Text(), nullable=False, comment='FERC-assigned entity_id from XBRL reporting years, identifying the reporting entity. Stable from year to year.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1_xbrl')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_utilities_ferc1_xbrl_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1_xbrl', name=op.f('pk_utilities_ferc1_xbrl'))
)
op.create_table('utility_plant_summary_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -1839,8 +2045,8 @@ def upgrade() -> None:
sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'),
sa.Column('ending_balance', sa.Float(), nullable=True, comment='Account balance at end of year.'),
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'utility_plant_asset_type')
+ sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_utility_plant_summary_ferc1_utility_id_ferc1_utilities_ferc1')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'utility_plant_asset_type', name=op.f('pk_utility_plant_summary_ferc1'))
)
op.create_table('boilers_eia860',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
@@ -1934,59 +2140,59 @@ def upgrade() -> None:
sa.Column('so2_control_proposed_strategy_3', sa.Text(), nullable=True, comment='Proposed strategy to comply with the most stringent sulfur dioxide regulation.'),
sa.Column('standard_so2_percent_scrubbed', sa.Float(), nullable=True, comment='The percent of sulfur dioxide to be scrubbed specified by the most stringent sulfur dioxide regulation.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['boiler_fuel_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_fuel_code_2'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_fuel_code_3'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_fuel_code_4'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_status'], ['boiler_status_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_type'], ['boiler_types_eia.code'], ),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['firing_type_1'], ['firing_types_eia.code'], ),
- sa.ForeignKeyConstraint(['firing_type_2'], ['firing_types_eia.code'], ),
- sa.ForeignKeyConstraint(['firing_type_3'], ['firing_types_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_1'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_2'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_3'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_4'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_5'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_6'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_1'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_2'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_3'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_manufacturer_code'], ['environmental_equipment_manufacturers_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_status_code'], ['nox_control_status_eia.code'], ),
- sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_1'], ['particulate_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_2'], ['particulate_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_3'], ['particulate_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['regulation_mercury'], ['regulations_eia.code'], ),
- sa.ForeignKeyConstraint(['regulation_nox'], ['regulations_eia.code'], ),
- sa.ForeignKeyConstraint(['regulation_particulate'], ['regulations_eia.code'], ),
- sa.ForeignKeyConstraint(['regulation_so2'], ['regulations_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['unit_nox'], ['nox_units_eia.code'], ),
- sa.ForeignKeyConstraint(['unit_particulate'], ['particulate_units_eia.code'], ),
- sa.ForeignKeyConstraint(['unit_so2'], ['so2_units_eia.code'], ),
- sa.ForeignKeyConstraint(['wet_dry_bottom'], ['wet_dry_bottom_eia.code'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'report_date')
+ sa.ForeignKeyConstraint(['boiler_fuel_code_1'], ['energy_sources_eia.code'], name=op.f('fk_boilers_eia860_boiler_fuel_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['boiler_fuel_code_2'], ['energy_sources_eia.code'], name=op.f('fk_boilers_eia860_boiler_fuel_code_2_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['boiler_fuel_code_3'], ['energy_sources_eia.code'], name=op.f('fk_boilers_eia860_boiler_fuel_code_3_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['boiler_fuel_code_4'], ['energy_sources_eia.code'], name=op.f('fk_boilers_eia860_boiler_fuel_code_4_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['boiler_status'], ['boiler_status_eia.code'], name=op.f('fk_boilers_eia860_boiler_status_boiler_status_eia')),
+ sa.ForeignKeyConstraint(['boiler_type'], ['boiler_types_eia.code'], name=op.f('fk_boilers_eia860_boiler_type_boiler_types_eia')),
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_boilers_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['firing_type_1'], ['firing_types_eia.code'], name=op.f('fk_boilers_eia860_firing_type_1_firing_types_eia')),
+ sa.ForeignKeyConstraint(['firing_type_2'], ['firing_types_eia.code'], name=op.f('fk_boilers_eia860_firing_type_2_firing_types_eia')),
+ sa.ForeignKeyConstraint(['firing_type_3'], ['firing_types_eia.code'], name=op.f('fk_boilers_eia860_firing_type_3_firing_types_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_1'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_mercury_control_existing_strategy_1_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_2'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_mercury_control_existing_strategy_2_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_3'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_mercury_control_existing_strategy_3_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_4'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_mercury_control_existing_strategy_4_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_5'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_mercury_control_existing_strategy_5_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_6'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_mercury_control_existing_strategy_6_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_1'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_mercury_control_proposed_strategy_1_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_2'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_mercury_control_proposed_strategy_2_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_3'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_mercury_control_proposed_strategy_3_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_nox_control_existing_caaa_compliance_strategy_1_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_nox_control_existing_caaa_compliance_strategy_2_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_nox_control_existing_caaa_compliance_strategy_3_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_manufacturer_code'], ['environmental_equipment_manufacturers_eia.code'], name=op.f('fk_boilers_eia860_nox_control_manufacturer_code_environmental_equipment_manufacturers_eia')),
+ sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_nox_control_out_of_compliance_strategy_1_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_nox_control_out_of_compliance_strategy_2_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_nox_control_out_of_compliance_strategy_3_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_nox_control_planned_caaa_compliance_strategy_1_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_nox_control_planned_caaa_compliance_strategy_2_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_nox_control_planned_caaa_compliance_strategy_3_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_status_code'], ['nox_control_status_eia.code'], name=op.f('fk_boilers_eia860_nox_control_status_code_nox_control_status_eia')),
+ sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_1'], ['particulate_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_particulate_control_out_of_compliance_strategy_1_particulate_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_2'], ['particulate_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_particulate_control_out_of_compliance_strategy_2_particulate_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_3'], ['particulate_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_particulate_control_out_of_compliance_strategy_3_particulate_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id'], ['boilers_entity_eia.plant_id_eia', 'boilers_entity_eia.boiler_id'], name=op.f('fk_boilers_eia860_plant_id_eia_boilers_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], name=op.f('fk_boilers_eia860_plant_id_eia_plants_eia860')),
+ sa.ForeignKeyConstraint(['regulation_mercury'], ['regulations_eia.code'], name=op.f('fk_boilers_eia860_regulation_mercury_regulations_eia')),
+ sa.ForeignKeyConstraint(['regulation_nox'], ['regulations_eia.code'], name=op.f('fk_boilers_eia860_regulation_nox_regulations_eia')),
+ sa.ForeignKeyConstraint(['regulation_particulate'], ['regulations_eia.code'], name=op.f('fk_boilers_eia860_regulation_particulate_regulations_eia')),
+ sa.ForeignKeyConstraint(['regulation_so2'], ['regulations_eia.code'], name=op.f('fk_boilers_eia860_regulation_so2_regulations_eia')),
+ sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_so2_control_existing_caaa_compliance_strategy_1_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_so2_control_existing_caaa_compliance_strategy_2_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_so2_control_existing_caaa_compliance_strategy_3_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_so2_control_out_of_compliance_strategy_1_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_so2_control_out_of_compliance_strategy_2_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_so2_control_out_of_compliance_strategy_3_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_so2_control_planned_caaa_compliance_strategy_1_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_so2_control_planned_caaa_compliance_strategy_2_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_boilers_eia860_so2_control_planned_caaa_compliance_strategy_3_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['unit_nox'], ['nox_units_eia.code'], name=op.f('fk_boilers_eia860_unit_nox_nox_units_eia')),
+ sa.ForeignKeyConstraint(['unit_particulate'], ['particulate_units_eia.code'], name=op.f('fk_boilers_eia860_unit_particulate_particulate_units_eia')),
+ sa.ForeignKeyConstraint(['unit_so2'], ['so2_units_eia.code'], name=op.f('fk_boilers_eia860_unit_so2_so2_units_eia')),
+ sa.ForeignKeyConstraint(['wet_dry_bottom'], ['wet_dry_bottom_eia.code'], name=op.f('fk_boilers_eia860_wet_dry_bottom_wet_dry_bottom_eia')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'report_date', name=op.f('pk_boilers_eia860'))
)
op.create_table('denorm_fuel_by_plant_ferc1',
sa.Column('report_year', sa.Integer(), nullable=False, comment='Four-digit year in which the data was reported.'),
@@ -2009,10 +2215,10 @@ def upgrade() -> None:
sa.Column('primary_fuel_by_mmbtu', sa.Text(), nullable=True, comment='Primary fuel for plant as a percentage of heat content.'),
sa.Column('waste_fraction_cost', sa.Float(), nullable=True, comment='Waste-heat cost as a percentage of overall fuel cost.'),
sa.Column('waste_fraction_mmbtu', sa.Float(), nullable=True, comment='Waste-heat heat content as a percentage of overall fuel heat content (MMBtu).'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_year', 'utility_id_ferc1', 'plant_name_ferc1')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_fuel_by_plant_ferc1_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_denorm_fuel_by_plant_ferc1_utility_id_ferc1_plants_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_fuel_by_plant_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_year', 'utility_id_ferc1', 'plant_name_ferc1', name=op.f('pk_denorm_fuel_by_plant_ferc1'))
)
op.create_table('denorm_fuel_ferc1',
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
@@ -2031,10 +2237,10 @@ def upgrade() -> None:
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('fuel_units', sa.Enum('mmbtu', 'gramsU', 'kg', 'mwhth', 'kgal', 'bbl', 'klbs', 'mcf', 'gal', 'mwdth', 'btu', 'ton'), nullable=True, comment='Reported unit of measure for fuel.'),
sa.Column('record_id', sa.Text(), nullable=False, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('record_id')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_fuel_ferc1_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_denorm_fuel_ferc1_utility_id_ferc1_plants_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_fuel_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('record_id', name=op.f('pk_denorm_fuel_ferc1'))
)
op.create_table('denorm_fuel_receipts_costs_yearly_eia923',
sa.Column('report_date', sa.Date(), nullable=True, comment='Date reported.'),
@@ -2057,10 +2263,10 @@ def upgrade() -> None:
sa.Column('mercury_content_ppm', sa.Float(), nullable=True, comment='Mercury content in parts per million (ppm) to the nearest 0.001 ppm.'),
sa.Column('moisture_content_pct', sa.Float(), nullable=True),
sa.Column('chlorine_content_ppm', sa.Float(), nullable=True),
- sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], )
+ sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], name=op.f('fk_denorm_fuel_receipts_costs_yearly_eia923_plant_id_eia_plants_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_fuel_receipts_costs_yearly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_fuel_receipts_costs_yearly_eia923_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_fuel_receipts_costs_yearly_eia923_utility_id_pudl_utilities_pudl'))
)
op.create_table('denorm_generation_fuel_combined_yearly_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -2070,7 +2276,7 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
sa.Column('fuel_consumed_units', sa.Float(), nullable=True, comment='Consumption of the fuel type in physical unit. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
@@ -2079,13 +2285,13 @@ def upgrade() -> None:
sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'prime_mover_code', 'energy_source_code')
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generation_fuel_combined_yearly_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], name=op.f('fk_denorm_generation_fuel_combined_yearly_eia923_plant_id_eia_plants_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_generation_fuel_combined_yearly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_denorm_generation_fuel_combined_yearly_eia923_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_generation_fuel_combined_yearly_eia923_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_generation_fuel_combined_yearly_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'prime_mover_code', 'energy_source_code', name=op.f('pk_denorm_generation_fuel_combined_yearly_eia923'))
)
op.create_table('denorm_plants_all_ferc1',
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
@@ -2166,10 +2372,10 @@ def upgrade() -> None:
sa.Column('opex_production_before_pumping', sa.Float(), nullable=True, comment='Total production expenses before pumping (USD).'),
sa.Column('opex_pumped_storage', sa.Float(), nullable=True, comment='Production expenses: pumped storage (USD).'),
sa.Column('opex_pumping', sa.Float(), nullable=True, comment='Production expenses: We are here to PUMP YOU UP! (USD).'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('record_id')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_plants_all_ferc1_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_denorm_plants_all_ferc1_utility_id_ferc1_plants_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_plants_all_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('record_id', name=op.f('pk_denorm_plants_all_ferc1'))
)
op.create_table('denorm_plants_eia',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
@@ -2226,15 +2432,15 @@ def upgrade() -> None:
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
sa.Column('balancing_authority_code_eia_consistent_rate', sa.Float(), nullable=True, comment='Percentage consistency of balancing authority code across entity records.'),
- sa.ForeignKeyConstraint(['balancing_authority_code_eia'], ['balancing_authorities_eia.code'], ),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['reporting_frequency_code'], ['reporting_frequencies_eia.code'], ),
- sa.ForeignKeyConstraint(['sector_id_eia'], ['sector_consolidated_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'report_date')
+ sa.ForeignKeyConstraint(['balancing_authority_code_eia'], ['balancing_authorities_eia.code'], name=op.f('fk_denorm_plants_eia_balancing_authority_code_eia_balancing_authorities_eia')),
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_denorm_plants_eia_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], name=op.f('fk_denorm_plants_eia_plant_id_eia_plants_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_plants_eia_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['reporting_frequency_code'], ['reporting_frequencies_eia.code'], name=op.f('fk_denorm_plants_eia_reporting_frequency_code_reporting_frequencies_eia')),
+ sa.ForeignKeyConstraint(['sector_id_eia'], ['sector_consolidated_eia.code'], name=op.f('fk_denorm_plants_eia_sector_id_eia_sector_consolidated_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_plants_eia_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_plants_eia_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', name=op.f('pk_denorm_plants_eia'))
)
op.create_table('denorm_plants_hydro_ferc1',
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
@@ -2279,10 +2485,10 @@ def upgrade() -> None:
sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
sa.Column('plant_type', sa.Text(), nullable=True),
sa.Column('project_num', sa.Integer(), nullable=True, comment='FERC Licensed Project Number.'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('record_id')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_plants_hydro_ferc1_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_denorm_plants_hydro_ferc1_utility_id_ferc1_plants_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_plants_hydro_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('record_id', name=op.f('pk_denorm_plants_hydro_ferc1'))
)
op.create_table('denorm_plants_pumped_storage_ferc1',
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
@@ -2331,10 +2537,10 @@ def upgrade() -> None:
sa.Column('plant_hours_connected_while_generating', sa.Float(), nullable=True, comment='Hours the plant was connected to load while generating in the report year.'),
sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
sa.Column('project_num', sa.Integer(), nullable=True, comment='FERC Licensed Project Number.'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('record_id')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_plants_pumped_storage_ferc1_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_denorm_plants_pumped_storage_ferc1_utility_id_ferc1_plants_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_plants_pumped_storage_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('record_id', name=op.f('pk_denorm_plants_pumped_storage_ferc1'))
)
op.create_table('denorm_plants_small_ferc1',
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
@@ -2359,10 +2565,10 @@ def upgrade() -> None:
sa.Column('opex_total_nonfuel', sa.Float(), nullable=True, comment='Total production expenses, excluding fuel (USD).'),
sa.Column('peak_demand_mw', sa.Float(), nullable=True, comment='Net peak demand for 60 minutes. Note: in some cases peak demand for other time periods may have been reported instead, if hourly peak demand was unavailable.'),
sa.Column('plant_type', sa.Text(), nullable=True),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('record_id')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_plants_small_ferc1_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_denorm_plants_small_ferc1_utility_id_ferc1_plants_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_plants_small_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('record_id', name=op.f('pk_denorm_plants_small_ferc1'))
)
op.create_table('denorm_plants_steam_ferc1',
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
@@ -2420,10 +2626,10 @@ def upgrade() -> None:
sa.Column('plant_type', sa.Text(), nullable=True),
sa.Column('record_id', sa.Text(), nullable=False, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
sa.Column('water_limited_capacity_mw', sa.Float(), nullable=True, comment='Plant capacity in MW when limited by condenser water.'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('record_id')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_plants_steam_ferc1_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_denorm_plants_steam_ferc1_utility_id_ferc1_plants_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_plants_steam_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('record_id', name=op.f('pk_denorm_plants_steam_ferc1'))
)
op.create_table('denorm_plants_utilities_eia',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -2433,11 +2639,11 @@ def upgrade() -> None:
sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'utility_id_eia')
+ sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], name=op.f('fk_denorm_plants_utilities_eia_plant_id_eia_plants_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_plants_utilities_eia_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_plants_utilities_eia_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_plants_utilities_eia_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'utility_id_eia', name=op.f('pk_denorm_plants_utilities_eia'))
)
op.create_table('denorm_plants_utilities_ferc1',
sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'),
@@ -2445,10 +2651,10 @@ def upgrade() -> None:
sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
sa.Column('utility_name_ferc1', sa.Text(), nullable=True, comment='Name of the responding utility, as it is reported in FERC Form 1. For human readability only.'),
sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('utility_id_ferc1', 'plant_name_ferc1')
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_plants_utilities_ferc1_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_denorm_plants_utilities_ferc1_utility_id_ferc1_plants_ferc1')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_plants_utilities_ferc1_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('utility_id_ferc1', 'plant_name_ferc1', name=op.f('pk_denorm_plants_utilities_ferc1'))
)
op.create_table('fuel_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -2462,7 +2668,7 @@ def upgrade() -> None:
sa.Column('fuel_cost_per_unit_burned', sa.Float(), nullable=True, comment='Average cost of fuel consumed in the report year per reported fuel unit (USD).'),
sa.Column('fuel_cost_per_unit_delivered', sa.Float(), nullable=True, comment='Average cost of fuel delivered in the report year per reported fuel unit (USD).'),
sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_fuel_ferc1_utility_id_ferc1_plants_ferc1'))
)
op.create_table('generators_eia860',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
@@ -2534,31 +2740,41 @@ def upgrade() -> None:
sa.Column('reactive_power_output_mvar', sa.Float(), nullable=True, comment='Reactive Power Output (MVAr)'),
sa.Column('ferc_qualifying_facility', sa.Boolean(), nullable=True, comment='Indicatates whether or not a generator is a qualifying FERC cogeneation facility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['energy_source_1_transport_1'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_1_transport_2'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_1_transport_3'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_2_transport_1'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_2_transport_2'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_2_transport_3'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_2'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_3'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_4'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_5'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_6'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['operational_status_code'], ['operational_status_eia.code'], ),
- sa.ForeignKeyConstraint(['planned_energy_source_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['planned_new_prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['startup_source_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['startup_source_code_2'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['startup_source_code_3'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['startup_source_code_4'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_generators_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['energy_source_1_transport_1'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_generators_eia860_energy_source_1_transport_1_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_1_transport_2'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_generators_eia860_energy_source_1_transport_2_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_1_transport_3'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_generators_eia860_energy_source_1_transport_3_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_2_transport_1'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_generators_eia860_energy_source_2_transport_1_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_2_transport_2'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_generators_eia860_energy_source_2_transport_2_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_2_transport_3'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_generators_eia860_energy_source_2_transport_3_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_1'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_energy_source_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_2'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_energy_source_code_2_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_3'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_energy_source_code_3_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_4'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_energy_source_code_4_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_5'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_energy_source_code_5_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_6'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_energy_source_code_6_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['operational_status_code'], ['operational_status_eia.code'], name=op.f('fk_generators_eia860_operational_status_code_operational_status_eia')),
+ sa.ForeignKeyConstraint(['planned_energy_source_code_1'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_planned_energy_source_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['planned_new_prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_generators_eia860_planned_new_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], name=op.f('fk_generators_eia860_plant_id_eia_generators_entity_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], name=op.f('fk_generators_eia860_plant_id_eia_plants_eia860')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_generators_eia860_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['startup_source_code_1'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_startup_source_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['startup_source_code_2'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_startup_source_code_2_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['startup_source_code_3'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_startup_source_code_3_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['startup_source_code_4'], ['energy_sources_eia.code'], name=op.f('fk_generators_eia860_startup_source_code_4_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_generators_eia860_utility_id_eia_utilities_eia860')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date', name=op.f('pk_generators_eia860'))
+ )
+ op.create_table('heat_rate_by_unit_yearly',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=False, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], name=op.f('fk_heat_rate_by_unit_yearly_plant_id_eia_plants_eia860')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'unit_id_pudl', name=op.f('pk_heat_rate_by_unit_yearly'))
)
op.create_table('plants_hydro_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -2566,7 +2782,7 @@ def upgrade() -> None:
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
sa.Column('plant_name_ferc1', sa.Text(), nullable=True, comment='Name of the plant, as reported to FERC. This is a freeform string, not guaranteed to be consistent across references to the same plant.'),
sa.Column('project_num', sa.Integer(), nullable=True, comment='FERC Licensed Project Number.'),
- sa.Column('plant_type', sa.Enum('hydro', 'run_of_river', 'run_of_river_with_storage', 'storage', 'na_category'), nullable=True),
+ sa.Column('plant_type', sa.Enum('storage', 'run_of_river', 'run_of_river_with_storage', 'na_category', 'hydro'), nullable=True),
sa.Column('construction_type', sa.Enum('conventional', 'outdoor', 'semioutdoor'), nullable=True, comment="Type of plant construction ('outdoor', 'semioutdoor', or 'conventional'). Categorized by PUDL based on our best guess of intended value in FERC1 freeform strings."),
sa.Column('construction_year', sa.Integer(), nullable=True, comment="Year the plant's oldest still operational unit was built."),
sa.Column('installation_year', sa.Integer(), nullable=True, comment="Year the plant's most recently built unit was installed."),
@@ -2598,7 +2814,7 @@ def upgrade() -> None:
sa.Column('opex_misc_plant', sa.Float(), nullable=True, comment='Production expenses: maintenance of miscellaneous hydraulic plant (USD).'),
sa.Column('opex_total', sa.Float(), nullable=True, comment='Total production expenses, excluding fuel (USD).'),
sa.Column('opex_per_mwh', sa.Float(), nullable=True, comment='Total production expenses (USD per MWh generated).'),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_plants_hydro_ferc1_utility_id_ferc1_plants_ferc1'))
)
op.create_table('plants_pumped_storage_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -2642,7 +2858,7 @@ def upgrade() -> None:
sa.Column('opex_pumping', sa.Float(), nullable=True, comment='Production expenses: We are here to PUMP YOU UP! (USD).'),
sa.Column('opex_total', sa.Float(), nullable=True, comment='Total production expenses, excluding fuel (USD).'),
sa.Column('opex_per_mwh', sa.Float(), nullable=True, comment='Total production expenses (USD per MWh generated).'),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_plants_pumped_storage_ferc1_utility_id_ferc1_plants_ferc1'))
)
op.create_table('plants_small_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -2662,7 +2878,7 @@ def upgrade() -> None:
sa.Column('opex_maintenance', sa.Float(), nullable=True, comment='Production expenses: Maintenance (USD).'),
sa.Column('fuel_type', sa.Text(), nullable=True),
sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_plants_small_ferc1_utility_id_ferc1_plants_ferc1'))
)
op.create_table('plants_steam_ferc1',
sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'),
@@ -2670,7 +2886,7 @@ def upgrade() -> None:
sa.Column('report_year', sa.Integer(), nullable=True, comment='Four-digit year in which the data was reported.'),
sa.Column('plant_id_ferc1', sa.Integer(), nullable=True, comment='Algorithmically assigned PUDL FERC Plant ID. WARNING: NOT STABLE BETWEEN PUDL DB INITIALIZATIONS.'),
sa.Column('plant_name_ferc1', sa.Text(), nullable=True, comment='Name of the plant, as reported to FERC. This is a freeform string, not guaranteed to be consistent across references to the same plant.'),
- sa.Column('plant_type', sa.Enum('combustion_turbine', 'internal_combustion', 'solar_thermal', 'nuclear', 'wind', 'combined_cycle', 'steam', 'geothermal', 'na_category', 'photovoltaic'), nullable=True),
+ sa.Column('plant_type', sa.Enum('wind', 'photovoltaic', 'nuclear', 'na_category', 'geothermal', 'combined_cycle', 'combustion_turbine', 'steam', 'solar_thermal', 'internal_combustion'), nullable=True),
sa.Column('construction_type', sa.Enum('conventional', 'outdoor', 'semioutdoor'), nullable=True, comment="Type of plant construction ('outdoor', 'semioutdoor', or 'conventional'). Categorized by PUDL based on our best guess of intended value in FERC1 freeform strings."),
sa.Column('construction_year', sa.Integer(), nullable=True, comment="Year the plant's oldest still operational unit was built."),
sa.Column('installation_year', sa.Integer(), nullable=True, comment="Year the plant's most recently built unit was installed."),
@@ -2705,7 +2921,7 @@ def upgrade() -> None:
sa.Column('opex_production_total', sa.Float(), nullable=True, comment='Total operating expenses.'),
sa.Column('opex_per_mwh', sa.Float(), nullable=True, comment='Total production expenses (USD per MWh generated).'),
sa.Column('asset_retirement_cost', sa.Float(), nullable=True, comment='Asset retirement cost (USD).'),
- sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], )
+ sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_plants_steam_ferc1_utility_id_ferc1_plants_ferc1'))
)
op.create_table('boiler_cooling_assn_eia860',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -2713,9 +2929,9 @@ def upgrade() -> None:
sa.Column('boiler_id', sa.Text(), nullable=False, comment='Alphanumeric boiler ID.'),
sa.Column('cooling_id_eia', sa.Text(), nullable=False, comment='The cooling system identification number reported to EIA.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'boiler_id', 'cooling_id_eia')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_boiler_cooling_assn_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], name=op.f('fk_boiler_cooling_assn_eia860_plant_id_eia_boilers_eia860')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'boiler_id', 'cooling_id_eia', name=op.f('pk_boiler_cooling_assn_eia860'))
)
op.create_table('boiler_emissions_control_equipment_assn_eia860',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -2724,9 +2940,9 @@ def upgrade() -> None:
sa.Column('emission_control_id_type', sa.Text(), nullable=False, comment='The type of emissions control id: so2, nox, particulate, or mercury.'),
sa.Column('emission_control_id_eia', sa.Text(), nullable=False, comment="The emission control ID used to collect so2, nox, particulate, and mercury emissions data. This column should be used in conjunction with emissions_control_type as it's not guaranteed to be unique."),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'boiler_id', 'emission_control_id_type', 'emission_control_id_eia')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_boiler_emissions_control_equipment_assn_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], name=op.f('fk_boiler_emissions_control_equipment_assn_eia860_plant_id_eia_boilers_eia860')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'boiler_id', 'emission_control_id_type', 'emission_control_id_eia', name=op.f('pk_boiler_emissions_control_equipment_assn_eia860'))
)
op.create_table('boiler_generator_assn_eia860',
sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
@@ -2739,12 +2955,12 @@ def upgrade() -> None:
sa.Column('steam_plant_type_code', sa.Integer(), nullable=True, comment='Code that describes types of steam plants from EIA 860. See steam_plant_types_eia table for more details.'),
sa.Column('bga_source', sa.Text(), nullable=True, comment='The source from where the unit_id_pudl is compiled. The unit_id_pudl comes directly from EIA 860, or string association (which looks at all the boilers and generators that are not associated with a unit and tries to find a matching string in the respective collection of boilers or generator), or from a unit connection (where the unit_id_eia is employed to find additional boiler generator connections).'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['boiler_generator_assn_type_code'], ['boiler_generator_assn_types_eia.code'], ),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['steam_plant_type_code'], ['steam_plant_types_eia.code'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'generator_id', 'boiler_id')
+ sa.ForeignKeyConstraint(['boiler_generator_assn_type_code'], ['boiler_generator_assn_types_eia.code'], name=op.f('fk_boiler_generator_assn_eia860_boiler_generator_assn_type_code_boiler_generator_assn_types_eia')),
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_boiler_generator_assn_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], name=op.f('fk_boiler_generator_assn_eia860_plant_id_eia_boilers_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_boiler_generator_assn_eia860_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['steam_plant_type_code'], ['steam_plant_types_eia.code'], name=op.f('fk_boiler_generator_assn_eia860_steam_plant_type_code_steam_plant_types_eia')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'report_date', 'generator_id', 'boiler_id', name=op.f('pk_boiler_generator_assn_eia860'))
)
op.create_table('boiler_stack_flue_assn_eia860',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -2754,8 +2970,18 @@ def upgrade() -> None:
sa.Column('flue_id_eia', sa.Text(), nullable=True, comment='The flue identification value reported to EIA. The flue is a duct, pipe, or opening that transports exhast gases through the stack. This field was reported in conjunction with stack_id_eia until 2013 when stack_flue_id_eia took their place.'),
sa.Column('stack_flue_id_eia', sa.Text(), nullable=True, comment='The stack or flue identification value reported to EIA. This denotes the place where emissions from the combusion process are released into the atmosphere. Prior to 2013, this was reported as `stack_id_eia` and `flue_id_eia`.'),
sa.Column('stack_flue_id_pudl', sa.Text(), nullable=False, comment='A stack and/or flue identification value created by PUDL for use as part of the primary key for the stack flue equipment and boiler association tables. For 2013 and onward, this value is equal to the value for stack_flue_id_eia. Prior to 2013, this value is equal to the value for stack_id_eia and the value for flue_id_eia seperated by an underscore or just the stack_flue_eia in cases where flue_id_eia is NA.'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'boiler_id', 'stack_flue_id_pudl')
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], name=op.f('fk_boiler_stack_flue_assn_eia860_plant_id_eia_boilers_eia860')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'boiler_id', 'stack_flue_id_pudl', name=op.f('pk_boiler_stack_flue_assn_eia860'))
+ )
+ op.create_table('capacity_factor_by_generator_yearly',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
+ sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_capacity_factor_by_generator_yearly_plant_id_eia_generators_eia860')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_capacity_factor_by_generator_yearly'))
)
op.create_table('denorm_boiler_fuel_yearly_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -2767,7 +2993,7 @@ def upgrade() -> None:
sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
sa.Column('boiler_id', sa.Text(), nullable=False, comment='Alphanumeric boiler ID.'),
sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='The fuel code associated with the fuel receipt. Two or three character alphanumeric.'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
sa.Column('fuel_consumed_units', sa.Float(), nullable=True, comment='Consumption of the fuel type in physical unit. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
@@ -2775,13 +3001,13 @@ def upgrade() -> None:
sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
sa.Column('sulfur_content_pct', sa.Float(), nullable=True, comment='Sulfur content percentage by weight to the nearest 0.01 percent.'),
sa.Column('ash_content_pct', sa.Float(), nullable=True, comment='Ash content percentage by weight to the nearest 0.1 percent.'),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'energy_source_code', 'prime_mover_code', 'report_date')
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_denorm_boiler_fuel_yearly_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], name=op.f('fk_denorm_boiler_fuel_yearly_eia923_plant_id_eia_boilers_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_boiler_fuel_yearly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_denorm_boiler_fuel_yearly_eia923_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_boiler_fuel_yearly_eia923_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_boiler_fuel_yearly_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'energy_source_code', 'prime_mover_code', 'report_date', name=op.f('pk_denorm_boiler_fuel_yearly_eia923'))
)
op.create_table('denorm_boilers_eia',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -2891,62 +3117,62 @@ def upgrade() -> None:
sa.Column('waste_heat_input_mmbtu_per_hour', sa.Float(), nullable=True, comment='Design waste-heat input rate at maximum continuous steam flow where a waste-heat boiler is a boiler that receives all or a substantial portion of its energy input from the noncumbustible exhaust gases of a separate fuel-burning process (MMBtu per hour).'),
sa.Column('wet_dry_bottom', sa.Text(), nullable=True, comment='Wet or Dry Bottom where Wet Bottom is defined as slag tanks that are installed at furnace throat to contain and remove molten ash from the furnace, and Dry Bottom is defined as having no slag tanks at furnace throat area, throat area is clear, and bottom ash drops through throat to bottom ash water hoppers.'),
sa.Column('zip_code', sa.Text(), nullable=True, comment='Five digit US Zip Code.'),
- sa.ForeignKeyConstraint(['boiler_fuel_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_fuel_code_2'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_fuel_code_3'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_fuel_code_4'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_manufacturer_code'], ['environmental_equipment_manufacturers_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_status'], ['boiler_status_eia.code'], ),
- sa.ForeignKeyConstraint(['boiler_type'], ['boiler_types_eia.code'], ),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['firing_type_1'], ['firing_types_eia.code'], ),
- sa.ForeignKeyConstraint(['firing_type_2'], ['firing_types_eia.code'], ),
- sa.ForeignKeyConstraint(['firing_type_3'], ['firing_types_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_1'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_2'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_3'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_4'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_5'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_existing_strategy_6'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_1'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_2'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_3'], ['mercury_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_manufacturer_code'], ['environmental_equipment_manufacturers_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['nox_control_status_code'], ['nox_control_status_eia.code'], ),
- sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_1'], ['particulate_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_2'], ['particulate_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_3'], ['particulate_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['regulation_mercury'], ['regulations_eia.code'], ),
- sa.ForeignKeyConstraint(['regulation_nox'], ['regulations_eia.code'], ),
- sa.ForeignKeyConstraint(['regulation_particulate'], ['regulations_eia.code'], ),
- sa.ForeignKeyConstraint(['regulation_so2'], ['regulations_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], ),
- sa.ForeignKeyConstraint(['unit_nox'], ['nox_units_eia.code'], ),
- sa.ForeignKeyConstraint(['unit_particulate'], ['particulate_units_eia.code'], ),
- sa.ForeignKeyConstraint(['unit_so2'], ['so2_units_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.ForeignKeyConstraint(['wet_dry_bottom'], ['wet_dry_bottom_eia.code'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'report_date')
+ sa.ForeignKeyConstraint(['boiler_fuel_code_1'], ['energy_sources_eia.code'], name=op.f('fk_denorm_boilers_eia_boiler_fuel_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['boiler_fuel_code_2'], ['energy_sources_eia.code'], name=op.f('fk_denorm_boilers_eia_boiler_fuel_code_2_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['boiler_fuel_code_3'], ['energy_sources_eia.code'], name=op.f('fk_denorm_boilers_eia_boiler_fuel_code_3_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['boiler_fuel_code_4'], ['energy_sources_eia.code'], name=op.f('fk_denorm_boilers_eia_boiler_fuel_code_4_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['boiler_manufacturer_code'], ['environmental_equipment_manufacturers_eia.code'], name=op.f('fk_denorm_boilers_eia_boiler_manufacturer_code_environmental_equipment_manufacturers_eia')),
+ sa.ForeignKeyConstraint(['boiler_status'], ['boiler_status_eia.code'], name=op.f('fk_denorm_boilers_eia_boiler_status_boiler_status_eia')),
+ sa.ForeignKeyConstraint(['boiler_type'], ['boiler_types_eia.code'], name=op.f('fk_denorm_boilers_eia_boiler_type_boiler_types_eia')),
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_denorm_boilers_eia_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['firing_type_1'], ['firing_types_eia.code'], name=op.f('fk_denorm_boilers_eia_firing_type_1_firing_types_eia')),
+ sa.ForeignKeyConstraint(['firing_type_2'], ['firing_types_eia.code'], name=op.f('fk_denorm_boilers_eia_firing_type_2_firing_types_eia')),
+ sa.ForeignKeyConstraint(['firing_type_3'], ['firing_types_eia.code'], name=op.f('fk_denorm_boilers_eia_firing_type_3_firing_types_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_1'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_mercury_control_existing_strategy_1_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_2'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_mercury_control_existing_strategy_2_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_3'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_mercury_control_existing_strategy_3_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_4'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_mercury_control_existing_strategy_4_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_5'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_mercury_control_existing_strategy_5_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_existing_strategy_6'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_mercury_control_existing_strategy_6_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_1'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_mercury_control_proposed_strategy_1_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_2'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_mercury_control_proposed_strategy_2_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['mercury_control_proposed_strategy_3'], ['mercury_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_mercury_control_proposed_strategy_3_mercury_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_existing_caaa_compliance_strategy_1_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_existing_caaa_compliance_strategy_2_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_existing_caaa_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_existing_caaa_compliance_strategy_3_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_manufacturer_code'], ['environmental_equipment_manufacturers_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_manufacturer_code_environmental_equipment_manufacturers_eia')),
+ sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_out_of_compliance_strategy_1_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_out_of_compliance_strategy_2_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_out_of_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_out_of_compliance_strategy_3_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_1'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_planned_caaa_compliance_strategy_1_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_2'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_planned_caaa_compliance_strategy_2_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_planned_caaa_compliance_strategy_3'], ['nox_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_planned_caaa_compliance_strategy_3_nox_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['nox_control_status_code'], ['nox_control_status_eia.code'], name=op.f('fk_denorm_boilers_eia_nox_control_status_code_nox_control_status_eia')),
+ sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_1'], ['particulate_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_particulate_control_out_of_compliance_strategy_1_particulate_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_2'], ['particulate_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_particulate_control_out_of_compliance_strategy_2_particulate_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['particulate_control_out_of_compliance_strategy_3'], ['particulate_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_particulate_control_out_of_compliance_strategy_3_particulate_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'boiler_id', 'report_date'], ['boilers_eia860.plant_id_eia', 'boilers_eia860.boiler_id', 'boilers_eia860.report_date'], name=op.f('fk_denorm_boilers_eia_plant_id_eia_boilers_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_boilers_eia_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['regulation_mercury'], ['regulations_eia.code'], name=op.f('fk_denorm_boilers_eia_regulation_mercury_regulations_eia')),
+ sa.ForeignKeyConstraint(['regulation_nox'], ['regulations_eia.code'], name=op.f('fk_denorm_boilers_eia_regulation_nox_regulations_eia')),
+ sa.ForeignKeyConstraint(['regulation_particulate'], ['regulations_eia.code'], name=op.f('fk_denorm_boilers_eia_regulation_particulate_regulations_eia')),
+ sa.ForeignKeyConstraint(['regulation_so2'], ['regulations_eia.code'], name=op.f('fk_denorm_boilers_eia_regulation_so2_regulations_eia')),
+ sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_so2_control_existing_caaa_compliance_strategy_1_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_so2_control_existing_caaa_compliance_strategy_2_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_existing_caaa_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_so2_control_existing_caaa_compliance_strategy_3_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_so2_control_out_of_compliance_strategy_1_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_so2_control_out_of_compliance_strategy_2_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_out_of_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_so2_control_out_of_compliance_strategy_3_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_1'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_so2_control_planned_caaa_compliance_strategy_1_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_2'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_so2_control_planned_caaa_compliance_strategy_2_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['so2_control_planned_caaa_compliance_strategy_3'], ['so2_compliance_strategies_eia.code'], name=op.f('fk_denorm_boilers_eia_so2_control_planned_caaa_compliance_strategy_3_so2_compliance_strategies_eia')),
+ sa.ForeignKeyConstraint(['unit_nox'], ['nox_units_eia.code'], name=op.f('fk_denorm_boilers_eia_unit_nox_nox_units_eia')),
+ sa.ForeignKeyConstraint(['unit_particulate'], ['particulate_units_eia.code'], name=op.f('fk_denorm_boilers_eia_unit_particulate_particulate_units_eia')),
+ sa.ForeignKeyConstraint(['unit_so2'], ['so2_units_eia.code'], name=op.f('fk_denorm_boilers_eia_unit_so2_so2_units_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_boilers_eia_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_boilers_eia_utility_id_pudl_utilities_pudl')),
+ sa.ForeignKeyConstraint(['wet_dry_bottom'], ['wet_dry_bottom_eia.code'], name=op.f('fk_denorm_boilers_eia_wet_dry_bottom_wet_dry_bottom_eia')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'boiler_id', 'report_date', name=op.f('pk_denorm_boilers_eia'))
)
op.create_table('denorm_generation_yearly_eia923',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -2959,11 +3185,11 @@ def upgrade() -> None:
sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date')
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_denorm_generation_yearly_eia923_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_generation_yearly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_generation_yearly_eia923_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_generation_yearly_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date', name=op.f('pk_denorm_generation_yearly_eia923'))
)
op.create_table('denorm_generators_eia',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -3068,32 +3294,32 @@ def upgrade() -> None:
sa.Column('winter_capacity_mw', sa.Float(), nullable=True, comment='The net winter capacity.'),
sa.Column('winter_estimated_capability_mw', sa.Float(), nullable=True, comment='EIA estimated winter capacity (in MWh).'),
sa.Column('zip_code', sa.Text(), nullable=True, comment='Five digit US Zip Code.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['energy_source_1_transport_1'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_1_transport_2'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_1_transport_3'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_2_transport_1'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_2_transport_2'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_2_transport_3'], ['fuel_transportation_modes_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_2'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_3'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_4'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_5'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['energy_source_code_6'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['operational_status_code'], ['operational_status_eia.code'], ),
- sa.ForeignKeyConstraint(['planned_energy_source_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['planned_new_prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['startup_source_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['startup_source_code_2'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['startup_source_code_3'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['startup_source_code_4'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_denorm_generators_eia_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['energy_source_1_transport_1'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_1_transport_1_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_1_transport_2'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_1_transport_2_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_1_transport_3'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_1_transport_3_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_2_transport_1'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_2_transport_1_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_2_transport_2'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_2_transport_2_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_2_transport_3'], ['fuel_transportation_modes_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_2_transport_3_fuel_transportation_modes_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_1'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_2'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_code_2_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_3'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_code_3_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_4'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_code_4_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_5'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_code_5_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['energy_source_code_6'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_energy_source_code_6_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['operational_status_code'], ['operational_status_eia.code'], name=op.f('fk_denorm_generators_eia_operational_status_code_operational_status_eia')),
+ sa.ForeignKeyConstraint(['planned_energy_source_code_1'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_planned_energy_source_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['planned_new_prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_denorm_generators_eia_planned_new_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_denorm_generators_eia_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_generators_eia_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_denorm_generators_eia_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['startup_source_code_1'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_startup_source_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['startup_source_code_2'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_startup_source_code_2_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['startup_source_code_3'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_startup_source_code_3_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['startup_source_code_4'], ['energy_sources_eia.code'], name=op.f('fk_denorm_generators_eia_startup_source_code_4_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_generators_eia_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_generators_eia_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('plant_id_eia', 'generator_id', 'report_date', name=op.f('pk_denorm_generators_eia'))
)
op.create_table('denorm_ownership_eia860',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -3106,19 +3332,158 @@ def upgrade() -> None:
sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
sa.Column('owner_utility_id_eia', sa.Integer(), nullable=False, comment="EIA-assigned owner's identification number."),
sa.Column('owner_name', sa.Text(), nullable=True, comment='Name of owner.'),
- sa.Column('owner_state', sa.Enum('VA', 'VI', 'SK', 'PR', 'MT', 'DC', 'VT', 'KY', 'NY', 'KS', 'ME', 'ON', 'WY', 'NU', 'MN', 'WV', 'AL', 'LA', 'MP', 'QC', 'SC', 'SD', 'NE', 'TN', 'NM', 'YT', 'OH', 'AB', 'MO', 'NC', 'NS', 'CA', 'MD', 'NB', 'FL', 'BC', 'ID', 'IN', 'NL', 'GA', 'OK', 'UT', 'IA', 'MI', 'NH', 'NV', 'IL', 'NJ', 'AZ', 'MS', 'PE', 'MA', 'AK', 'CO', 'RI', 'GU', 'ND', 'PA', 'TX', 'HI', 'WI', 'NT', 'OR', 'DE', 'WA', 'MB', 'AS', 'AR', 'CT'), nullable=True, comment='Two letter ISO-3166 political subdivision code.'),
+ sa.Column('owner_state', sa.Enum('GU', 'WI', 'AZ', 'RI', 'MO', 'SC', 'KS', 'PE', 'UT', 'PA', 'ME', 'NH', 'SD', 'LA', 'NJ', 'DC', 'FL', 'IL', 'MS', 'ND', 'BC', 'NL', 'NU', 'OH', 'CT', 'NC', 'VI', 'SK', 'NY', 'NV', 'NE', 'IA', 'AK', 'HI', 'ON', 'TN', 'VA', 'AR', 'DE', 'AS', 'NS', 'GA', 'TX', 'MA', 'OR', 'QC', 'MT', 'WV', 'IN', 'MP', 'MB', 'MI', 'KY', 'ID', 'WY', 'NM', 'NB', 'AL', 'MD', 'AB', 'WA', 'YT', 'CA', 'CO', 'MN', 'OK', 'PR', 'NT', 'VT'), nullable=True, comment='Two letter ISO-3166 political subdivision code.'),
sa.Column('owner_city', sa.Text(), nullable=True, comment='City of owner.'),
sa.Column('owner_country', sa.Enum('USA', 'CAN'), nullable=True, comment='Three letter ISO-3166 country code.'),
sa.Column('owner_street_address', sa.Text(), nullable=True, comment='Steet address of owner.'),
sa.Column('owner_zip_code', sa.Text(), nullable=True, comment='Zip code of owner.'),
- sa.Column('fraction_owned', sa.Float(), nullable=True, comment='Proportion of generator ownership.'),
+ sa.Column('fraction_owned', sa.Float(), nullable=True, comment='Proportion of generator ownership attributable to this utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'owner_utility_id_eia')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_denorm_ownership_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_denorm_ownership_eia860_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_denorm_ownership_eia860_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_denorm_ownership_eia860_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_denorm_ownership_eia860_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'owner_utility_id_eia', name=op.f('pk_denorm_ownership_eia860'))
+ )
+ op.create_table('fuel_cost_by_generator_yearly',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
+ sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
+ sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
+ sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
+ sa.Column('fuel_type_count', sa.Integer(), nullable=True, comment='A count of how many different simple energy sources there are associated with a generator.'),
+ sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
+ sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
+ sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_fuel_cost_by_generator_yearly_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_fuel_cost_by_generator_yearly_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_fuel_cost_by_generator_yearly_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_fuel_cost_by_generator_yearly_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_fuel_cost_by_generator_yearly'))
+ )
+ op.create_table('generation_fuel_by_generator_energy_source_owner_yearly_eia923',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
+ sa.Column('ownership_record_type', sa.Enum('owned', 'total'), nullable=False, comment='Whether each generator record is for one owner or represents a total of all ownerships.'),
+ sa.Column('fraction_owned', sa.Float(), nullable=True, comment='Proportion of generator ownership attributable to this utility.'),
+ sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
+ sa.Column('energy_source_code_num', sa.Enum('energy_source_code_1', 'energy_source_code_2', 'energy_source_code_3', 'energy_source_code_4', 'energy_source_code_5', 'energy_source_code_6', 'energy_source_code_7', 'energy_source_code_8'), nullable=True, comment='Name of the energy_source_code_N column that this energy source code was reported in for the generator referenced in the same record.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
+ sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_generation_fuel_by_generator_energy_source_owner_yearly_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_generation_fuel_by_generator_energy_source_owner_yearly_eia923_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_generation_fuel_by_generator_energy_source_owner_yearly_eia923_prime_mover_code_prime_movers_eia')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'prime_mover_code', 'energy_source_code', 'utility_id_eia', 'ownership_record_type', name=op.f('pk_generation_fuel_by_generator_energy_source_owner_yearly_eia923'))
+ )
+ op.create_table('generation_fuel_by_generator_energy_source_yearly_eia923',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
+ sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
+ sa.Column('energy_source_code_num', sa.Enum('energy_source_code_1', 'energy_source_code_2', 'energy_source_code_3', 'energy_source_code_4', 'energy_source_code_5', 'energy_source_code_6', 'energy_source_code_7', 'energy_source_code_8'), nullable=True, comment='Name of the energy_source_code_N column that this energy source code was reported in for the generator referenced in the same record.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
+ sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
+ sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], name=op.f('fk_generation_fuel_by_generator_energy_source_yearly_eia923_energy_source_code_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_generation_fuel_by_generator_energy_source_yearly_eia923_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_generation_fuel_by_generator_energy_source_yearly_eia923_prime_mover_code_prime_movers_eia')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'prime_mover_code', 'energy_source_code', name=op.f('pk_generation_fuel_by_generator_energy_source_yearly_eia923'))
+ )
+ op.create_table('generation_fuel_by_generator_yearly_eia923',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
+ sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
+ sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
+ sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
+ sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_generation_fuel_by_generator_yearly_eia923_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_generation_fuel_by_generator_yearly_eia923_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_generation_fuel_by_generator_yearly_eia923_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_generation_fuel_by_generator_yearly_eia923_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_generation_fuel_by_generator_yearly_eia923'))
+ )
+ op.create_table('heat_rate_by_generator_yearly',
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
+ sa.Column('fuel_type_count', sa.Integer(), nullable=True, comment='A count of how many different simple energy sources there are associated with a generator.'),
+ sa.Column('prime_mover_code', sa.Text(), nullable=True, comment='Code for the type of prime mover (e.g. CT, CG)'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_heat_rate_by_generator_yearly_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_heat_rate_by_generator_yearly_prime_mover_code_prime_movers_eia')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_heat_rate_by_generator_yearly'))
+ )
+ op.create_table('mcoe_generators_yearly',
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
+ sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
+ sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
+ sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
+ sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
+ sa.Column('technology_description', sa.Text(), nullable=True, comment='High level description of the technology used by the generator to produce electricity.'),
+ sa.Column('energy_source_code_1', sa.Text(), nullable=True, comment='The code representing the most predominant type of energy that fuels the generator.'),
+ sa.Column('prime_mover_code', sa.Text(), nullable=True, comment='Code for the type of prime mover (e.g. CT, CG)'),
+ sa.Column('generator_operating_date', sa.Date(), nullable=True, comment='Date the generator began commercial operation.'),
+ sa.Column('generator_retirement_date', sa.Date(), nullable=True, comment='Date of the scheduled or effected retirement of the generator.'),
+ sa.Column('operational_status', sa.Text(), nullable=True, comment='The operating status of the asset. For generators this is based on which tab the generator was listed in in EIA 860.'),
+ sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
+ sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
+ sa.Column('planned_generator_retirement_date', sa.Date(), nullable=True, comment='Planned effective date of the scheduled retirement of the generator.'),
+ sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
+ sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
+ sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
+ sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('total_fuel_cost', sa.Float(), nullable=True, comment='Total annual reported fuel costs for the plant part. Includes costs from all fuels.'),
+ sa.Column('total_mmbtu', sa.Float(), nullable=True, comment='Total annual heat content of fuel consumed by a plant part record in the plant parts list.'),
+ sa.ForeignKeyConstraint(['energy_source_code_1'], ['energy_sources_eia.code'], name=op.f('fk_mcoe_generators_yearly_energy_source_code_1_energy_sources_eia')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_mcoe_generators_yearly_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_mcoe_generators_yearly_plant_id_pudl_plants_pudl')),
+ sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], name=op.f('fk_mcoe_generators_yearly_prime_mover_code_prime_movers_eia')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_mcoe_generators_yearly_utility_id_eia_utilities_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_mcoe_generators_yearly_utility_id_pudl_utilities_pudl')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_mcoe_generators_yearly'))
+ )
+ op.create_table('mcoe_yearly',
+ sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
+ sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
+ sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
+ sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
+ sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
+ sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
+ sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
+ sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
+ sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
+ sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
+ sa.Column('total_fuel_cost', sa.Float(), nullable=True, comment='Total annual reported fuel costs for the plant part. Includes costs from all fuels.'),
+ sa.Column('total_mmbtu', sa.Float(), nullable=True, comment='Total annual heat content of fuel consumed by a plant part record in the plant parts list.'),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_mcoe_yearly_plant_id_eia_generators_eia860')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', name=op.f('pk_mcoe_yearly'))
)
op.create_table('ownership_eia860',
sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
@@ -3127,17 +3492,17 @@ def upgrade() -> None:
sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
sa.Column('owner_utility_id_eia', sa.Integer(), nullable=False, comment="EIA-assigned owner's identification number."),
sa.Column('owner_name', sa.Text(), nullable=True, comment='Name of owner.'),
- sa.Column('owner_state', sa.Enum('VA', 'VI', 'SK', 'PR', 'MT', 'DC', 'VT', 'KY', 'NY', 'KS', 'ME', 'ON', 'WY', 'NU', 'MN', 'WV', 'AL', 'LA', 'MP', 'QC', 'SC', 'SD', 'NE', 'TN', 'NM', 'YT', 'OH', 'AB', 'MO', 'NC', 'NS', 'CA', 'MD', 'NB', 'FL', 'BC', 'ID', 'IN', 'NL', 'GA', 'OK', 'UT', 'IA', 'MI', 'NH', 'NV', 'IL', 'NJ', 'AZ', 'MS', 'PE', 'MA', 'AK', 'CO', 'RI', 'GU', 'ND', 'PA', 'TX', 'HI', 'WI', 'NT', 'OR', 'DE', 'WA', 'MB', 'AS', 'AR', 'CT'), nullable=True, comment='Two letter ISO-3166 political subdivision code.'),
+ sa.Column('owner_state', sa.Enum('GU', 'WI', 'AZ', 'RI', 'MO', 'SC', 'KS', 'PE', 'UT', 'PA', 'ME', 'NH', 'SD', 'LA', 'NJ', 'DC', 'FL', 'IL', 'MS', 'ND', 'BC', 'NL', 'NU', 'OH', 'CT', 'NC', 'VI', 'SK', 'NY', 'NV', 'NE', 'IA', 'AK', 'HI', 'ON', 'TN', 'VA', 'AR', 'DE', 'AS', 'NS', 'GA', 'TX', 'MA', 'OR', 'QC', 'MT', 'WV', 'IN', 'MP', 'MB', 'MI', 'KY', 'ID', 'WY', 'NM', 'NB', 'AL', 'MD', 'AB', 'WA', 'YT', 'CA', 'CO', 'MN', 'OK', 'PR', 'NT', 'VT'), nullable=True, comment='Two letter ISO-3166 political subdivision code.'),
sa.Column('owner_city', sa.Text(), nullable=True, comment='City of owner.'),
sa.Column('owner_country', sa.Enum('USA', 'CAN'), nullable=True, comment='Three letter ISO-3166 country code.'),
sa.Column('owner_street_address', sa.Text(), nullable=True, comment='Steet address of owner.'),
sa.Column('owner_zip_code', sa.Text(), nullable=True, comment='Zip code of owner.'),
- sa.Column('fraction_owned', sa.Float(), nullable=True, comment='Proportion of generator ownership.'),
+ sa.Column('fraction_owned', sa.Float(), nullable=True, comment='Proportion of generator ownership attributable to this utility.'),
sa.Column('data_maturity', sa.Text(), nullable=True, comment='Level of maturity of the data record. Some data sources report less-than-final data. PUDL sometimes includes this data, but use at your own risk.'),
- sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'owner_utility_id_eia')
+ sa.ForeignKeyConstraint(['data_maturity'], ['data_maturities.code'], name=op.f('fk_ownership_eia860_data_maturity_data_maturities')),
+ sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], name=op.f('fk_ownership_eia860_plant_id_eia_generators_eia860')),
+ sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], name=op.f('fk_ownership_eia860_utility_id_eia_utilities_eia860')),
+ sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'owner_utility_id_eia', name=op.f('pk_ownership_eia860'))
)
# ### end Alembic commands ###
@@ -3145,11 +3510,19 @@ def upgrade() -> None:
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('ownership_eia860')
+ op.drop_table('mcoe_yearly')
+ op.drop_table('mcoe_generators_yearly')
+ op.drop_table('heat_rate_by_generator_yearly')
+ op.drop_table('generation_fuel_by_generator_yearly_eia923')
+ op.drop_table('generation_fuel_by_generator_energy_source_yearly_eia923')
+ op.drop_table('generation_fuel_by_generator_energy_source_owner_yearly_eia923')
+ op.drop_table('fuel_cost_by_generator_yearly')
op.drop_table('denorm_ownership_eia860')
op.drop_table('denorm_generators_eia')
op.drop_table('denorm_generation_yearly_eia923')
op.drop_table('denorm_boilers_eia')
op.drop_table('denorm_boiler_fuel_yearly_eia923')
+ op.drop_table('capacity_factor_by_generator_yearly')
op.drop_table('boiler_stack_flue_assn_eia860')
op.drop_table('boiler_generator_assn_eia860')
op.drop_table('boiler_emissions_control_equipment_assn_eia860')
@@ -3158,6 +3531,7 @@ def downgrade() -> None:
op.drop_table('plants_small_ferc1')
op.drop_table('plants_pumped_storage_ferc1')
op.drop_table('plants_hydro_ferc1')
+ op.drop_table('heat_rate_by_unit_yearly')
op.drop_table('generators_eia860')
op.drop_table('fuel_ferc1')
op.drop_table('denorm_plants_utilities_ferc1')
@@ -3183,9 +3557,15 @@ def downgrade() -> None:
op.drop_table('plants_eia860')
op.drop_table('plant_in_service_ferc1')
op.drop_table('other_regulatory_liabilities_ferc1')
+ op.drop_table('mcoe_monthly')
+ op.drop_table('mcoe_generators_monthly')
op.drop_table('income_statement_ferc1')
+ op.drop_table('heat_rate_by_generator_monthly')
+ op.drop_table('generation_fuel_by_generator_monthly_eia923')
+ op.drop_table('generation_fuel_by_generator_energy_source_monthly_eia923')
op.drop_table('generation_eia923')
op.drop_table('fuel_receipts_costs_eia923')
+ op.drop_table('fuel_cost_by_generator_monthly')
op.drop_table('epacamd_eia')
op.drop_table('electricity_sales_by_rate_schedule_ferc1')
op.drop_table('electric_plant_depreciation_functional_ferc1')
@@ -3219,6 +3599,7 @@ def downgrade() -> None:
op.drop_table('denorm_balance_sheet_liabilities_ferc1')
op.drop_table('denorm_balance_sheet_assets_ferc1')
op.drop_table('cash_flow_ferc1')
+ op.drop_table('capacity_factor_by_generator_monthly')
op.drop_table('boiler_fuel_eia923')
op.drop_table('balance_sheet_liabilities_ferc1')
op.drop_table('balance_sheet_assets_ferc1')
@@ -3229,6 +3610,7 @@ def downgrade() -> None:
op.drop_table('utilities_ferc1')
op.drop_table('utilities_eia860')
op.drop_table('utilities_eia')
+ op.drop_table('summarized_demand_ferc714')
op.drop_table('service_territory_eia861')
op.drop_table('sales_eia861')
op.drop_table('reliability_eia861')
@@ -3240,10 +3622,12 @@ def downgrade() -> None:
op.drop_table('net_metering_misc_eia861')
op.drop_table('net_metering_customer_fuel_class_eia861')
op.drop_table('mergers_eia861')
+ op.drop_table('heat_rate_by_unit_monthly')
op.drop_table('green_pricing_eia861')
op.drop_table('generators_entity_eia')
op.drop_table('generation_fuel_nuclear_eia923')
op.drop_table('generation_fuel_eia923')
+ op.drop_table('fipsified_respondents_ferc714')
op.drop_table('energy_efficiency_eia861')
op.drop_table('emissions_control_equipment_eia860')
op.drop_table('dynamic_pricing_eia861')
@@ -3277,6 +3661,7 @@ def downgrade() -> None:
op.drop_table('reporting_frequencies_eia')
op.drop_table('regulations_eia')
op.drop_table('prime_movers_eia')
+ op.drop_table('predicted_state_hourly_demand')
op.drop_table('power_purchase_types_ferc1')
op.drop_table('political_subdivisions')
op.drop_table('plants_pudl')
@@ -3301,6 +3686,8 @@ def downgrade() -> None:
op.drop_table('datasources')
op.drop_table('data_maturities')
op.drop_table('contract_types_eia')
+ op.drop_table('compiled_geometry_utility_eia861')
+ op.drop_table('compiled_geometry_balancing_authority_eia861')
op.drop_table('coalmine_types_eia')
op.drop_table('boiler_types_eia')
op.drop_table('boiler_status_eia')
diff --git a/migrations/versions/1ec25c296a6d_add_service_terrtory_ferc714_state_.py b/migrations/versions/1ec25c296a6d_add_service_terrtory_ferc714_state_.py
deleted file mode 100644
index f3b0a370cd..0000000000
--- a/migrations/versions/1ec25c296a6d_add_service_terrtory_ferc714_state_.py
+++ /dev/null
@@ -1,99 +0,0 @@
-"""Add service terrtory, FERC714, state demand assets
-
-Revision ID: 1ec25c296a6d
-Revises: 88d9201ae4c4
-Create Date: 2023-06-16 09:33:08.254754
-
-"""
-from alembic import op
-import sqlalchemy as sa
-from sqlalchemy.dialects import sqlite
-
-# revision identifiers, used by Alembic.
-revision = '1ec25c296a6d'
-down_revision = 'e608f95a3b78'
-branch_labels = None
-depends_on = None
-
-
-def upgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- op.create_table('compiled_geometry_balancing_authority_eia861',
- sa.Column('county_id_fips', sa.Text(), nullable=False, comment='County ID from the Federal Information Processing Standard Publication 6-4.'),
- sa.Column('county_name_census', sa.Text(), nullable=True, comment='County name as specified in Census DP1 Data.'),
- sa.Column('population', sa.Float(), nullable=True, comment='County population, sourced from Census DP1 data.'),
- sa.Column('area_km2', sa.Float(), nullable=True, comment='County area in km2.'),
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('balancing_authority_id_eia', sa.Integer(), nullable=False, comment='EIA balancing authority ID. This is often (but not always!) the same as the utility ID associated with the same legal entity.'),
- sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
- sa.Column('county', sa.Text(), nullable=False, comment='County name.'),
- sa.Column('state_id_fips', sa.Text(), nullable=True, comment='Two digit state FIPS code.'),
- sa.PrimaryKeyConstraint('balancing_authority_id_eia', 'report_date', 'county_id_fips', 'county')
- )
- op.create_table('compiled_geometry_utility_eia861',
- sa.Column('county_id_fips', sa.Text(), nullable=False, comment='County ID from the Federal Information Processing Standard Publication 6-4.'),
- sa.Column('county_name_census', sa.Text(), nullable=True, comment='County name as specified in Census DP1 Data.'),
- sa.Column('population', sa.Float(), nullable=True, comment='County population, sourced from Census DP1 data.'),
- sa.Column('area_km2', sa.Float(), nullable=True, comment='County area in km2.'),
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
- sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
- sa.Column('county', sa.Text(), nullable=True, comment='County name.'),
- sa.Column('state_id_fips', sa.Text(), nullable=True, comment='Two digit state FIPS code.'),
- sa.PrimaryKeyConstraint('utility_id_eia', 'report_date', 'county_id_fips')
- )
- op.create_table('predicted_state_hourly_demand',
- sa.Column('state_id_fips', sa.Text(), nullable=False, comment='Two digit state FIPS code.'),
- sa.Column('utc_datetime', sqlite.DATETIME(), nullable=False),
- sa.Column('demand_mwh', sa.Float(), nullable=True),
- sa.Column('scaled_demand_mwh', sa.Float(), nullable=True, comment='Estimated electricity demand scaled by the total sales within a state.'),
- sa.PrimaryKeyConstraint('state_id_fips', 'utc_datetime')
- )
- op.create_table('fipsified_respondents_ferc714',
- sa.Column('eia_code', sa.Integer(), nullable=True),
- sa.Column('respondent_type', sa.Enum('utility', 'balancing_authority'), nullable=True),
- sa.Column('respondent_id_ferc714', sa.Integer(), nullable=True),
- sa.Column('respondent_name_ferc714', sa.Text(), nullable=True),
- sa.Column('report_date', sa.Date(), nullable=True, comment='Date reported.'),
- sa.Column('balancing_authority_id_eia', sa.Integer(), nullable=True, comment='EIA balancing authority ID. This is often (but not always!) the same as the utility ID associated with the same legal entity.'),
- sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
- sa.Column('balancing_authority_name_eia', sa.Text(), nullable=True, comment='Name of the balancing authority.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
- sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('state', sa.Text(), nullable=True, comment='Two letter US state abbreviation.'),
- sa.Column('county', sa.Text(), nullable=True, comment='County name.'),
- sa.Column('state_id_fips', sa.Text(), nullable=True, comment='Two digit state FIPS code.'),
- sa.Column('county_id_fips', sa.Text(), nullable=True, comment='County ID from the Federal Information Processing Standard Publication 6-4.'),
- sa.ForeignKeyConstraint(['respondent_id_ferc714'], ['respondent_id_ferc714.respondent_id_ferc714'], )
- )
- op.create_table('summarized_demand_ferc714',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('respondent_id_ferc714', sa.Integer(), nullable=False),
- sa.Column('demand_annual_mwh', sa.Float(), nullable=True),
- sa.Column('population', sa.Float(), nullable=True, comment='County population, sourced from Census DP1 data.'),
- sa.Column('area_km2', sa.Float(), nullable=True, comment='County area in km2.'),
- sa.Column('population_density_km2', sa.Float(), nullable=True, comment='Average population per sq. km area of a service territory.'),
- sa.Column('demand_annual_per_capita_mwh', sa.Float(), nullable=True, comment='Per-capita annual demand, averaged using Census county-level population estimates.'),
- sa.Column('demand_density_mwh_km2', sa.Float(), nullable=True, comment='Annual demand per km2 of a given service territory.'),
- sa.Column('eia_code', sa.Integer(), nullable=True),
- sa.Column('respondent_type', sa.Enum('utility', 'balancing_authority'), nullable=True),
- sa.Column('respondent_name_ferc714', sa.Text(), nullable=True),
- sa.Column('balancing_authority_id_eia', sa.Integer(), nullable=True, comment='EIA balancing authority ID. This is often (but not always!) the same as the utility ID associated with the same legal entity.'),
- sa.Column('balancing_authority_code_eia', sa.Text(), nullable=True, comment='EIA short code identifying a balancing authority.'),
- sa.Column('balancing_authority_name_eia', sa.Text(), nullable=True, comment='Name of the balancing authority.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
- sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.ForeignKeyConstraint(['respondent_id_ferc714'], ['respondent_id_ferc714.respondent_id_ferc714'], ),
- sa.PrimaryKeyConstraint('respondent_id_ferc714', 'report_date')
- )
- # ### end Alembic commands ###
-
-
-def downgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- op.drop_table('summarized_demand_ferc714')
- op.drop_table('fipsified_respondents_ferc714')
- op.drop_table('predicted_state_hourly_demand')
- op.drop_table('compiled_geometry_utility_eia861')
- op.drop_table('compiled_geometry_balancing_authority_eia861')
- # ### end Alembic commands ###
diff --git a/migrations/versions/28bb2b27e2cf_add_mcoe_table.py b/migrations/versions/28bb2b27e2cf_add_mcoe_table.py
deleted file mode 100644
index 5ebcbcf22e..0000000000
--- a/migrations/versions/28bb2b27e2cf_add_mcoe_table.py
+++ /dev/null
@@ -1,250 +0,0 @@
-"""add mcoe table
-
-Revision ID: 28bb2b27e2cf
-Revises: e2670d0ec0eb
-Create Date: 2023-08-11 10:12:15.950150
-
-"""
-from alembic import op
-import sqlalchemy as sa
-
-
-# revision identifiers, used by Alembic.
-revision = '28bb2b27e2cf'
-down_revision = 'e2670d0ec0eb'
-branch_labels = None
-depends_on = None
-
-
-def upgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- op.create_table('heat_rate_by_unit_monthly',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=False, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.ForeignKeyConstraint(['plant_id_eia'], ['plants_entity_eia.plant_id_eia'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'unit_id_pudl')
- )
- op.create_table('capacity_factor_by_generator_monthly',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
- sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('fuel_cost_by_generator_monthly',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
- sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
- sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.Column('fuel_type_count', sa.Integer(), nullable=True, comment='A count of how many different simple energy sources there are associated with a generator.'),
- sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
- sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
- sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('heat_rate_by_generator_monthly',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
- sa.Column('fuel_type_count', sa.Integer(), nullable=True, comment='A count of how many different simple energy sources there are associated with a generator.'),
- sa.Column('prime_mover_code', sa.Text(), nullable=True, comment='Code for the type of prime mover (e.g. CT, CG)'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('mcoe_generators_monthly',
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
- sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
- sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('technology_description', sa.Text(), nullable=True, comment='High level description of the technology used by the generator to produce electricity.'),
- sa.Column('energy_source_code_1', sa.Text(), nullable=True, comment='The code representing the most predominant type of energy that fuels the generator.'),
- sa.Column('prime_mover_code', sa.Text(), nullable=True, comment='Code for the type of prime mover (e.g. CT, CG)'),
- sa.Column('generator_operating_date', sa.Date(), nullable=True, comment='Date the generator began commercial operation.'),
- sa.Column('generator_retirement_date', sa.Date(), nullable=True, comment='Date of the scheduled or effected retirement of the generator.'),
- sa.Column('operational_status', sa.Text(), nullable=True, comment='The operating status of the asset. For generators this is based on which tab the generator was listed in in EIA 860.'),
- sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
- sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
- sa.Column('planned_generator_retirement_date', sa.Date(), nullable=True, comment='Planned effective date of the scheduled retirement of the generator.'),
- sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
- sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
- sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
- sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('total_fuel_cost', sa.Float(), nullable=True, comment='Total annual reported fuel costs for the plant part. Includes costs from all fuels.'),
- sa.Column('total_mmbtu', sa.Float(), nullable=True, comment='Total annual heat content of fuel consumed by a plant part record in the plant parts list.'),
- sa.ForeignKeyConstraint(['energy_source_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('mcoe_monthly',
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
- sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
- sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
- sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('total_fuel_cost', sa.Float(), nullable=True, comment='Total annual reported fuel costs for the plant part. Includes costs from all fuels.'),
- sa.Column('total_mmbtu', sa.Float(), nullable=True, comment='Total annual heat content of fuel consumed by a plant part record in the plant parts list.'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('heat_rate_by_unit_yearly',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=False, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'report_date'], ['plants_eia860.plant_id_eia', 'plants_eia860.report_date'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'unit_id_pudl')
- )
- op.create_table('capacity_factor_by_generator_yearly',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
- sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('fuel_cost_by_generator_yearly',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
- sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
- sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.Column('fuel_type_count', sa.Integer(), nullable=True, comment='A count of how many different simple energy sources there are associated with a generator.'),
- sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
- sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
- sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('heat_rate_by_generator_yearly',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
- sa.Column('fuel_type_count', sa.Integer(), nullable=True, comment='A count of how many different simple energy sources there are associated with a generator.'),
- sa.Column('prime_mover_code', sa.Text(), nullable=True, comment='Code for the type of prime mover (e.g. CT, CG)'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('mcoe_generators_yearly',
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
- sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
- sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('technology_description', sa.Text(), nullable=True, comment='High level description of the technology used by the generator to produce electricity.'),
- sa.Column('energy_source_code_1', sa.Text(), nullable=True, comment='The code representing the most predominant type of energy that fuels the generator.'),
- sa.Column('prime_mover_code', sa.Text(), nullable=True, comment='Code for the type of prime mover (e.g. CT, CG)'),
- sa.Column('generator_operating_date', sa.Date(), nullable=True, comment='Date the generator began commercial operation.'),
- sa.Column('generator_retirement_date', sa.Date(), nullable=True, comment='Date of the scheduled or effected retirement of the generator.'),
- sa.Column('operational_status', sa.Text(), nullable=True, comment='The operating status of the asset. For generators this is based on which tab the generator was listed in in EIA 860.'),
- sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
- sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'),
- sa.Column('planned_generator_retirement_date', sa.Date(), nullable=True, comment='Planned effective date of the scheduled retirement of the generator.'),
- sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
- sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
- sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
- sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('total_fuel_cost', sa.Float(), nullable=True, comment='Total annual reported fuel costs for the plant part. Includes costs from all fuels.'),
- sa.Column('total_mmbtu', sa.Float(), nullable=True, comment='Total annual heat content of fuel consumed by a plant part record in the plant parts list.'),
- sa.ForeignKeyConstraint(['energy_source_code_1'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('mcoe_yearly',
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('capacity_factor', sa.Float(), nullable=True, comment='Fraction of potential generation that was actually reported for a plant part.'),
- sa.Column('fuel_cost_from_eiaapi', sa.Boolean(), nullable=True, comment='Indicates whether the fuel cost was derived from the EIA API.'),
- sa.Column('fuel_cost_per_mmbtu', sa.Float(), nullable=True, comment='Average fuel cost per mmBTU of heat content in nominal USD.'),
- sa.Column('fuel_cost_per_mwh', sa.Float(), nullable=True, comment='Derived from MCOE, a unit level value. Average fuel cost per MWh of heat content in nominal USD.'),
- sa.Column('heat_rate_mmbtu_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('total_fuel_cost', sa.Float(), nullable=True, comment='Total annual reported fuel costs for the plant part. Includes costs from all fuels.'),
- sa.Column('total_mmbtu', sa.Float(), nullable=True, comment='Total annual heat content of fuel consumed by a plant part record in the plant parts list.'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- # ### end Alembic commands ###
-
-
-def downgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- op.drop_table('mcoe_yearly')
- op.drop_table('mcoe_generators_yearly')
- op.drop_table('heat_rate_by_generator_yearly')
- op.drop_table('fuel_cost_by_generator_yearly')
- op.drop_table('capacity_factor_by_generator_yearly')
- op.drop_table('heat_rate_by_unit_yearly')
- op.drop_table('mcoe_monthly')
- op.drop_table('mcoe_generators_monthly')
- op.drop_table('heat_rate_by_generator_monthly')
- op.drop_table('fuel_cost_by_generator_monthly')
- op.drop_table('capacity_factor_by_generator_monthly')
- op.drop_table('heat_rate_by_unit_monthly')
- # ### end Alembic commands ###
diff --git a/migrations/versions/8c0a49eb9098_dagsterize_net_gen_allocation_revision.py b/migrations/versions/8c0a49eb9098_dagsterize_net_gen_allocation_revision.py
deleted file mode 100644
index 0a11ee7605..0000000000
--- a/migrations/versions/8c0a49eb9098_dagsterize_net_gen_allocation_revision.py
+++ /dev/null
@@ -1,118 +0,0 @@
-"""dagsterize net gen allocation revision
-
-Revision ID: 8c0a49eb9098
-Revises: e608f95a3b78
-Create Date: 2023-06-23 11:00:51.387245
-
-"""
-from alembic import op
-import sqlalchemy as sa
-
-
-# revision identifiers, used by Alembic.
-revision = '8c0a49eb9098'
-down_revision = 'e608f95a3b78'
-branch_labels = None
-depends_on = None
-
-
-def upgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- op.create_table('generation_fuel_by_generator_energy_source_monthly_eia923',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
- sa.Column('energy_source_code_num', sa.Enum('energy_source_code_1', 'energy_source_code_2', 'energy_source_code_3', 'energy_source_code_4', 'energy_source_code_5', 'energy_source_code_6', 'energy_source_code_7', 'energy_source_code_8'), nullable=True, comment='Name of the energy_source_code_N column that this energy source code was reported in for the generator referenced in the same record.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
- sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'prime_mover_code', 'energy_source_code')
- )
- op.create_table('generation_fuel_by_generator_monthly_eia923',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
- sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
- sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
- sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id'], ['generators_entity_eia.plant_id_eia', 'generators_entity_eia.generator_id'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia'], ['utilities_entity_eia.utility_id_eia'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- op.create_table('generation_fuel_by_generator_energy_source_owner_yearly_eia923',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=False, comment='The EIA Utility Identification number.'),
- sa.Column('ownership_record_type', sa.Enum('owned', 'total'), nullable=False, comment='Whether each generator record is for one owner or represents a total of all ownerships.'),
- sa.Column('fraction_owned', sa.Float(), nullable=True, comment='Proportion of generator ownership attributable to this utility.'),
- sa.Column('capacity_mw', sa.Float(), nullable=True, comment='Total installed (nameplate) capacity, in megawatts.'),
- sa.Column('energy_source_code_num', sa.Enum('energy_source_code_1', 'energy_source_code_2', 'energy_source_code_3', 'energy_source_code_4', 'energy_source_code_5', 'energy_source_code_6', 'energy_source_code_7', 'energy_source_code_8'), nullable=True, comment='Name of the energy_source_code_N column that this energy source code was reported in for the generator referenced in the same record.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
- sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'prime_mover_code', 'energy_source_code', 'utility_id_eia', 'ownership_record_type')
- )
- op.create_table('generation_fuel_by_generator_energy_source_yearly_eia923',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('prime_mover_code', sa.Text(), nullable=False, comment='Code for the type of prime mover (e.g. CT, CG)'),
- sa.Column('energy_source_code', sa.Text(), nullable=False, comment='A 2-3 letter code indicating the energy source (e.g. fuel type) associated with the record.'),
- sa.Column('energy_source_code_num', sa.Enum('energy_source_code_1', 'energy_source_code_2', 'energy_source_code_3', 'energy_source_code_4', 'energy_source_code_5', 'energy_source_code_6', 'energy_source_code_7', 'energy_source_code_8'), nullable=True, comment='Name of the energy_source_code_N column that this energy source code was reported in for the generator referenced in the same record.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
- sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
- sa.ForeignKeyConstraint(['energy_source_code'], ['energy_sources_eia.code'], ),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['prime_mover_code'], ['prime_movers_eia.code'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id', 'prime_mover_code', 'energy_source_code')
- )
- op.create_table('generation_fuel_by_generator_yearly_eia923',
- sa.Column('report_date', sa.Date(), nullable=False, comment='Date reported.'),
- sa.Column('plant_id_eia', sa.Integer(), nullable=False, comment='The unique six-digit facility identification number, also called an ORISPL, assigned by the Energy Information Administration.'),
- sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'),
- sa.Column('plant_name_eia', sa.Text(), nullable=True, comment='Plant name.'),
- sa.Column('utility_id_eia', sa.Integer(), nullable=True, comment='The EIA Utility Identification number.'),
- sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'),
- sa.Column('utility_name_eia', sa.Text(), nullable=True, comment='The name of the utility.'),
- sa.Column('generator_id', sa.Text(), nullable=False, comment='Generator ID is usually numeric, but sometimes includes letters. Make sure you treat it as a string!'),
- sa.Column('unit_id_pudl', sa.Integer(), nullable=True, comment='Dynamically assigned PUDL unit id. WARNING: This ID is not guaranteed to be static long term as the input data and algorithm may evolve over time.'),
- sa.Column('fuel_consumed_for_electricity_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel to produce electricity, in physical unit, year to date.'),
- sa.Column('fuel_consumed_mmbtu', sa.Float(), nullable=True, comment='Total consumption of fuel in physical unit, year to date. Note: this is the total quantity consumed for both electricity and, in the case of combined heat and power plants, process steam production.'),
- sa.Column('net_generation_mwh', sa.Float(), nullable=True, comment='Net electricity generation for the specified period in megawatt-hours (MWh).'),
- sa.ForeignKeyConstraint(['plant_id_eia', 'generator_id', 'report_date'], ['generators_eia860.plant_id_eia', 'generators_eia860.generator_id', 'generators_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], ),
- sa.ForeignKeyConstraint(['utility_id_eia', 'report_date'], ['utilities_eia860.utility_id_eia', 'utilities_eia860.report_date'], ),
- sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], ),
- sa.PrimaryKeyConstraint('report_date', 'plant_id_eia', 'generator_id')
- )
- # ### end Alembic commands ###
-
-
-def downgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- op.drop_table('generation_fuel_by_generator_yearly_eia923')
- op.drop_table('generation_fuel_by_generator_energy_source_yearly_eia923')
- op.drop_table('generation_fuel_by_generator_energy_source_owner_yearly_eia923')
- op.drop_table('generation_fuel_by_generator_monthly_eia923')
- op.drop_table('generation_fuel_by_generator_energy_source_monthly_eia923')
- # ### end Alembic commands ###
diff --git a/migrations/versions/9a32db1fbe6e_rename_to_dollar_amount.py b/migrations/versions/9a32db1fbe6e_rename_to_dollar_amount.py
deleted file mode 100644
index 3cd7c9ff86..0000000000
--- a/migrations/versions/9a32db1fbe6e_rename_to_dollar_amount.py
+++ /dev/null
@@ -1,42 +0,0 @@
-"""rename to dollar amount
-
-Revision ID: 9a32db1fbe6e
-Revises: 88d9201ae4c4
-Create Date: 2023-06-13 15:11:44.266717
-
-"""
-from alembic import op
-import sqlalchemy as sa
-
-
-# revision identifiers, used by Alembic.
-revision = '9a32db1fbe6e'
-down_revision = '1ec25c296a6d'
-branch_labels = None
-depends_on = None
-
-
-def upgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- with op.batch_alter_table('denorm_electric_plant_depreciation_changes_ferc1', schema=None) as batch_op:
- batch_op.add_column(sa.Column('dollar_value', sa.Float(), nullable=True, comment='Dollar value of reported income, expense, asset, or liability.'))
- batch_op.drop_column('utility_plant_value')
-
- with op.batch_alter_table('electric_plant_depreciation_changes_ferc1', schema=None) as batch_op:
- batch_op.add_column(sa.Column('dollar_value', sa.Float(), nullable=True, comment='Dollar value of reported income, expense, asset, or liability.'))
- batch_op.drop_column('utility_plant_value')
-
- # ### end Alembic commands ###
-
-
-def downgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- with op.batch_alter_table('electric_plant_depreciation_changes_ferc1', schema=None) as batch_op:
- batch_op.add_column(sa.Column('utility_plant_value', sa.FLOAT(), nullable=True))
- batch_op.drop_column('dollar_value')
-
- with op.batch_alter_table('denorm_electric_plant_depreciation_changes_ferc1', schema=None) as batch_op:
- batch_op.add_column(sa.Column('utility_plant_value', sa.FLOAT(), nullable=True))
- batch_op.drop_column('dollar_value')
-
- # ### end Alembic commands ###
diff --git a/migrations/versions/e2670d0ec0eb_.py b/migrations/versions/e2670d0ec0eb_.py
deleted file mode 100644
index cbb81d1df5..0000000000
--- a/migrations/versions/e2670d0ec0eb_.py
+++ /dev/null
@@ -1,24 +0,0 @@
-"""empty message
-
-Revision ID: e2670d0ec0eb
-Revises: 8c0a49eb9098, 9a32db1fbe6e
-Create Date: 2023-07-10 10:58:58.580305
-
-"""
-from alembic import op
-import sqlalchemy as sa
-
-
-# revision identifiers, used by Alembic.
-revision = 'e2670d0ec0eb'
-down_revision = ('8c0a49eb9098', '9a32db1fbe6e')
-branch_labels = None
-depends_on = None
-
-
-def upgrade() -> None:
- pass
-
-
-def downgrade() -> None:
- pass
diff --git a/migrations/versions/e608f95a3b78_drop_amount_from_retained_earnings.py b/migrations/versions/e608f95a3b78_drop_amount_from_retained_earnings.py
deleted file mode 100644
index 1538ee596f..0000000000
--- a/migrations/versions/e608f95a3b78_drop_amount_from_retained_earnings.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""drop amount from retained earnings
-
-Revision ID: e608f95a3b78
-Revises: 3c458b36094e
-Create Date: 2023-06-19 09:04:49.591285
-
-"""
-from alembic import op
-import sqlalchemy as sa
-
-
-# revision identifiers, used by Alembic.
-revision = 'e608f95a3b78'
-down_revision = '3c458b36094e'
-branch_labels = None
-depends_on = None
-
-
-def upgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- with op.batch_alter_table('denorm_retained_earnings_ferc1', schema=None) as batch_op:
- batch_op.drop_column('amount')
-
- with op.batch_alter_table('retained_earnings_ferc1', schema=None) as batch_op:
- batch_op.drop_column('amount')
-
- # ### end Alembic commands ###
-
-
-def downgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- with op.batch_alter_table('retained_earnings_ferc1', schema=None) as batch_op:
- batch_op.add_column(sa.Column('amount', sa.FLOAT(), nullable=True))
-
- with op.batch_alter_table('denorm_retained_earnings_ferc1', schema=None) as batch_op:
- batch_op.add_column(sa.Column('amount', sa.FLOAT(), nullable=True))
-
- # ### end Alembic commands ###
diff --git a/notebooks/work-in-progress/CEMS_by_utility.ipynb b/notebooks/work-in-progress/CEMS_by_utility.ipynb
index d3d4c26aa7..c8a085ac32 100644
--- a/notebooks/work-in-progress/CEMS_by_utility.ipynb
+++ b/notebooks/work-in-progress/CEMS_by_utility.ipynb
@@ -1,6 +1,7 @@
{
"cells": [
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -43,13 +44,12 @@
"metadata": {},
"outputs": [],
"source": [
- "pudl_settings = pudl.workspace.setup.get_defaults()\n",
- "#display(pudl_settings)\n",
+ "from pudl.workspace.setup import PudlPaths\n",
"\n",
- "ferc1_engine = sa.create_engine(pudl_settings['ferc1_db'])\n",
- "#display(ferc1_engine)\n",
"\n",
- "pudl_engine = sa.create_engine(pudl_settings['pudl_db'])\n",
+ "ferc1_engine = sa.create_engine(PudlPaths().sqlite_db(\"ferc1\"))\n",
+ "\n",
+ "pudl_engine = sa.create_engine(PudlPaths().pudl_db())\n",
"#display(pudl_engine)\n",
"\n",
"#pudl_engine.table_names()\n",
@@ -57,6 +57,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -76,6 +77,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -160,6 +162,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -215,7 +218,7 @@
"\n",
"# for yr in years:\n",
"# print(f'starting calculation for {yr}')\n",
- "# epacems_path = (pudl_settings['parquet_dir'] + f'/epacems/year={yr}')\n",
+ "# epacems_path = (PudlPaths().output_dir + f'/epacems/year={yr}')\n",
"# cems_dd = (\n",
"# dd.read_parquet(epacems_path, columns=my_cols)\n",
"# .assign(state=lambda x: x['state'].astype('string'))\n",
@@ -299,6 +302,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -331,6 +335,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
diff --git a/notebooks/work-in-progress/better-heatrates.ipynb b/notebooks/work-in-progress/better-heatrates.ipynb
index bbce86000b..4547c5ba3d 100644
--- a/notebooks/work-in-progress/better-heatrates.ipynb
+++ b/notebooks/work-in-progress/better-heatrates.ipynb
@@ -1,6 +1,7 @@
{
"cells": [
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -71,6 +72,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -78,6 +80,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -116,6 +119,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -165,6 +169,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -213,6 +218,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -239,6 +245,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -246,6 +253,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -278,6 +286,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"tags": []
@@ -311,11 +320,12 @@
}
],
"source": [
- "pudl_settings = pudl.workspace.setup.get_defaults()\n",
- "display(pudl_settings)\n",
"\n",
- "ferc1_engine = sa.create_engine(pudl_settings['ferc1_db'])\n",
- "pudl_engine = sa.create_engine(pudl_settings['pudl_db'])\n",
+ "from pudl.workspace.setup import PudlPaths\n",
+ "\n",
+ "# TODO(janrous): provide property for accessing ferc db?\n",
+ "ferc1_engine = sa.create_engine(PudlPaths().sqlite_db(\"ferc1\"))\n",
+ "pudl_engine = sa.create_engine(PudlPaths().pudl_db)\n",
"\n",
"API_KEY_EIA = os.environ[\"API_KEY_EIA\"]\n",
"\n",
@@ -323,6 +333,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -384,6 +395,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -421,6 +433,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -431,6 +444,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -442,6 +456,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -480,6 +495,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"tags": []
@@ -548,6 +564,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -569,6 +586,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -584,6 +602,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -597,6 +616,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -608,6 +628,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -618,6 +639,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -705,6 +727,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -713,6 +736,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
@@ -728,6 +752,7 @@
"source": []
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
diff --git a/notebooks/work-in-progress/eia_column_changes_through_time.ipynb b/notebooks/work-in-progress/eia_column_changes_through_time.ipynb
index 3054a4089e..bed0633cef 100644
--- a/notebooks/work-in-progress/eia_column_changes_through_time.ipynb
+++ b/notebooks/work-in-progress/eia_column_changes_through_time.ipynb
@@ -1,16 +1,19 @@
{
"cells": [
{
+ "attachments": {},
"cell_type": "markdown",
+ "metadata": {},
"source": [
"# EIA923 Column Changes\n",
"This notebook reimplements the excel extractor process to extract each sheet of each excel file separately. This preserves the original structure for easier comparison."
- ],
- "metadata": {}
+ ]
},
{
"cell_type": "code",
"execution_count": 1,
+ "metadata": {},
+ "outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2\n",
@@ -20,74 +23,67 @@
"import pandas as pd\n",
"pd.options.display.max_columns = 150\n",
"pd.options.display.max_rows = 150"
- ],
- "outputs": [],
- "metadata": {}
+ ]
},
{
"cell_type": "code",
"execution_count": 2,
- "source": [
- "# make notebooks full width\n",
- "from IPython.core.display import display, HTML\n",
- "display(HTML(\"\"))"
- ],
+ "metadata": {},
"outputs": [
{
- "output_type": "display_data",
"data": {
- "text/plain": [
- ""
- ],
"text/html": [
""
+ ],
+ "text/plain": [
+ ""
]
},
- "metadata": {}
+ "metadata": {},
+ "output_type": "display_data"
}
],
- "metadata": {}
- },
- {
- "cell_type": "code",
- "execution_count": 3,
"source": [
- "pudl_settings = pudl.workspace.setup.get_defaults()"
- ],
- "outputs": [],
- "metadata": {}
+ "# make notebooks full width\n",
+ "from IPython.core.display import display, HTML\n",
+ "display(HTML(\"\"))"
+ ]
},
{
"cell_type": "code",
"execution_count": 4,
+ "metadata": {},
+ "outputs": [],
"source": [
"eia923_tables = pc.PUDL_TABLES['eia923']\n",
"eia923_years = list(range(2001, 2020))"
- ],
- "outputs": [],
- "metadata": {}
+ ]
},
{
"cell_type": "code",
"execution_count": 5,
- "source": [
- "ds = pudl.workspace.datastore.Datastore(local_cache_path=Path(pudl_settings[\"data_dir\"]))"
- ],
+ "metadata": {},
"outputs": [],
- "metadata": {}
+ "source": [
+ "from pudl.workspace.setup import PudlPaths\n",
+ "\n",
+ "ds = pudl.workspace.datastore.Datastore(local_cache_path=PudlPaths().data_dir)"
+ ]
},
{
"cell_type": "code",
"execution_count": 6,
+ "metadata": {},
+ "outputs": [],
"source": [
"eia923_extractor = pudl.extract.eia923.Extractor(ds)"
- ],
- "outputs": [],
- "metadata": {}
+ ]
},
{
"cell_type": "code",
"execution_count": 7,
+ "metadata": {},
+ "outputs": [],
"source": [
"dfs = {}\n",
"# Lightly altered extractor code (pudl.extract.excel.GenericExtractor.extract) to avoid concatenating prematurely\n",
@@ -110,21 +106,16 @@
" newdata = eia923_extractor.process_raw(newdata, page, **partition)\n",
" newdata = eia923_extractor.process_renamed(newdata, page, **partition)\n",
" dfs[partition['year']][page] = newdata"
- ],
- "outputs": [],
- "metadata": {}
+ ]
},
{
"cell_type": "code",
"execution_count": 8,
- "source": [
- "for k, v in dfs.items():\n",
- " print(k, v.keys())"
- ],
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
"name": "stdout",
+ "output_type": "stream",
"text": [
"2001 dict_keys(['generation_fuel', 'stocks'])\n",
"2002 dict_keys(['generation_fuel', 'stocks'])\n",
@@ -148,11 +139,16 @@
]
}
],
- "metadata": {}
+ "source": [
+ "for k, v in dfs.items():\n",
+ " print(k, v.keys())"
+ ]
},
{
"cell_type": "code",
"execution_count": 23,
+ "metadata": {},
+ "outputs": [],
"source": [
"# make dataframes of columns. One df per excel sheet, one row per year\n",
"from collections import defaultdict\n",
@@ -163,70 +159,32 @@
" col_dfs[page].append(dfs[year][page].columns.to_frame().rename(columns={0: year}))\n",
" except KeyError:\n",
" continue"
- ],
- "outputs": [],
- "metadata": {}
+ ]
},
{
"cell_type": "code",
"execution_count": 24,
+ "metadata": {},
+ "outputs": [],
"source": [
"col_dfs = {k : pd.concat(v, axis=1).T for k, v in col_dfs.items()}"
- ],
- "outputs": [],
- "metadata": {}
+ ]
},
{
+ "attachments": {},
"cell_type": "markdown",
+ "metadata": {},
"source": [
"This shows the state of the columns for each year for each sheet. When a column is introduced (or disappears), that entry will be NaN. This particular page only has data from 2011 on."
- ],
- "metadata": {}
+ ]
},
{
"cell_type": "code",
"execution_count": 35,
- "source": [
- "col_dfs['plant_frame']"
- ],
+ "metadata": {},
"outputs": [
{
- "output_type": "execute_result",
"data": {
- "text/plain": [
- " report_year plant_id_eia plant_name_eia plant_state eia_sector \\\n",
- "2011 report_year plant_id_eia plant_name_eia plant_state eia_sector \n",
- "2012 report_year plant_id_eia plant_name_eia plant_state eia_sector \n",
- "2013 report_year plant_id_eia plant_name_eia plant_state eia_sector \n",
- "2014 report_year plant_id_eia plant_name_eia plant_state eia_sector \n",
- "2015 report_year plant_id_eia plant_name_eia plant_state eia_sector \n",
- "2016 report_year plant_id_eia plant_name_eia plant_state eia_sector \n",
- "2017 report_year plant_id_eia plant_name_eia plant_state eia_sector \n",
- "2018 report_year plant_id_eia plant_name_eia plant_state eia_sector \n",
- "2019 report_year plant_id_eia plant_name_eia plant_state eia_sector \n",
- "\n",
- " sector_name naics_code combined_heat_power reporting_frequency \\\n",
- "2011 sector_name naics_code combined_heat_power reporting_frequency \n",
- "2012 NaN naics_code combined_heat_power reporting_frequency \n",
- "2013 sector_name naics_code combined_heat_power reporting_frequency \n",
- "2014 NaN naics_code combined_heat_power reporting_frequency \n",
- "2015 NaN naics_code combined_heat_power reporting_frequency \n",
- "2016 NaN naics_code combined_heat_power reporting_frequency \n",
- "2017 NaN naics_code combined_heat_power reporting_frequency \n",
- "2018 NaN naics_code combined_heat_power reporting_frequency \n",
- "2019 NaN naics_code combined_heat_power reporting_frequency \n",
- "\n",
- " nameplate_capacity_mw \n",
- "2011 nameplate_capacity_mw \n",
- "2012 NaN \n",
- "2013 NaN \n",
- "2014 NaN \n",
- "2015 NaN \n",
- "2016 NaN \n",
- "2017 NaN \n",
- "2018 NaN \n",
- "2019 NaN "
- ],
"text/html": [
"
\n",
"\n","
\n"," \n","
\n","
\n","
state
\n","
report_date
\n","
bulk_agg_fuel_cost_per_mmbtu
\n","
fuel_type_code_pudl
\n","
\n"," \n"," \n","
\n","
0
\n","
AK
\n","
2012-01-01
\n","
0.0
\n","
coal
\n","
\n","
\n","
1
\n","
AK
\n","
2012-02-01
\n","
0.0
\n","
coal
\n","
\n","
\n","
2
\n","
AK
\n","
2012-03-01
\n","
0.0
\n","
coal
\n","
\n","
\n","
3
\n","
AK
\n","
2012-04-01
\n","
0.0
\n","
coal
\n","
\n","
\n","
4
\n","
AK
\n","
2012-05-01
\n","
0.0
\n","
coal
\n","
\n"," \n","
\n","
"],"text/plain":[" state report_date bulk_agg_fuel_cost_per_mmbtu fuel_type_code_pudl\n","0 AK 2012-01-01 0.0 coal\n","1 AK 2012-02-01 0.0 coal\n","2 AK 2012-03-01 0.0 coal\n","3 AK 2012-04-01 0.0 coal\n","4 AK 2012-05-01 0.0 coal"]},"execution_count":12,"metadata":{},"output_type":"execute_result"}],"source":["bulk_df.head()"]},{"cell_type":"code","execution_count":13,"metadata":{},"outputs":[{"data":{"text/html":["
"]},"metadata":{"needs_background":"light"},"output_type":"display_data"}],"source":["diff.abs().replace(np.inf, np.nan).replace(0, np.nan).transform(np.log10).hist(bins=100)"]},{"cell_type":"code","execution_count":40,"metadata":{},"outputs":[],"source":["import matplotlib.pyplot as plt"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[{"data":{"text/plain":["state True\n","report_date True\n","fuel_type_code_pudl True\n","fuel_cost_from_eiaapi True\n","dtype: bool"]},"metadata":{},"output_type":"display_data"}],"source":["# data is all in same order\n","frc_api.drop(columns=['fuel_cost_per_mmbtu', 'fuel_cost_per_unit']).eq(\n"," frc_bulk.drop(columns=['fuel_cost_per_mmbtu', 'bulk_agg_fuel_cost_per_mmbtu'])\n",").all()"]},{"cell_type":"code","execution_count":42,"metadata":{},"outputs":[{"data":{"text/plain":[""]},"execution_count":42,"metadata":{},"output_type":"execute_result"},{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAApiElEQVR4nO3deXhc133e8e+ZFYPBDPaN2LmTkriI0GJLsrVZki3ZjBQvsrPVdqLGjRM3TZtYdZs0TZ3YjZ88ceukCqv4sRWrdtNY8iLJ1i5LskVJpERRFDdxJwiS2JfZl3v6BxaDJAguGGJmgPfzPHyIubg49wdg8M6Zc8+9x1hrERGR4uXKdwEiIjI7CnIRkSKnIBcRKXIKchGRIqcgFxEpcp58HLSmpsa2t7fn49AiIkVr69atfdba2tO35yXI29vb2bJlSz4OLSJStIwxh6fbrqEVEZEipyAXESlyCnIRkSKnIBcRKXIKchGRIqcgFxEpcgpyEZEipyAXEZkjjmOJJjM4Tm5vH64gFxGZI/F0lq7BGPF0NqftKshFRC6hqb3wgNdNc2UpAa87p8dQkIuIXEJTe+EulyHo9+BymZweQ0EuIpJjc9ELn0pBLiKSY3PRC59KQS4ikmNz0QufKi+3sRURmc8meuFzdrw5O5KIiFwSCnIRkSKnIBcRKXI5GcQxxhwCRoEskLHWduaiXRERObdcjsbfZK3ty2F7IiIFwXEs8XSWgNd9SacRXiwNrYiInMOlukdKruQqyC3wlDFmqzHmvhy1KSJSEOZ6XviFytXQynXW2m5jTB3wtDFmt7X2xak7jAf8fQCtra05OqyISG5NN4wy1/PCL1ROeuTW2u7x/3uAR4Grp9lnk7W201rbWVtbm4vDiojkzMT9UaLJTEEPo0xn1kFujAkaY0ITHwO3ATtm266IyFxxHEtfJMmR/hhAQQ+jTCcX7xXqgUeNMRPt/R9r7U9z0K6IyCU1MYziOJb+aJLqMv8lv8HVpTDrILfWHgDW5qAWEZE5M9EL748maa4opbUqWLDTC8+lcEfvRUQuoXg6S38kVbS98KkU5CKyIDiOZTSRJpHOUh30E/C6aa0uLdpe+FS6IEhE5r2JYZQd3cNsPtDPQCw1Jws+zBX1yEVk3jr9ZObimiBLa8uoKvXlu7ScUpCLyLyUyTh0DcWIJrO0VhX3ycxz0dCKiMxLA7EUO4+PEPS7Cfo982YYZTrqkYvIvDH18vqqUh+dbVVUlfrmbYBPUI9cRIpeJuPQM5JgNJ6evLze43FRFy7B45n/MTf/v0MRmdccx9I1FGPL4QHimWzRXV6fCxpaEZGiNHGTq1gqw2giw+rGMDVB/4LogZ9OQS4iRSWVytI9Eqc84OVwfwzHWporS6kp88/7sfCzWXgvXSJS1I4Nx/jJ9uMMRJMsqS1jWV1oQYc4qEcuIkVgYhgFIBzwsnJRmKqgn1DAm+fKCoOCXEQKXjSZYcexYfxeF8vqQlzdUb3gTmjOREEuIgVr6iX2fq+LporAvL6w52IpyEWkoKRSWQ4PRgCoKSuhZzTJovIAKxrC8/YS+9lSkItIwXAcy76+CI9tOwYu+NiGlsl54Qrws8tZkBtj3MAW4Ji19q5ctSsiC0c8nSXrWO64ooGAz01TeSk+n8bCzyWXPfIvALuAcA7bFJEFYGJueENZCYtry9QDv0A5mUdujGkG7gQezEV7IjL/pVJZDvSOMjiapGs4xrO7ejgRSehk5kXI1QVBfwv8MeCcbQdjzH3GmC3GmC29vb05OqyIFKvDgxG+u/kwrx/pp7LExy2r6lgUDuS7rKI06yA3xtwF9Fhrt860n7V2k7W201rbWVtbO9vDikiRmri4x7EWr8fQEC6hPOijvaZM4+EXKRdj5NcBHzHGfAgoAcLGmO9Ya389B22LyDwx9SZXA9E0DeEAH7+qjUXhgIZSZmnWQW6tvR+4H8AYcyPw7xXiIjJhIsCjqQzdQ3Gw0FxVSnmpj8oyf77Lmxc0j1xELplMxuHoYJRjgzFKPF5aqgOU+ub3smv5kNMgt9a+ALyQyzZFpPg4jmU0MbZaz87uYarK/CytD1AbKlGAXwLqkYtIzkwE+EA0SddQnJ7hJJctKqepspRQiVchfokoyEUkJ1KpLPv6IvSNJuiPpljTXM7yuhDVC3TVnrmkIBeRWYvF0jy79yTv9oxy68p6VjSEFeBzSD9lEZkVx7G8cWyIn759nDK/h5bqIPXlAYX4HFKPXEQuSiqV5chQFGstfh/ce00bKxtClAd8+S5twVGQi8gFm7jd7JM7jlMV9PL+FfW0tgR1MjNPFOQicl4yGYeBWIqqUh/JrEPWsdy6up6qUh/1ujozrxTkInJOmYzD3pMj7DoxwvVLa6kN6XazhURBLiIzSiQybDk6yJGBCJWlfkrGwzvoV3wUCv0mRGRasViat48P0RdNsuXgILesqueK5gpCJd58lyanUZCLyCkmrs589WA//++1w9SF/dy0qpHO1ipKShQZhUi/FRGZFImm+PmBXvpiCcgafrWzhbaaIEuqQ7pXeAFTkIsIjmPpGYrxf7ce5aW9PXTUBrn3qnbWtlTqwp4ioCAXWcAyGYfDg6NsPzrEvpOjvLS3j5tW1nHbFQ0sqylXiBcJBbnIApXJOOzoHuSfXjnIruMjbGit4Dfe28HtqxoIa8GHoqIgF1mAEokMrx7u55V3e0gk0mxc38ytq+tpqwypF16EFOQiC0gkmuK1I/0MRBO8dmCI2pCPT1y7mKvbqjUjpYjN+jdnjCkBXgT84+39i7X2z2bbrojkztBogp/sPMbe4yO8un+ApqpS7lzXzIbWShrLS9ULL3K5eAlOAjdbayPGGC/wsjHmJ9bazTloW0RmqWcoypcf38GLe/pwu2F9WzUfv7qFGxbXqxc+T8z6t2ittUBk/KF3/J+dbbsiMjuxWJqfHz7JP79ylJ/tHaAx7OHDVzaxcV0zHTVh9cLnkZy8HBtj3MBWYCnwd9baV6fZ5z7gPoDW1tZcHFZEzmIkkuTbr+zn+28cZSiaYUN7mM9c38ENSxvUC5+HcvIbtdZmgXXGmArgUWPM5dbaHaftswnYBNDZ2akeu8glkEpl2dM7xGPbjvPU9qP4XW5+ZUMzn35vBy3VId2pcJ7K6UuztXbIGPMCcAew4xy7i0gOjUSSfHfrIZ58+wTD8RRXdtRy+2WNXL+kjtJS3ehqPsvFrJVaID0e4gHgVuCrs65MRM7Lod4h/v65vQyPJthxfJRkFj5yZQu/874l1IdL1QtfAHLRI28Evj0+Tu4C/tla+1gO2hWRGaRSWX5x4Dj/5Yc7ODSYBeDO1VW8f2UDt61qpCJUkucKZa7kYtbKdmB9DmoRkfO0+3gf/+0HO9nRNcpQdqwH9cHlYf7zh6+gobIs3+XJHNPpa5Eiksk4vN3Vzx/8ny0cHXEAWNsY4FPXtXDnqjbKglrBfiFSkIsUib7hGN/ZfIDHt3dzdMShBPjIlVX88e1rqSkvzXd5kkcKcpECNxJJ8vg7R/nB64fZ1pXA74YbFpfzm9e3ccPiRs0LFwW5SCHrGYry5Z/s4Km3+4g70Bx28fGr2/jNaxbrZKZMUpCLFKCh0QSPvd3FT7d38cqhKF7gfe1BPnfbSjY012rZNTmFglykwAyNJvjLJ7bz4zd7iQONIcOvrm/mt29Yrl64TEtBLlIgugdG+ebL+zjUG+PV/UNkgRuXhvntG5bS2VarsXA5Kz0zRArAvpMDfO6hrbzbn8IF3LK8nKuW1HHPumbNSJFzUpCL5NFIJMmPdhzhmy8c4MBQBoCbl5XzF3ev04U9ct4U5CJ54DiWt4/18l8f3cFb3XEyQEelm09c08K9G5ZoLFwuiIJcZI7tPt7HX/14J+8cG6UvOXZ5/fXtIf7yo2tprSnPd3lShBTkInMkk3F4ds9h/v3DOxkdu7qejnLDPVe18WtXL6YqHMhvgVK0FOQic2Db0RP8yXffZM+AM7ntfR2l/OVHN9BcHc5jZTIfKMhFLqFYLM2Pdx7iy4/sZfweVwSAP/pgG/d2LtdNriQnFOQil0hX/wh/8YO3ePrdESb64YvL4G//VSdrmuvzWpvMLwpykRzrHhjlgefe4Zld/XRHx7Y1heBf37yUe9Z0qBcuOacgF8mhvSf6+eyDmzkaGXvsA25aUc6XPnyFZqTIJZOLNTtbgIeABsABNllrvz7bdkWKSc9QlAdf2sX33zhJf3xsW2MQ7v+VVdy2rFWX18sllYtnVwb4I2vtG8aYELDVGPO0tXZnDtoWKXg/2rGHP/jOvsnHFR646bIq/vADq9ULlzmRizU7jwPHxz8eNcbsApoABbnMaz1DUb7+1DYefmNocluZC773e9ewsrEmf4XJgpPT93vGmHbGFmJ+dZrP3QfcB9Da2prLw4rMuS2Hu/k333qTnvgvtzWUwDc+vV4hLnMuZ0FujCkDvg/8W2vtyOmft9ZuAjYBdHZ22lwdV2QudQ+M8qf/8jLPHPjlhT3lbvjSPUv4lSuWacEHyYucBLkxxstYiD9srX0kF22KFJKh0QRffeLnfPfNxCnbf21DBb9/61rdqVDyKhezVgzwj8Aua+3fzL4kkcKy+WAXv/kPb5E6bftXPtHGvesvz0tNIlPlokd+HfAbwNvGmG3j2/6jtfaJHLQtkjcDI3H+9pltPPTawCnbr2+Cv/zk9ZqRIgUjF7NWXgZMDmoRKRi/OHCU39m0nehp2//7ve18fN1lealJ5Gx0lYLIFF39I/zu37/EjtMS/J41ZXzxQ53UVQTzU5jIDBTkIuP+/sVX+O9PDJyx/cFPr+LWFYvzUJHI+VGQy4K3s7uXX/kfr51xMrPVDQ/+/rUsb6jOS10i50tBLgva1376LN94IXHG9r/51GLuWbMqDxWJXDgFuSxIL+47zG8+uOOM7RXAv/zhe1haXzXnNYlcLAW5LDh3ffFxzoxw+NonO/jo2tVzXo/IbCnIZd5zHMtwPMWNf/EMw9N8Pgg8+R9u0NqZUrQU5DKvjUSS/P1TW3jgtaFpP/+56/380R03k8w6OI7F5dIlEVJ8FOQyLw2NJvjelv185clDZ93nnz6znnBJgL09o1gL7TVBgn79SUjx0bNW5pWRSJLPbXqGn/fMvN+9V9bwwPMHuPuqRfjcPtY0VRDw6s6FUpwU5DJvdPWP8L6/fglnhn2+dFcTXleAbzy9j744NJb7+fytq2iuKNWwihQtBbkUJcexxNNZekciPPzKUXyuAf7u5ciMX/PVe1ZzbDDOi3uOk0rDiho/92xoprUqqBCXoqYgl6IUT2fpGozx3VcO8a1Xj82471Wl8GsfuZw3Dg1xsDfC8voAt1/RyM2r61hSXa4Ql6KnIJei5Lbw/7a+xbdePWMxqlOsqYZfvWElo4k0jnVoLPdz95WtXNVeg8fjmqNqRS4tBbkUFcexPLFzP5//zp4Z9/MCn7qyknd607yw6wTN1SEawwGu7qhhbXOlQlzmFQW5FI2BkThf+v4L/GTPTKcz4Yt3NrK6YRE/3HKE/ScHcTeGuKYqwPVL6+ioCc1ZiE+M40/Mhpn4WEM5kmu5WrPzm8BdQI+1VmtfSU5lMg6vd53gkw+8OeN+jcD/+t1r2HpkkG/+7AAtVT4+fX0HK1tChH0BGspL5yTEHccyGk/TF03QH03RUlGKcRkGo2laq0s1V11yLlfPqG8B3wAeylF7sgA5jiWazAAQ8LqJp7NkHIev/OAZ/u/bM3/tTa3w2ds6yTqw+/gwkWSG5qpq3rO0DoOhPlwyGaBTjxP0e3AcS+9oAmugrqzkosI+k3HojyaxWYe9fVEymSzdI3E8xkUilaWsxEtzZems5qpP9PD9bhfJrKPevUzKSZBba180xrTnoi1ZmBzH0hdJcqQ/SjLjUBP08vSOQ3ztuZlnpAC0+OC6K5bQO5Iikc6QyVo+sm4RGzqqONQb57KmMDVl/snQG42n2XpkkHCJl2V1ZRwbjvPW4QFcbhc3raynLlxywfUfG4zyyBvdlJW42H5kiOuX19BRHeTYUIKmygB1oQBBv+eig3fi59MfSVFd5mMwlqK5Ur17GaNngVwyU8eIzxZgE/tkMg5dAzEqg152nhzioZ9t58l9Z94nfKoPNMMnblnL0YEETRUBhmJp1jVXsrQ2RBbLovIgtWWlVJX6AIgmM/jdLvpjSQZjSVoqSzg6FGP/yQiXt1RQXeaf3Pd8v7/RRJpYKsP+/gh7T45y+xU1LG0IcbA3QlWZn6s7qmmumN2QzkSI944mqQ2N1Rj0e3QlqkyasyA3xtwH3AfQ2to6V4eVPIomM+zvibCkroxQwDttsMfTWY70x/B7Damsw7GRKL//8MzjKKv8cM36Rq5d2sCicID9J+Mc6Y+xvqWKJbUhklmH/T0RPC4X5QHP2AtF0mF/b4TKoJeRaJr26jJKvG729AyzrCHE8rrzPwk6MQbeG01wsC9K33jA3r2hCWMcDvX1c9Oqejrbqikv9c2qFx5PZ3EcS3907BgT7yw060ammrMgt9ZuAjYBdHZ22rk6ruTZlAybuIhnYqw4msyQyTpYk+W1Q4M8/9ounjw6c3P/+qoKlrQ24XO7GIwmiSRTJNMZvB5D0smStpag38OyhhB+t4sTI3H2nYgQKnXTM5zg+GiMkNfLUDJNY0UJV7VVUXIBY82ZjEPXUIxDfaPsORmhpSrAqsYQxhiSGYeM4/Crna1c2VRBaan3on9sjmPpGU3QPZhgSV2Q1qqgxsTlrDS0Ijlzeo876PewrD40OQQQ8LonQzyezvLuyQiDsQR7Twzy1acOztj2ygrD3e9dwoamajYfGqDM76a5KsBbR4bYc2KY+ooAN/jGev0wdhJzNJ7mnWMj7D4xjN/twuNxkUw5hAJprmyroq6shHg6y/7eCEtqx941zCQWS/PSgV66BuM0hH0YwO9xcbQ/RjJtubKjktqykoseC5/684uns3QPxUlmsriM0Vi4zChX0w+/C9wI1BhjuoA/s9b+Yy7aluIxtcc9EWYTs0KiyQwBr3sykAJeN+Ggi28//w4/3JOcsd3fu6GedR2NeN1uyoJeKoJe6kM+9hwfYX/PKGuaK7lueS1NVaV0DcUoD3gxgJO1+DywpC6IwTAQS3JlWzX1ZSVUB/1j9yC3Fs7x/tBxLMOxFM/tOcEjW4/SXhUkngzg8bg52BPB7XZzVUc1rZXBWQ15RJOZyReVoN/DsroQgEJczilXs1Y+mYt2pLhN7XHD2DDEQCyF3+PixEiC5spSvMZwcGCUbd09/Mk/vztje2HgixtXsqG9muFYlmgqTWXAy8r6MO+eHGZfb4Q1LZXcuWYRjeWlRJMZXMby8rs9jCYztFUFKfG4aa8Jsv9EjPUt1ZNj4dFkhq7BGIvKAyxrCE174jCTcTg+GOPgUITdx0fZ3zNKdamPqxdXkcg4JFOWdW0V1IZKqL3IaYtnGH9RcbnMOd8hiEzQS73kzNQe+HA0xdGhGIf7o3S2VdEQLmEomuToYIwvP/Iab/fP3FZno4ff/sBKonGDyxiqQ16ciEPXQJyDfVEqgn4+dXU7i6vLqAz5GY6n+MW+PkYTSfaeHCHs9zFY4mb38Qh3r2vmmiXVkzNSekYSVEyZ1322YZBjQ1EefGk/h3ojlPjcXNFcTmNbAGMMdeUB2quCtMyyFz7VxNi+ZqPIhVKQS05NnAw83B/h6ECcFQ1hgh4333lzN1/58TnOZALLy+D9a1twu90sqa4gay0v7D1B90CM9YuryGRcrF4UHhu+8XkYjCf5xbs9HB2KsOdEhBX1IWrKAuw9OYrX7eKmlQ0srQ1RUjL2VO8ZSfDGkUGubK2cdr54IpHh9SO9vN01jMdn2X1skFDQS2PYT9DvYV9PjJoyH1c0V9JWXZbTk48TL4QiF0rPmgXqfOZ4X4hUKsvhgQi90SSH+qN0VAXx+1w8+ta7fGzzObrf467vCHJtRw0+n5c1LVW4sHzv1QM8tv04sQRE0w7/6rqlLK0pI5rOsP3oIE+908Wzu/uw6QTloRBtdSX0jSS5eWU961sraSwfWzBiYoy+qtTHla2V084XP9I3zF/8aDsv7x0hDiytdNNcXcZQNMOBnj42hgJ84LI6slmoD5ac189tYnipqtSnKYNyySjIF6jTT0zORiqV5eUDPTzxVjelPjdL68p49cBJHnvjCPuGzv31a2ogHA5yqD9JU0WC9YuDvNXVy/M7etlyNEIGuKo5yL1XtbK0powTkThP7ejmrUODHO4bZWA0iQWODI9y3dIaPnp1G4urgpO98Inx8InvdbqeeFf/CP/moS3s6PnlRUhjtwiwNJYH+MDljWxc00TCsTy/u5f68gDt5zG9sD+aZPOBfq7uqCIc8F3QC2euX2xl/lKQL1Cnn5i8GI5j6Y3EeXlPL1sPneTYYAKfSfDQORZ6OF1vFI5Ho5T5PVQHDc9sP8pz747iABUe2NBRzh/cvoLF1RWMptI8uaObF3adJJnNUBtyc2QYhpOworaU2y6rY/Wi8lNmysz0vY5EkvxsXw+PbT00GeIlQH0prG6poqk6yLK6MLdd1khl0E8qleWWVXUsCgem/V5O74H73C7CJWPnDS70hTOXL7Yyv+nZsUDNZjx2Yjre4YEIP9vTw2v7+mgoN7xyaPSi2ktn4ZrFldRXlvDc7kF2940FamsINm5o5q51rcQTDi/vO0nY52PnsQEO9o4QjUJ5EDJpuGl5JX94+3JW1lcBZ4bgdN+r41he3NfL15/ZSzabZnV9gJV1AS5vqyaWyHJtRy0NVQFCPu/kDBKfz017TdlZv5eBWIothwdY3RieXEKuxOeh1O+hIui/oBfOXLzYysKgIJcLFk1m2Hygj837e3hjVzdvz7xIz4wM0FzjZyiRoe/IMPFkgkWlkHbgulUNrGurJ5m2PLLtGOlMls7FVbhx0ReBDHDz0mrWNlVz15omaspLJ9s9WwhmMg7HBqJ0jcTwe9xYt8MHVtXhd1tuXNVEaYmHgUiaurD/ouaFV5X6WN0YJprIEk+PXcwT8LjxuFwX/MKpk59yvvQskXOaGKt1Wzg2EmMkkeL1g118+9W+i27TBzSEoT5cwmVNFbx5ZIhU2qG6IshlTeWsa67kssZy4lmHeDJDOODGa9wMR5J86MpGUllLVZmP333/Mhoqz+whnx6CEze4Otwf4fG3utnVPUJLVZD3Lq/ho1e1MRhL01hRSonHTSzhnNe88NNvhwuQzDo0V5RO3mYW0JRCueSMtXN/25POzk67ZcuWOT+uXJyJk4XpTJZ/2ryfJ7ac5OIGUcYY4O7Lg2SybiwustZQVurBZVxs6KiiKlhCfzRJ0Oth25Eh/G43NeU+3jw8xO7jI3zu5mW8d0ntGTNBUqksh/sjpHHwGxdDyQylXhcVJT7e7R9ld/cIjnXIZg3tNaW01QQpD/go83lJZh0Go2maKwO4XOacJxgn7mG+r2eUgM/DioYwgMa05ZIyxmy11naevl3PNplRIpFh97EhdvcN8PKObn7ybnTWbVrgkR2/bMc1vq0MePHtk4ykxrataC6hvS5Mc3mQJXUh0hnLhvZKblxaS0Xo1Jknh3qH+NpPd3P4WD/RDHjc4HW7WVThI+3yMzQaJ1Tq59ffu5jLmypwAe/2Rjg5kqSy1M+yuhChEu95BfjEHQmPDcYBF4sqApM97onhHM04kbmkIJdppVJZnt13hK89spP9kUt7rIkVOEeB0dQvt+/pTpDFw8rGKlbXlbOivnza+diZjMP/fGYPj71z6nz1Ck+WjMlwcDBOU9jFx9/TwQ1L6khj+f4bR3llXx83rqzl8kUV532jq4mTqIvKAyyr/+W9UCa+dqInfvqUR5FLSc8wAZi8rH4gnqSsxMPWw/38p+/vZGDmtR0umRo/fPqWNiq9Qa5bUkNlyH/WoB2IpQj6PFR4weUamwVjLFy3vIr26gAv7hvixuWV3L6qidJSLyeH47iN5T1Lq7l+WS21ofO7uAdOPYnqcpmz9rw140TmkoJ8gUulsrx06Bjf/0UXgaCLsK+ElqoyfvFu75yH+MoKuG51A36Pl5ryEu64rJny87iIpqrUx6dvWMb1qxoIeMbWs4ynspQHfbRVBrljbYZFoQCVIT8A1UE/t1/eRMDjJhTwXtDQx+knUc8211szTmQu6Zm2wB0divLVH+5lb3+SUjd8/KpmugZ7eGbv4JzVsLbWzY1rWvnI2iY6asI4jr2gy9o9HhcddWE66sKT207pKVebM/ZvKJ/+gp4LpZ63FAIF+QI1MR1vOJ6ivdxwuB+WVMC3NnfNaR1NZS4+d/tqrlvSODnW7HKZi1oAeaq56hGr5y2FQM/ABSqezrKje5g3D/cQCJaxoibN9r7sRbXVXApOBiIpOP3aoBqgvhreu6qGaMLg9RgWVQXJprM4eFjXWkFnS+3kfVFE5MLpr2eBSSQyHBiI0l5RyuKaID/b6fDC3j6GZ16k5xTf/sx64ilYUhPkxGiSAz2j+L1uYqkM71teR3tV2djqO46lezh+yvJumo4nknu5WurtDuDrgBt40Fr7lVy0K7kTiabY1j1MwGt46p0eNq5bhHFn+fmOI+cd4j/9wjWsbKyZHH/2u13UhQMsrS3DZ1yksdQE/Xg8Y+tjOo49ZYaHhiBELo1Z/2UZY9zA3wEfALqA140xP7LW7pxt25IbqVSWJ3ed4PHtx/n197Sycd0i/B7DV57YyzvneZ+UQ1+5c/LjqaFc7vFRPs29vU/fT0QunVz8lV0N7LPWHgAwxnwP2AgoyAtE90icnuEYd65p5OrWaozHxSv7+4jHz32V5tQAF5HClIslS5qAqWt4dY1vO4Ux5j5jzBZjzJbe3t4cHFZmksk49IwkyGQcFoUDfHBtMx9e00RZcGxe9oaWSl4+cvYxlfUehbhIschFj3y6M1dn3InLWrsJ2ARjN83KwXFlBgOx1ClrU069h/bO473c9T9fP+vXvvPnt2tetEgRyUWQdwEtUx43A905aFdm4WxrU37szx/n9fj0X6MeuEhxysXQyuvAMmNMhzHGB9wL/CgH7coFSKWyHOqLkEqNzQX3eFzUhX95T+0DPYO0f1EhLjIfzbpHbq3NGGM+DzzJ2PTDb1pr35l1ZXJBukfiPLurh1tW1Z2xFNkDL7/KVx6bfhEIBbhI8cvJ3DBr7RPAE7loSy7OonDgjEWBI9EUf/roszyywzlj/89eA//5boW4yHygSb7zxOmLAv/Dz1/jr3585uygm+vgm/9OAS4ynyjI55lEIsN339x7RohXAd/6fCdrmuvzU5iIXDIK8nlkaDTBf3l8Kz/YNnTK9gd+awV3rFqan6JE5JJTkM8DsViaH+44yDdfOMS7A+nJ7R9cFuD+jRtorSnPY3UicqkpyIvcSCTJQ5sP8sBz+4k4UOEHr4E///hyPrR6Wb7LE5E5oCAvUpmMw+HBUR55vYtnd56gpaYEv9tw/4dXclV7o24VK7KAKMiL0JG+Yf73i4fIpuO8dSzC+1fWc8tlDaxprNQCDSILkP7qi0jPUJQfbDvGG4f7eW73ABvX1/OF21ZzbXs14TJ/vssTkTxRkBeJSDTF15/dyw/f6Ka9wsWH1zbw+zcv1YlMEVGQF7pYLM2LB0/w0zePsa8vwtqWCj7+3mZuX96kYRQRARTkBSuRyPDivuP8y5Zj7D02QPeo5c41dfzBLStoqS6bvBmWiIiCvAD1Dcf4hxf38YOtR+lNwI1Ly9l4ZQWfuKaNRVWhfJcnIgVGQV5AHMfSPRDhy49t59ndQwTccPPyKv70w6tor63Id3kiUqAU5AXCcSwnR+I8/OphfrF/CJcLNm5o4I9vv4Ky4PSLG4uIgIK8YMTTWQ70RqkIefmd97cRLPGxcU2LQlxEzklBnkexWJp3To7QXllKZZmfy5vKWVpXRnXQr5OZInLelBZ5tKtnlIc3H+Kl/X0ksw7lpT7qywMKcRG5ILNKDGPMx4wx7xhjHGNMZ66Kms8SiQzbDg7wxpF+OqoC/Nq17dywpEar1ovIRZvt0MoO4B7gH3JQy7w2NJrg+d09RJ00r+8bwONx89kblnBVR3W+SxORIjerILfW7gIwRnfam8mJwQh/9cQuth0ZoKM2zMa1TbTVB1lcFcx3aSIyD8zZyU5jzH3AfQCtra1zddi8SiQybDs6wEObD/L8O33csrqGT13fzpWLqnV5vYjkzDnTxBjzDNAwzae+ZK394fkeyFq7CdgE0NnZac+7wiJ2YCDK/37pAPtODnPbFXXc/6FVNFSWnfsLRUQuwDmD3Fp761wUMp84jiWeztJeUcrv3LCYY6NxbllWT0WoJN+licg8pPf3l0A8naVrMEZzZSnXLqvLdzkiMs/Ndvrh3caYLuA9wOPGmCdzU1ZxC3jdNFeWakqhiMyJ2c5aeRR4NEe1zBsulyHo15sdEZkbuoRQRKTIKchFRIqcglxEpMgpyM+T41iiyQyOsyCmwItIEVGQn6eJKYXxdDbfpYiInEJBfp40pVBECpXmyJ0nTSkUkUKlHrmISJFTkIuIFDkFuYhIkVOQi4gUOQW5iEiRW1BBrot6RGQ+WlBBrot6RGQ+WlBBrot6RGQ+WlBXuOiiHhGZjxZUj1xEZD6a7VJvf22M2W2M2W6MedQYU5Gjui6aTmiKyEIz2x7508Dl1to1wF7g/tmXNDs6oSkiC82sgtxa+5S1NjP+cDPQPPuSZkcnNEVkocnlGPlngJ+c7ZPGmPuMMVuMMVt6e3tzeNhTTZzQdLnMJTuGiEghOWeQG2OeMcbsmObfxin7fAnIAA+frR1r7SZrbae1trO2tnZWRWscXETkl845F89ae+tMnzfG/BZwF3CLtXZOknViHLy5slTTCUVkwZtVChpj7gD+BHi/tTaWm5LOznEs8XQWv9ulcXARkXGzHSP/BhACnjbGbDPGPJCDms5qoieezDoaBxcRGTerHrm1dmmuCjkfmpEiInKmohpg1iX2IiJn0iX6IiJFTkEuIlLkFOQiIkVOQS4iUuQU5CIiRU5BLiJS5BTkIiJFzszR7VFOPagxvcDhHDdbA/TluM1cUn0Xr5BrA9U3G4VcGxRefW3W2jPuOpiXIL8UjDFbrLWd+a7jbFTfxSvk2kD1zUYh1waFX98EDa2IiBQ5BbmISJGbT0G+Kd8FnIPqu3iFXBuovtko5Nqg8OsD5tEYuYjIQjWfeuQiIguSglxEpMjNqyA3xvy1MWa3MWa7MeZRY0xFvmuayhjzMWPMO8YYxxhTEFOajDF3GGP2GGP2GWO+mO96pjLGfNMY02OM2ZHvWqZjjGkxxjxvjNk1/nv9Qr5rmmCMKTHGvGaMeWu8tj/Pd03TMca4jTFvGmMey3ctpzPGHDLGvD2++tmWfNczk3kV5MDTwOXW2jXAXuD+PNdzuh3APcCL+S4Exv6IgL8DPgisBj5pjFmd36pO8S3gjnwXMYMM8EfW2lXAtcDvFdDPLwncbK1dC6wD7jDGXJvfkqb1BWBXvouYwU3W2nWFPpd8XgW5tfYpa21m/OFmoDmf9ZzOWrvLWrsn33VMcTWwz1p7wFqbAr4HbMxzTZOstS8CA/mu42ystcettW+MfzzKWCA15beqMXZMZPyhd/xfQc1sMMY0A3cCD+a7lmI3r4L8NJ8BfpLvIgpcE3B0yuMuCiSIio0xph1YD7ya51ImjQ9bbAN6gKettQVT27i/Bf4YcPJcx9lY4CljzFZjzH35LmYmRbcApjHmGaBhmk99yVr7w/F9vsTY296H57K28WOfs74CYqbZVlC9tmJgjCkDvg/8W2vtSL7rmWCtzQLrxs8VPWqMudxaWxDnG4wxdwE91tqtxpgb81zO2Vxnre02xtQBTxtjdo+/Syw4RRfk1tpbZ/q8Mea3gLuAW2weJsmfq74C0wW0THncDHTnqZaiZIzxMhbiD1trH8l3PdOx1g4ZY15g7HxDQQQ5cB3wEWPMh4ASIGyM+Y619tfzXNcka233+P89xphHGRuKLMggn1dDK8aYO4A/AT5irY3lu54i8DqwzBjTYYzxAfcCP8pzTUXDGGOAfwR2WWv/Jt/1TGWMqZ2YtWWMCQC3ArvzWtQU1tr7rbXN1tp2xp53zxVSiBtjgsaY0MTHwG0UzovgGeZVkAPfAEKMvQ3aZox5IN8FTWWMudsY0wW8B3jcGPNkPusZPzH8eeBJxk7U/bO19p181jSVMea7wCvACmNMlzHms/mu6TTXAb8B3Dz+fNs23sMsBI3A88aY7Yy9YD9trS24KX4FrB542RjzFvAa8Li19qd5rumsdIm+iEiRm289chGRBUdBLiJS5BTkIiJFTkEuIlLkFOQiIkVOQS4iUuQU5CIiRe7/A4JcVhLWP4FuAAAAAElFTkSuQmCC","text/plain":["
"]},"metadata":{"needs_background":"light"},"output_type":"display_data"}],"source":["plt.scatter(frc_api['fuel_cost_per_mmbtu'].replace(0, np.nan).transform(np.log10),\n","frc_bulk['fuel_cost_per_mmbtu'].replace(0, np.nan).transform(np.log10),\n","s=1, alpha=0.1)"]}],"metadata":{"kernelspec":{"display_name":"Python 3.10.5 ('pudl-dev')","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.5"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"adf7f0b18919f80aa48732f306897016c591ffeed72c8be7c2b511e7f25e6b58"}}},"nbformat":4,"nbformat_minor":2}
+{"cells":[{"cell_type":"code","execution_count":1,"metadata":{},"outputs":[],"source":["%load_ext autoreload"]},{"cell_type":"code","execution_count":2,"metadata":{},"outputs":[],"source":["%autoreload 2"]},{"attachments":{},"cell_type":"markdown","metadata":{},"source":["import pudl\n","import pandas as pd\n","import numpy as np\n","import sqlalchemy as sa\n","import pudl.output.eia923 as eia\n","from pudl.workspace.setup import PudlPaths\n","pudl_engine = sa.create_engine(PudlPaths().pudl_db)\n"]},{"cell_type":"code","execution_count":12,"metadata":{},"outputs":[],"source":["api_df = eia.get_fuel_cost_avg_eiaapi(eia.FUEL_COST_CATEGORIES_EIAAPI) # coal, oil, gas"]},{"cell_type":"code","execution_count":43,"metadata":{},"outputs":[],"source":["bulk_df = eia.get_fuel_cost_avg_bulk_elec(pudl_engine=pudl_engine)"]},{"cell_type":"code","execution_count":12,"metadata":{},"outputs":[{"data":{"text/html":["
\n","\n","
\n"," \n","
\n","
\n","
state
\n","
report_date
\n","
bulk_agg_fuel_cost_per_mmbtu
\n","
fuel_type_code_pudl
\n","
\n"," \n"," \n","
\n","
0
\n","
AK
\n","
2012-01-01
\n","
0.0
\n","
coal
\n","
\n","
\n","
1
\n","
AK
\n","
2012-02-01
\n","
0.0
\n","
coal
\n","
\n","
\n","
2
\n","
AK
\n","
2012-03-01
\n","
0.0
\n","
coal
\n","
\n","
\n","
3
\n","
AK
\n","
2012-04-01
\n","
0.0
\n","
coal
\n","
\n","
\n","
4
\n","
AK
\n","
2012-05-01
\n","
0.0
\n","
coal
\n","
\n"," \n","
\n","
"],"text/plain":[" state report_date bulk_agg_fuel_cost_per_mmbtu fuel_type_code_pudl\n","0 AK 2012-01-01 0.0 coal\n","1 AK 2012-02-01 0.0 coal\n","2 AK 2012-03-01 0.0 coal\n","3 AK 2012-04-01 0.0 coal\n","4 AK 2012-05-01 0.0 coal"]},"execution_count":12,"metadata":{},"output_type":"execute_result"}],"source":["bulk_df.head()"]},{"cell_type":"code","execution_count":13,"metadata":{},"outputs":[{"data":{"text/html":["