GST is read as Gulf Standard Time (UTC+4) instead of Guam Standard Time (UTC+10)
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
調査の方向性
誤ったオフセットは dataretrieval/codes/timezones.py の略称テーブルにあり、dataretrieval/_wqx.py の _build_utc_datetime がそれを適用しています。issue の再現手順を実行してください。これは _attach_datetime_columns を呼び出し、GST が +0400 になることを確認できます。GST を +1000 に、NZDT と FJST を +1300 に変更し、HDT を -0900 として追加してください。その後、#432 のスタイルに倣ってテストを追加します。再現手順が 2024-06-01 00:00:00+00:00 を出力し、新しいケースが通れば完了です。メンテナーから依頼がない限り、他のあいまいな略称は変更しないでください。
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- Python
- スター
- 269
- フォーク
- 67
- 平均マージ
- 4日 4時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DOI-USGS/dataretrieval-python のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
DOI-USGS/dataretrieval-python#452 ·
メンテナーはふだん 4 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
DOI-USGS/dataretrieval-python#406 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
documentation ready-for-agent
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
DOI-USGS/dataretrieval-python#379 · コメント 4 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
DOI-USGS/dataretrieval-python#361 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
DOI-USGS/dataretrieval-python#260 ·
メンテナーはふだん 4 日以内に返信
DOI-USGS/dataretrieval-python の issue をすべて見る
似ている issue
-
bot-triaged module: LrScheduler module: optimizer triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
documentation glm5 llm-model
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vllm-project/vllm-ascend#19062 ·
メンテナーはふだん 1 日以内に返信
-
author-page correction
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
acl-org/acl-anthology#10496 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Issue Type: Bug Report
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
celery/celery#10875 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SasanLabs/VulnerableApp#836 ·
メンテナーはふだん 1 日以内に返信