job_type = check crashes with KeyError when the noise scale is a free parameter (sigma = fit s)

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

Reproduce the failure with repro_function_heavy.py and check.conf, then start at pybnf/algorithms/model_check.py:run_check and follow the traceback through pybnf/objective.py and pybnf/noise/source.py:value. Done means job_type = check no longer raises KeyError for an estimated noise scale, instead gives the expected handling, and the cleanup AttributeError is addressed or explicitly covered.

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

説明

Summary

job_type = check crashes when the noise scale is a free parameter (sigma = fit s).

Environment: PyBNF 1.8.1 (5ecb1f69), bngsim 0.15.0, Python 3.12, macOS arm64.

Reproduce

Use the script from #976, then run:

python repro_function_heavy.py repro 300 30
cd repro && pybnf -c check.conf -o

check.conf sets job_type = check, noise_model = normal, sigma = fit s, qualitative_scale = fit s, and loguniform_var = s 0.2 0.20002. Its experiment holds 20 replicate .exp files plus a .prop file.

Observed

Sorry, an unknown error occurred: KeyError: 's'
  File "pybnf/pybnf.py", line 748, in main
  File "pybnf/algorithms/model_check.py", line 91, in run_check
  File "pybnf/objective.py", line 352, in evaluate_multiple
  File "pybnf/objective.py", line 586, in evaluate
  File "pybnf/objective.py", line 2085, in eval_point
  File "pybnf/objective.py", line 1232, in _noise_values
  File "pybnf/noise/source.py", line 148, in value
KeyError: 's'

It is followed by AttributeError: 'ModelCheck' object has no attribute 'cleanup' from pybnf/pybnf.py, line 104, in _finalize. That looks like a sibling of #569.

Expected

Model checking should either use the declared value of the noise parameter, or refuse up front with a plain message that an estimated noise scale needs a value.

Workaround: sigma = fix_at <value>, plus explicit tolerance clauses in place of qualitative_scale.

Also seen

The information criteria printed after a fit count only the quantitative data points and ignore the BPSL observations. In the original case this printed AIC=… (k=28, n=20, …) for 20 replicates plus 2,760 constraints. That may be intended, but it would be worth stating.

主要言語
Python
スター
25
フォーク
25
平均マージ
4時間 5分
マージ済み PR(30日)
10

環境構築

はじめの一歩

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

lanl/PyBNF のほかの issue

lanl/PyBNF の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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