Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Auxiliary variables are marked `aux` in one place and `auxiliary` in another

Đang mở
#714 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
data

Hướng nghiên cứu

Start with _validate_dataset in src/modelskill/timeseries/_timeseries.py:134, then compare its kind handling with _include_attributes in _point.py:178, _aux_vars at _timeseries.py:279, and Comparer.aux_names in _comparison.py:693-700. Reproduce the hand-built dataset example and verify that one spelling is used consistently, with auxiliary variables appearing in _aux_vars, repr, and comparison names without changing to_dataframe() behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

An auxiliary variable is marked "aux" in one place and "auxiliary" in another, and the two readers disagree about which counts.

Writers:

  • _include_attributes writes "aux" for every selected aux item — src/modelskill/timeseries/_point.py:178
  • _validate_dataset defaults any variable with no kind to "auxiliary" — src/modelskill/timeseries/_timeseries.py:134

Readers:

  • TimeSeries._aux_vars matches "aux" only — _timeseries.py:279, via filter_by_attrs(kind="aux")
  • Comparer.aux_names matches anything that is not observation or model — src/modelskill/comparison/_comparison.py:693-700, with the comment # we don't require the kind attribute to be "auxiliary"
  • to_dataframe() keeps every data variable regardless of kind

A variable marked "auxiliary" is therefore invisible to _aux_vars and to __repr__, while still appearing as a column:

ts = TimeSeries(ds)               # ds carries an extra variable with no kind

ts.data["extra"].attrs["kind"]    # 'auxiliary'
ts._aux_vars                      # []          <- not seen
list(ts.to_dataframe().columns)   # ['WL', 'extra']   <- but present
"Auxiliary" in repr(ts)           # False       <- and unreported

Scope

Everything built through the normal parse path gets "aux", because _parse_point_input selects values and aux items and marks the aux ones itself. The "auxiliary" default only fires for a dataset that reaches _validate_dataset carrying a variable nothing claimed — a hand-built dataset, or one assembled outside the parse functions. That is why no test has caught it.

Suggested fix

Pick one spelling and use it in both writers and all three readers. "aux" is the one the parse path produces and the one _aux_vars already expects, so _validate_dataset:134 is the smaller change. Whichever is chosen, Comparer.aux_names can then match it directly instead of matching by exclusion, and the comment at _comparison.py:695 can go.

Ngôn ngữ chính
Python
Star
58
Fork
9
Merge trung bình
28 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DHI/modelskill

Tất cả issue của DHI/modelskill

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.