Repository navigation
Enrich missing coordinates from JRC EIC references without capacity duplication - #324
Draft
MaykThewessen wants to merge 9 commits into
Draft
MaykThewessen wants to merge 9 commits into
MaykThewessen wants to merge 9 commits into
Conversation
Implements the architecture proposed in PyPSA#287: deterministic matching on EIC (Energy Identification Code) runs before Duke fuzzy matching in compare_two_datasets(). Plants sharing an EIC code are matched with certainty, then removed from the Duke input so the fuzzy matcher only handles the residual. This provides a robustness guarantee against co-located plant confusion. For example, in the Eemshaven harbour area (Netherlands): OPSD "Eemscentrale Ec" (Natural Gas, 1929 MW, 6 EIC codes) ENTSOE "Eems" (Natural Gas, 1931 MW, same 6 EIC codes) ENTSOE "Eemshaven" (Hard Coal, 1580 MW, different EIC) ENTSOE "Eemshaven" (Natural Gas, 1410 MW, different EIC) EIC matching deterministically pairs the gas plants via their shared codes, preventing any possibility of Duke merging them with the nearby coal plant based on name/geo similarity. Similarly, Borssele nuclear (OPSD: 492 MW, ENTSOE: 485 MW) is locked to its correct cross-source pair via EIC 49W000000000054X, independent of fuzzy name matching against nearby Borssele wind/coal entries. Integration test: 431 deterministic EIC matches between OPSD and ENTSOE (28% of ENTSOE), reducing Duke's workload for those pairs to zero. Closes PyPSA#287 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
for more information, see https://pre-commit.ci
… into codex/upstream-python-linkage-jrc
Member
|
See comment on #323. I'm happy to help bring in better EIC matching, but you need to make it easier to review your change requests, otherwise there will be little appetite from the maintainer side to review. |
Contributor
Author
|
Ah good comment, shall I break it up in smaller pieces? Or shall I first comment on rapidfuzz #301? |
Member
|
Yes, smaller and independent pieces. It would be good to keep matching logic and data improvements separate. |
Contributor
Author
|
Plan:
Close this PR once those are up. |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use the historical JRC production/generation EIC reference to fill missing ENTSOE coordinates while preserving existing capacities and complete coordinate pairs. Keep latitude, longitude and provenance together through aggregation, reduction and cache reload. Ambiguous EIC locations remain unfilled.
Add the optional JRC_PPDB_OPEN loader with fuel normalization, both EIC identifier levels and production capacity counted once. For example, Eemshaven coal remains 1580 MW instead of 3160 MW. The historical reference is excluded from default matching and fully included sources.
This draft is stacked on #289 and the Python matcher follow-up #323. It addresses the capacity, source-name, fuel-normalization and identifier-loss problems reviewed in #306. The JRC version 1.00 archive has 7117 generation rows and 48 ambiguous EIC locations.
Validation: 64 focused tests pass on the extracted integration branch. The local 11-source build completed with 180064 records and 49 records with JRC coordinate provenance. It retains 45 unknown capacities; source vintages and planned/retired assets prevent interpreting totals as operational capacity or matcher accuracy. A reproducible validation runner is included. Local inventory artifacts remain outside this upstream PR.