detect_clearsky and prilliman fail on DST days, kimber fails on tz-naive data (since #2924)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
Empieza con _get_sample_intervals en pvlib/tools.py, que comparten detect_clearsky y prilliman, y con la función kimber en pvlib/soiling.py, donde convierte el índice con tz_convert(None). Ejecuta las dos reproducciones del issue para confirmar los errores. Está terminado cuando ambas se ejecutan sin errores sobre un índice con zona horaria que abarca un cambio de horario de verano y sobre un índice sin zona horaria, y las pruebas existentes en test_clearsky.py, test_soiling.py, test_temperature.py y test_tools.py siguen pasando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
On main (0f6631a, pandas 3.1.0), both of these worked before #2924 and now raise:
import pandas as pd
import pvlib
loc = pvlib.location.Location(49.28, -123.12, tz='America/Vancouver')
times = pd.date_range('2026-03-07', '2026-03-10', freq='1min',
tz=loc.tz, inclusive='left')
ghi = loc.get_clearsky(times)['ghi']
pvlib.clearsky.detect_clearsky(ghi, ghi)
# NotImplementedError: algorithm does not yet support unequal time intervals...
rain = pd.Series(0.0, index=pd.date_range('2026-01-01', periods=720, freq='h'))
pvlib.soiling.kimber(rain)
# TypeError: Cannot convert tz-naive timestamps, use tz_localize to localize
In _get_sample_intervals, tz_localize(None) turns the index into local clock time, so the 1-minute data gets a 61-minute step where the clocks change. temperature.prilliman uses the same helper, so it fails the same way.
kimber uses tz_convert(None), which raises on a tz-naive index:
What I'd suggest: subtract the timestamps directly. That gives elapsed time for both naive and tz-aware indexes.
# tools._get_sample_intervals
deltas = (times[1:] - times[:-1]) / pd.Timedelta('60s')
# soiling.kimber
timestep_interval = rainfall.index[1] - rainfall.index[0]
day_fraction = timestep_interval / pd.Timedelta(hours=24)
Plus two tests: detect_clearsky on a DST day should match the same data in UTC, and kimber with a tz-naive index should match the existing expected output.
I tried this locally:
- both new tests fail on main and pass with the change;
test_clearsky.py,test_soiling.py,test_temperature.pyandtest_tools.pypass on pandas 3.1.0 and 2.3.3;- on the commit before #2924 (d6075f6), both examples run fine.
I didn't find an existing issue for this. Happy to open a PR if this sounds right.
AI disclosure: I used Claude Code (an AI coding agent) to find and trace this, run the examples and tests on my machine, and draft this note.
@echedey-ls @kandersolar
- Lenguaje dominante
- Python
- Estrellas
- 1.7k
- Forks
- 1.2k
- Merge medio
- 3 d 6 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pvlib/pvlib-python
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
pvlib/pvlib-python#2921 · 2 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
Possibility of beam irradiance from behind plane of arrayQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pvlib/pvlib-python#2903 · 5 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
use offset parameter instead of calculating bday in cdromPosiblemente ocupada @chenyi6758-source la tomó hace 15 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
pvlib/pvlib-python#2902 ·
Los mantenedores suelen responder en 1 día
-
Add an example or documentation on using 'bhi' from ERA5Quizá libre de nuevo @anshurajbisoyi98-ctrl la tomó hace 30 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
pvlib/pvlib-python#2880 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Use "long-wave" rather than "infra-red" to refer to thermal radiation.Quizá libre de nuevo @Rahi-padwal la tomó hace 268 días y no hay ningún pull request abierto. Abiertoapi easy
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
pvlib/pvlib-python#2653 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de pvlib/pvlib-python
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
QuantConnect/Documentation#2838 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
awslabs/route53-dynamic-dns-with-lambda#67 · 1 comentario ·
-
`SubAgents` returns a child run's `DeferredToolRequests` to the parent as a successful tool resultAbiertobug pkg:harness
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
pydantic/pydantic-ai#12405 ·
Los mantenedores suelen responder en 1 día
-
good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
good first issue help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100