Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

Adds renameGear() function to rename fishing gears, mirroring the existing renameSpecies() functionality.

Implementation

  • New function renameGear(params, replace) in R/manipulate_species.R

    • Updates gear names in gear_params data frame
    • Updates gear dimension names in selectivity and catchability arrays
    • Updates gear names in initial_effort vector
    • Validates gear names exist before renaming
    • Validates resulting params object
  • Tests in tests/testthat/test-manipulate_species.R

    • Verifies all gear-related slots update correctly
    • Verifies effort values preserved
    • Tests error handling for non-existent gears
  • Documentation following existing patterns

    • Roxygen2 documentation with experimental lifecycle badge
    • Updated NEWS.md

Usage

replace <- c(Industrial = "Trawl", Otter = "Beam_Trawl")
params <- renameGear(NS_params, replace)
gear_params(params)$gear

Note: NAMESPACE and man files will be regenerated by devtools::document() during the package build process.

Original prompt

This section details on the original issue you should resolve

<issue_title>renameGear()</issue_title>
<issue_description>We need a function renameGear() that allows the renaming of gears in the same way as renameSpecies() allows the renaming of species.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add renameGear function for renaming gears Add renameGear() function to rename fishing gears in MizerParams Nov 16, 2025
Copilot AI requested a review from gustavdelius November 16, 2025 13:24
@gustavdelius gustavdelius marked this pull request as ready for review November 16, 2025 13:35
@gustavdelius gustavdelius merged commit bfd04f5 into master Nov 16, 2025
4 of 5 checks passed
@gustavdelius gustavdelius deleted the copilot/add-rename-gear-function branch November 16, 2025 13:35
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.

renameGear()

2 participants