nmfs-ost / ss3-source-code

The source code for Stock Synthesis (SS3).
https://nmfs-ost.github.io/ss3-website/
Creative Commons Zero v1.0 Universal
36 stars 16 forks source link

[Bug]: Size Frequency section in data_boot_001.ss and data_expval.ss identical to input file #541

Closed e-perl-NOAA closed 8 months ago

e-perl-NOAA commented 8 months ago

Describe the bug

While testing PR #540 to fix the size frequency method in CompReport.sso, @iantaylor-NOAA saw that the size frequency section in data_boot_001.ss and data_expval.ss are identical to the input file (but were different in 3.30.19).

It looks like this commit https://github.com/nmfs-ost/ss3-source-code/commit/61d2cba7ea9ce1d640920ec242c54098f039443e, which included a variety of other changes, may have inadvertently led to the observed output getting written to all three data file types.

In particular this change looks incorrect: https://github.com/nmfs-ost/ss3-source-code/commit/61d2cba7ea9ce1d640920ec242c54098f039443e#diff-17a83800a032b2061d3ddd5c6da9d766d9796ecb81f2ebf1599b9808c206247eL775-R782 but the change includes moving from looping over size frequency observations to size frequency methods, so I'm assuming the fix is not as simple as swapping SzFreq_obs and SzFreq_exp.

Lesson from all this: more tests related to generalized size frequency and/or bootstrap data would be helpful. The one test model with generalized size frequency data has the same scale and units for both size frequency methods: https://github.com/nmfs-ost/ss3-test-models/blob/main/models/two_morph_seas_areas/data.ss#L455. And I don't think we have any tests for expected values or bootstrap data.

To Reproduce

See PR #540.

Expected behavior

Size frequency section in data_boot_001.ss and data_expval.ss should be different from the input file.

Screenshots

No response

Which OS are you seeing the problem on?

No response

Which version of SS3 are you seeing the problem on?

Versions after v.3.30.19

Additional Context

No response

iantaylor-NOAA commented 8 months ago

@Rick-Methot-NOAA, should we consider a bug fix release once this issue is resolved? Yohei Tsukahara is interested in bootstrapping for Pacific bluefin tuna. I don't know if there are other issues that could be rolled in as well.

Rick-Methot-NOAA commented 8 months ago

Yes. I think we should do a 3.30.22.1 release.

e-perl-NOAA commented 8 months ago

Just created a 3.30.22.1 milestone

Rick-Methot-NOAA commented 8 months ago

I looked at the code and see how an errant cut 'n paste involving: https://vscode.dev/github/nmfs-ost/ss3-source-code/blob/main/SS_write_ssnew.tpl#L398-L401 created this problem. Should be straightforward to restore the expval and boot code.