Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE #770 Fix: length 0 CompError #799

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nathanvaughan-NOAA
Copy link
Contributor

Adds a wrapper for length zero Comp Errors when creating figure legends. Bug is due to missmatch in partition value between database and datainfo dataframes. Further investigation into the cause and implications of this mismatch would be helpful.

@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (eb29e0c) 62.66% compared to head (0bc320b) 62.65%.

Files Patch % Lines
R/SSplotComps.R 50.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #799      +/-   ##
==========================================
- Coverage   62.66%   62.65%   -0.02%     
==========================================
  Files         112      112              
  Lines       26002    26010       +8     
==========================================
+ Hits        16295    16296       +1     
- Misses       9707     9714       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iantaylor-NOAA
Copy link
Contributor

I'm going to hold off on merging this until we can investigate the underlying issue further.

However, @lisaailloud-NOAA, you could install Nathan's fix via
remotes::install_github("nathanvaughan-NOAA/r4ss")
or
pak::pkg_install("nathanvaughan-NOAA/r4ss")

@nathanvaughan-NOAA
Copy link
Contributor Author

@iantaylor-NOAA I agree on holding off, I already had lisa install my fork for now figuring that was the best alternative. It looks like the issue is that the SS_Output() is not producing all fleet/partition combinations so some fleets only have partition 0 which is throwing the error. If I get a chance to take a look before you I will let you know what I find.

@nathanvaughan-NOAA
Copy link
Contributor Author

I looked into it a little further and the issue is that the Length_comp_error_controls section of the SS report file (below) does not contain all fleet/partition combinations which is what is assumed in the plotting code. Also, I'm not sure why SS is assigning the below partition values when the input comp data appears to be all set as partition 2. This issue may be happening in SS rather than r4ss??

Fleet partition mintailcomp addtocomp combM+F CompressBins CompError ParmSelect minsamplesize
1 0 -1 0.001 0 0 0 0 0.001 #_ Com_GN_1
2 0 -1 0.001 0 0 0 0 0.001 #_ Com_HL_2
3 0 -1 0.001 0 0 0 0 0.001 #_ Rec_CB_HB_3
3 1 -1 0.001 0 0 0 0 0.001 #_ Rec_CB_HB_3
3 2 -1 0.001 0 0 0 0 0.001 #_ Rec_CB_HB_3
4 0 -1 0.001 0 0 0 0 0.001 #_ Rec_PRIV_4
4 1 -1 0.001 0 0 0 0 0.001 #_ Rec_PRIV_4
4 2 -1 0.001 0 0 0 0 0.001 #_ Rec_PRIV_4
5 0 -1 0.001 0 0 0 0 0.001 #_ Rec_SH_5
5 1 -1 0.001 0 0 0 0 0.001 #_ Rec_SH_5
5 2 -1 0.001 0 0 0 0 0.001 #_ Rec_SH_5
8 0 -1 0.001 0 0 0 0 0.001 #_ Srv_SEAMAP_8

@iantaylor-NOAA
Copy link
Contributor

Aha, this helps. You are right that this is a change in SS3 where the Age_comp_error_controls table is only reporting rows for fleets with age comps rather than all fleets. The format of that table changed recently for models that use partition-specific weights but I hadn't noticed that it was different even if you don't have partition. Shouldn't be too hard to fix in r4ss.

Adds a wrapper for length zero Comp Errors when creating figure legends. Bug is due to missmatch in partition value between database and datainfo dataframes. Further investigation into the cause and implications of this mismatch would be helpful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants