Mapping driven metadata (for solar and wind)#54
Open
dylanjmcconnell wants to merge 10 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
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.
Mapping-driven metadata for solar and wind trace parsing. File stems are looked up in
mappings/2024/resources.yaml(instead of reverse-engineered from filenames via regex).(Demand parsing unchanged - seperate PR, coming next I think).
Changes
resource_trace_metadata.build()for building metadata dictsolar_traces.py/wind_traces.pyuse it instead of the regex extractors.extract_solar_trace_metadata/extract_wind_trace_metadataand their tests deleted (demand extractor kept for now).Temporary measures
(These measures basically to keep PR's more manageable / phase the implementation)
The loader still returns the existing
dict[Path, dict[str, str]]shape so downstream helpers, filters, and parquet schema are untouched. Long-term metadata will probably move to a typed object (maybe dataclass, but maybe a pydantic model - given pydantic already used / a dependency). Later PR (likely after dealt with demand traces)_RESOURCE_TYPE_CODESinresource_trace_metadata.pytranslates the YAML's semantic vocabulary (solar_sat,wind_offshore_floating) to the legacy short codes (SAT,WFL) downstream still expects (will disappear in the longer term)Tests
One test in
tests/test_resource_trace_metadata.py. The function has no branching or differing versions, (i.e. Extra solar/wind/zone cases would just be testing different YAML rows, not code - unlike in the regex driven approach). Only testing two files (a solar project and a wind project, that together test main logic of the function )