Skip to content

Feature: Auto-populate selectivity function parameter columns in gear_params#431

Open
gustavdelius wants to merge 1 commit into
masterfrom
gear-params-autopopulate
Open

Feature: Auto-populate selectivity function parameter columns in gear_params#431
gustavdelius wants to merge 1 commit into
masterfrom
gear-params-autopopulate

Conversation

@gustavdelius

Copy link
Copy Markdown
Member

This PR implements auto-population of selectivity function parameter columns in the gear_params S3 class.

Summary of Changes

  1. Auto-population in check_gear_params:
    Updated check_gear_params to automatically check the arguments of functions stored in sel_func and add any missing arguments as columns in the gear_params object with NA values.
  2. Copy and Default-filling Flow:
    Since the columns are now automatically created, validGearParams's copy-over and default-filling flow works out-of-the-box when assigning the gear_params object back to the MizerParams object.
  3. Unit Tests:
    Added a new unit test block in tests/testthat/test-setFishing.R to verify that setting sel_func <- "sigmoid_length" dynamically creates l25 and l50 columns.
    Adapted tests/testthat/test-calc-selectivity.R to strip the subclass prior to parameter deletion testing.

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.

1 participant