[Bug]: non-integer `Lbin_lo`/`Lbin_hi` are silently truncated under `Lbin_method = 1`, while method 3 raises a fatal error for the equivalent mistake
評估
這個 Issue 還沒有評估資料。
描述
Describe the bug
Under Lbin_method = 1 the Lbin_lo/Lbin_hi columns of an age composition observation are population length bin indices. If a file instead contains lengths, SS3 accepts them silently and truncates them to integers, so conditional age-at-length data can be fit to the wrong bins. There is no warning in warning.sso and the run completes normally.
Method 3 searches len_bins for an exact match and calls write_message(FATAL, 0) with "L_bin_lo no match to poplenbins in age comp" if there is none. Method 1 has no equivalent check, only a clamp to [1, nlength].
Two consequences, depending on how the data is setup:
Lbin_loandLbin_hione bin apart (e.g.18.5 19.5, intended as the edges of one 1 cm bin) becomes index range18..19, so the cell spans two population bins and consecutive rows overlap.Lbin_hi = Lbin_lo(e.g.34.5 34.5, a row on a 5 cm data bin grid) becomes bin 34, a single 1 cm bin one below the data's label.
To Reproduce
In any model with 1 cm population bins and Lbin_method = 1, write lengths rather than bin numbers in columns 7 and 8 of a conditional age-at-length row:
#_Lbin_method_for_Age_Data: 1=poplenbins; 2=datalenbins; 3=lengths
1
#_yr month fleet sex part ageerr Lbin_lo Lbin_hi Nsamp <data vector>
1991 7 2 0 0 1 18.5 19.5 1 ...
Run, then compare the input against the FIT_AGE_COMPS section of Report.sso, which reports these columns converted back to actual length and so should read the same as the input:
data.ss 1991 7 2 0 0 1 18.5 19.5 1 ...
Report.sso FIT_AGE_COMPS ... 1991 1 2 7 1991.5 0 0 1 17.5 18.5 _ _ 1 ...
Tested on v3.30.25.1 and **v3.30.22.1 ** on the 2024 Aleutian Islands Pacific cod assessment: all 1160 CAAL redictions are one bin lower than the data. but the run exits 0, and warning.sso does not mention the Lbin truncation.
Expected behavior
A non-integer Lbin_lo or Lbin_hi under Lbin_method = 1 or 2 should produce a warning, or a fatal error, as method 3 already does for its own equivalent mistake. Anything that makes the run stop would allow users to catch this immediately.
Screenshots
No response
Which OS are you seeing the problem on?
No response
Which version of SS3 are you seeing the problem on?
v3.30.25.1 and **v3.30.22.1 **
Additional Context
Impacts all cod assessments in AK
- 主要語言
- C++
- 星號
- 46
- 分支
- 20
- 平均合併
- 2 天 6 小時
- 30 天內合併 PR
- 1
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
nmfs-ost/ss3-source-code 的其他 Issue
-
need warning and improved logic for generalized sizecomp可能重新可做 @Rick-Methot-NOAA 於 266 天前認領,目前沒有進行中的 PR。 未關閉composition in progress
nmfs-ost/ss3-source-code#751 · 1 則留言 · 已指派 1 人 ·
-
[Feature]: Add standard errors for area-specific quantities可能重新可做 @Rick-Methot-NOAA 於 404 天前認領,目前沒有進行中的 PR。 未關閉area & movement
nmfs-ost/ss3-source-code#731 · 3 則留言 · 已指派 1 人 ·
-
[Feature]: Create a basic report list that could serve as better starting configuration for customization可能重新可做 @Rick-Methot-NOAA 於 411 天前認領,目前沒有進行中的 PR。 未關閉misc. output
nmfs-ost/ss3-source-code#723 · 已指派 1 人 ·
-
[Feature]: restrict biology output using the use_morph(g) flag可能重新可做 @Rick-Methot-NOAA 於 433 天前認領,目前沒有進行中的 PR。 未關閉biology misc. output ongoing
nmfs-ost/ss3-source-code#702 · 已指派 1 人 ·
-
[Feature]: mean vs median recruitment when using SCAA option可能重新可做 @Rick-Methot-NOAA 於 451 天前認領,目前沒有進行中的 PR。 未關閉recruitment
nmfs-ost/ss3-source-code#696 · 已指派 1 人 ·
查看 nmfs-ost/ss3-source-code 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
aristocratos/btop#1945 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 79/100
boykopovar/AnyPS5#11291 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
k2-fsa/sherpa-onnx#4100 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
Mod: Part Design Topic: User Interface
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆