GST is read as Gulf Standard Time (UTC+4) instead of Guam Standard Time (UTC+10)
I maintainer di solito rispondono entro 4 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Gli offset errati si trovano nella tabella delle abbreviazioni in dataretrieval/codes/timezones.py, e _build_utc_datetime in dataretrieval/_wqx.py li applica. Esegui la riproduzione della issue, che chiama _attach_datetime_columns, per vedere GST finire su +0400. Cambia GST in +1000, NZDT e FJST in +1300, e aggiungi HDT a -0900. Poi aggiungi test nello stile di #432. È completato quando la riproduzione stampa 2024-06-01 00:00:00+00:00 e i nuovi casi passano. Lascia invariate le altre abbreviazioni ambigue, a meno che un maintainer non lo chieda.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- Python
- Stelle
- 269
- Fork
- 67
- Merge medio
- 4g 4h
- PR unite (30g)
- 16
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la 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 DOI-USGS/dataretrieval-python
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
DOI-USGS/dataretrieval-python#452 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
DOI-USGS/dataretrieval-python#406 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
documentation ready-for-agent
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
DOI-USGS/dataretrieval-python#379 · 4 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
DOI-USGS/dataretrieval-python#361 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
DOI-USGS/dataretrieval-python#260 ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di DOI-USGS/dataretrieval-python
Issue simili
-
python triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/semantic-kernel#14615 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
shackett/shackett-utils#19 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
UKGovernmentBEIS/control-arena#917 ·
I maintainer di solito rispondono entro 1 giorno