Replace end-of-interval default with start-of-period to match pandas as default

Aperta
#523 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 11 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data

Direzione di ricerca

Start with atlite's documented ERA5 time-series convention and trace the resampling entry points that produce its outputs. Compare their interval labels and closure with pandas' default resampling behavior. Done means the default convention matches pandas and the documented one-hour shift is eliminated when outputs are combined with ordinary pandas or xarray series.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

type: bug
Version Checks (indicate both or one)
  • I have confirmed this bug exists on the lastest release of atlite.

  • I have confirmed this bug exists on the current master branch of atlite.

Issue Description

atlite uses an end-of-interval convention for ERA5-derived time series: a value at 12:00 represents the averaging period from 11:00 to 12:00: https://atlite.readthedocs.io/en/master/conventions.html

This is opposite to the default convention used by pandas when resampling time series. For example:

s.resample("1h").mean()

uses label="left" and closed="left" by default, so the value labelled 12:00 corresponds to the interval

[12:00, 13:00)

whereas in atlite it corresponds to

(11:00, 12:00]

This difference can easily introduce an unnoticed one-hour shift when atlite output is combined with ordinary pandas/xarray time series, or data from similar data sources such as renewables ninja (see bottom of the page).

Expected Behavior

Matching pandas default behaviour would be safer for users and enable atlite to be combined more easily.

Installed Versions

0.6

Lingua principale
Python
Stelle
409
Fork
135
Merge medio
11g 22h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PyPSA/atlite

Tutte le issue di PyPSA/atlite

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.