Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

GST is read as Gulf Standard Time (UTC+4) instead of Guam Standard Time (UTC+10)

オープン 初心者向け
#454 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

@yang00333 がすでに取り組んでいます。

2026年10月16日 から。

  • #455 @yang00333 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
pandas, python
領域
data

調査の方向性

誤ったオフセットは 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):

https://github.com/DOI-USGS/dataretrieval-python/blob/d5254bef635327765418dd590462246d4d1227df/dataretrieval/codes/timezones.py#L19

and _wqx._build_utc_datetime applies that offset when it builds the UTC column:

https://github.com/DOI-USGS/dataretrieval-python/blob/d5254bef635327765418dd590462246d4d1227df/dataretrieval/_wqx.py#L37

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:

  • NZDT is +1330; the USGS list has UTC+13 (as does FJST, Fiji Summer Time).
  • HDT (Hawaii-Aleutian Daylight Time, UTC-9) is in the USGS list but not in the table, so it becomes NaT.

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DOI-USGS/dataretrieval-python のほかの issue

DOI-USGS/dataretrieval-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。