Skip to content

Fix codebase from variety of issues#195

Merged
Schiano-NOAA merged 7 commits intomainfrom
repo-cleanup
Feb 27, 2026
Merged

Fix codebase from variety of issues#195
Schiano-NOAA merged 7 commits intomainfrom
repo-cleanup

Conversation

@Schiano-NOAA
Copy link
Collaborator

@Schiano-NOAA Schiano-NOAA linked an issue Feb 25, 2026 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Feb 25, 2026

New version checklist

  • Package version in DESCRIPTION has been updated
  • Release notes have been drafted/published
  • Cheatsheet content has been updated (if applicable)
  • Cheatsheet version has been updated

@github-actions
Copy link
Contributor

Code Metrics Report

Coverage Code to Test Ratio Test Execution Time
71.2% 1:0.1 5m7s

Code coverage of files in pull request scope (66.2%)

Files Coverage
R/convert_output.R 58.9%
R/plot_natural_mortality.R 79.6%
R/plot_spawning_biomass.R 78.9%
R/process_data.R 58.0%
R/utils_plot.R 88.2%

Reported by octocov

Copy link
Collaborator

@sbreitbart-NOAA sbreitbart-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think everything looks good except for one thing, which I'm struggling to test: running plot_spawning_biomass() with facet. I've tried several sample datasets and faceted for fleet and sex with no luck. Can you please provide an example?

@Schiano-NOAA
Copy link
Collaborator Author

I think everything looks good except for one thing, which I'm struggling to test: running plot_spawning_biomass() with facet. I've tried several sample datasets and faceted for fleet and sex with no luck. Can you please provide an example?

Tbh I am not sure if I have any examples either

@Schiano-NOAA
Copy link
Collaborator Author

@sbreitbart-NOAA I'll do a manual test and add in try out the facet feature in spawning biomass plot

@Schiano-NOAA
Copy link
Collaborator Author

@sbreitbart-NOAA feel free to try it out, but this is how the facetting looks :) I just merged in #196 so there is a rebase

# test data
# 1. Define the dimensions
years <- 1995:2025
areas <- c(1, 2)
sexes <- c("male", "female")

# 2. Create the grid of all combinations
df <- expand.grid(year = years, area = areas, sex = sexes)

# 3. Add the static columns
df$label <- "spawning_biomass"
df$uncertainty_label <- "se"
df$module_name <- "fisheries_module_v1"

# 4. Generate synthetic values
set.seed(42)
df$estimate <- runif(nrow(df), min = 500, max = 2000)
df$uncertainty <- df$estimate * runif(nrow(df), min = 0.05, max = 0.15)

# 5. Reorder columns (including the new uncertainty_label)
df <- df[, c("label", "estimate", "uncertainty", "uncertainty_label", "module_name", "year", "area", "sex")]

# Preview the result
head(df)

devtools::load_all()

plot_spawning_biomass(df)
image

@sbreitbart-NOAA
Copy link
Collaborator

Great! This worked too: plot_spawning_biomass(df, facet = "sex"). LGTM!

@Schiano-NOAA Schiano-NOAA merged commit 9227db6 into main Feb 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants