Keep the most specific DateIn and DateOut instead of coarsening to years
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Start by reading the loaders named in the issue (MASTR, GND, GEO) where full dates are reduced to years, then aggregate_units and reduce_matched_dataframe, which aggregate DateIn/DateOut as numeric years. The storage model is an open question, so settle whether DateIn/DateOut become reduced-precision ISO strings or gain companion columns before editing; that choice drives the loader and aggregation changes. Done means the mixed year/full-date example no longer raises and agreeing sources keep the most specific date, with tests for the chosen schema.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
DateIn and DateOut are years. Some data sources give full dates, but only the year is kept. The matching cannot combine a year with a full date.
Models like PyPSA-Eur must then pick a convention, such as 1 January or 31 December. For a plant commissioned mid-year, both are wrong by months.
Example
import numpy as np
import pandas as pd
import powerplantmatching as pm
from powerplantmatching.matching import reduce_matched_dataframe
config = pm.get_config()
columns = pd.MultiIndex.from_product([config["target_columns"], ["GEM", "MASTR"]])
df = pd.DataFrame(np.nan, index=[0], columns=columns, dtype=object)
df["Name"] = "Kraftwerk Musterstadt"
# source A gives a year, source B gives a full date
df.loc[0, "DateIn"] = [2026, pd.Timestamp("2026-11-17")]
reduce_matched_dataframe(df, config=config)
# TypeError: agg function failed [how->min,dtype->object]
Where the information is lost
- Loaders parse full dates and keep the year, e.g.
pd.to_datetime(...).dt.yearinMASTRandGND, or the first four characters inGEO. aggregate_unitsandreduce_matched_dataframetake the minimumDateInand the maximumDateOut, which assumes numeric years.
Proposal
- Loaders keep the date as specific as the source gives it (maybe picking a convention for annual resolution values is necessary).
- If matched sources agree on the year, use the most specific date.
Open question: storage
- Reuse
DateInandDateOut, e.g. as ISO 8601 strings with reduced precision (2026or2026-11-17) or as dates with a precision column. Slightly breaking for numeric filters such asDateIn < 2026. - Add columns for the full date and keep
DateInandDateOutas years. Not breaking, but two columns per date.
- Lingua principale
- Python
- Stelle
- 237
- Fork
- 79
- Merge medio
- 2g 21h
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PyPSA/powerplantmatching
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
PyPSA/powerplantmatching#333 ·
I maintainer di solito rispondono entro 2 giorni
-
Filling missing DateOut from other sources may lead to early decomissioning of plantsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertaneeds triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
PyPSA/powerplantmatching#331 ·
I maintainer di solito rispondono entro 2 giorni
-
Add status data to matching attributesForse già presa @fneum l’ha presa 53 giorni fa. Apertaneeds triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
PyPSA/powerplantmatching#322 ·
I maintainer di solito rispondono entro 2 giorni
-
needs triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
PyPSA/powerplantmatching#307 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
PyPSA/powerplantmatching#303 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di PyPSA/powerplantmatching
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Rose22/openlumara#166 ·
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
enhancement feature/signals self-driving team/self-driving
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PostHog/posthog#144208 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue help wanted tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
LMPrado-DZ23/open_notas_br#14 ·
I maintainer di solito rispondono entro 1 giorno