GST is read as Gulf Standard Time (UTC+4) instead of Guam Standard Time (UTC+10)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Los offsets incorrectos están en la tabla de abreviaturas de dataretrieval/codes/timezones.py, y _build_utc_datetime en dataretrieval/_wqx.py los aplica. Ejecuta la reproducción del issue, que llama a _attach_datetime_columns, para ver que GST cae en +0400. Cambia GST a +1000, NZDT y FJST a +1300, y añade HDT con -0900. Después añade tests al estilo de #432. Está terminado cuando la reproducción imprima 2024-06-01 00:00:00+00:00 y los nuevos casos pasen. Deja las demás abreviaturas ambiguas como están, salvo que un maintainer lo pida.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
codes.timezones puts GST on the +0400 row (Gulf Standard Time):
and _wqx._build_utc_datetime applies that offset when it builds the UTC column:
The USGS time-zone codes (https://help.waterdata.usgs.gov/tz) and the WQX TimeZone domain both define GST as Guam Standard Time, UTC+10. The same table feeds the *DateTime columns that wqp.get_results() and waterdata.get_samples() append, and utils.format_datetime(), so any result stamped GST is placed six hours off. (I haven't found a live response that carries GST yet; the Guam results I pulled from the Water Quality Portal have no times.)
Reproduce:
import pandas as pd
from dataretrieval._wqx import _attach_datetime_columns
df = pd.DataFrame({
"Activity_StartDate": ["2024-06-01"],
"Activity_StartTime": ["10:00:00"],
"Activity_StartTimeZone": ["GST"],
})
print(_attach_datetime_columns(df)["Activity_StartDateTime"][0])
# 2024-06-01 06:00:00+00:00 expected 2024-06-01 00:00:00+00:00
Comparing the table with the USGS list turned up two smaller problems:
NZDTis+1330; the USGS list has UTC+13 (as doesFJST, Fiji Summer Time).HDT(Hawaii-Aleutian Daylight Time, UTC-9) is in the USGS list but not in the table, so it becomesNaT.
A few other abbreviations also mean different zones in the two lists (for example EAST, CCT, NFT, WAT, and SST, which the USGS list uses for Swedish Summer Time but WQX uses for Samoa). I have left those alone, since I don't know which ones actually appear in responses.
I have a small fix with tests ready for GST, NZDT/FJST, and HDT, following the pattern of #432. Happy to open a PR if that's welcome.
Python 3.11, pandas 3.0.2, dataretrieval main (d5254bef).
- Lenguaje dominante
- Python
- Estrellas
- 269
- Forks
- 67
- Merge medio
- 3 d 17 h
- PR fusionados (30 d)
- 18
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 DOI-USGS/dataretrieval-python
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
DOI-USGS/dataretrieval-python#406 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Check getter parameter docs against the service's queryablesPosiblemente ocupada @acalebratliff la tomó hace 2 días. Abiertodocumentation ready-for-agent
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
DOI-USGS/dataretrieval-python#379 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
DOI-USGS/dataretrieval-python#260 ·
Los mantenedores suelen responder en 1 día
Todos los issues de DOI-USGS/dataretrieval-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[Bug] to_ical lexicographical/default sorting moves URL property between two X-WR- propertiesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
collective/icalendar#1968 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Deferred from #1869: Complete the companion pytest guardrail update noted in the PR description...Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
Los mantenedores suelen responder en 1 día
-
Custom provider API keys collide on one host: env slot keyed on host:port only, not URL pathAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NousResearch/hermes-agent#140958 ·
Los mantenedores suelen responder en 1 día
-
Bug triage/confirmed
Dificultad 2/5 Medio día Aptitud para principiantes 85/100
agentscope-ai/agentscope#3355 ·
Los mantenedores suelen responder en 2 días