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

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

オープン
#714 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

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

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
58
フォーク
9
平均マージ
28分
マージ済み PR(30日)
1

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

DHI/modelskill のほかの issue

DHI/modelskill の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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