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

Abierto
#523 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 11 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
data

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
409
Forks
135
Merge medio
11 d 22 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PyPSA/atlite

Todos los issues de PyPSA/atlite

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.