-
Notifications
You must be signed in to change notification settings - Fork 910
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation test for emissions factor references provided in zone …
…configs (#6001) * zone config: retain 'emissionFactors' key after configuration is loaded * tests: add test case to validate the reference sources listed in zone config emissions factor entries * Run 'poetry run format' * Zone model: add emissionFactors field to allow pydantic validation to pass * config.model: relocate 'Zone' class definition so that it can reference classes defined above it within the module * config.model: add ZoneEmissionFactors model to represent emissions factors stored directly on zone config objects as read from YAML * config.model: cleanup: remove outdated comment * config.model: cleanup: use snake-casing * tests: migrate to a pydantic-model-based reference-testing approach * Revert "config.model: cleanup: use snake-casing" This reverts commit efd56dc. * Revert "config.model: cleanup: remove outdated comment" This reverts commit 2de8e37. * Revert "config.model: add ZoneEmissionFactors model to represent emissions factors stored directly on zone config objects as read from YAML" This reverts commit 88ea0a6. * Revert "config.model: relocate 'Zone' class definition so that it can reference classes defined above it within the module" This reverts commit 3ca1990. * Revert "Zone model: add emissionFactors field to allow pydantic validation to pass" This reverts commit e4e701c. * Revert "zone config: retain 'emissionFactors' key after configuration is loaded" This reverts commit 1464290. * tests: refactor zone reference-testing to use existing CO2EQ_CONFIG_MODEL * tests: apply isort-preferred module formatting * tests: every zone production mode estimate must provide a source reference, so assert that it is a required value * config: refactor-out HOPS source reference into an origin document and a link to the calculation that derived it While doing this I also confirmed that HOPS is an ENTSOE transmission system operator in Croatia; the linked document is also available on their English-language homepage under Documents -> Basic Data at 'http://hops.hr/page-file/iXgT7cSSC4U28AfzW8lBZ6/publications/Temeljni_podaci_2018.pdf' Cross-references-commit d3072b4. * config: refactor-out references to IEA MX energy generation ix report URL by defining 'sources' entries for it per-zone Also confirmed while doing this that the comment is accurate, in that the percentages mentioned refer to the Y2020 energy mix reported by the charts at the given URL * config: refactor-out references to IPCC 2014 Ocean (includes tidal) electricity supply technologies * config: refactor-out references to data partially derived from the Guatemalan AMM (Administrador del Mercado Mayorista) The link is to the page containing the API where data was extracted from and that belongs to the authority source; the docs.google.com URL for the derived analysis remains as a _url property on the relevant emissions factors * config: refactor-out references to Enerdata as a data source from zone configuration files for Japan * tests: factor-out special-case Electricity Maps reference by rephrasing the sentence, hopefully with no loss of information (and retaining the explicit disclaimer note) * config: rephrase CA-AB source assumption note into a more grammatically-correct structure * config: fixup: data for IN-KA shouldn't be described as an assumption (that was a temporary measure to allow the unit tests to pass while cleaning up the zone config files) * config: factor-out sources for assumed 50-50 solar:wind renewables mix in UA * tests: cleanup: 'emission_factors' and the 'zone_overrides' subfield are required (not optional) on each CO2 parameters model * tests: add assertion that top-level sources configuration is present when reference sources are found * tests: lint fixup: comment brevity to fix within line length limits * tests: nitpick: standardize error message format, and include full path to missing 'source' key * config: add top-level 'source' entry to CH zone config for results derived from Electricity Maps worksheet with SFOE contribution
- Loading branch information
1 parent
e53c5a4
commit e673724
Showing
25 changed files
with
142 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.