GST is read as Gulf Standard Time (UTC+4) instead of Guam Standard Time (UTC+10)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Các offset sai nằm trong bảng viết tắt ở dataretrieval/codes/timezones.py, và _build_utc_datetime trong dataretrieval/_wqx.py áp dụng chúng. Chạy lại bước tái hiện trong issue, bước này gọi _attach_datetime_columns, để thấy GST rơi vào +0400. Đổi GST thành +1000, NZDT và FJST thành +1300, và thêm HDT với -0900. Sau đó thêm test theo kiểu của #432. Công việc hoàn thành khi bước tái hiện in ra 2024-06-01 00:00:00+00:00 và các trường hợp mới đều đạt. Giữ nguyên các viết tắt mơ hồ khác, trừ khi maintainer yêu cầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Python
- Star
- 269
- Fork
- 67
- Merge trung bình
- 3 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 18
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DOI-USGS/dataretrieval-python
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
DOI-USGS/dataretrieval-python#406 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Check getter parameter docs against the service's queryablesCó thể đã có người làm @acalebratliff đã nhận 2 ngày trước. Đang mởdocumentation ready-for-agent
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
DOI-USGS/dataretrieval-python#379 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
DOI-USGS/dataretrieval-python#260 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DOI-USGS/dataretrieval-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[Bug] to_ical lexicographical/default sorting moves URL property between two X-WR- propertiesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
collective/icalendar#1968 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Deferred from #1869: Complete the companion pytest guardrail update noted in the PR description...Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Custom provider API keys collide on one host: env slot keyed on host:port only, not URL pathĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#140958 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug triage/confirmed
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 85/100
agentscope-ai/agentscope#3355 ·
Maintainer thường phản hồi trong vòng 2 ngày