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

[Refactor]: Avoid R function names when naming FIMS parameters #412

Closed
1 task done
Andrea-Havron-NOAA opened this issue Jul 10, 2023 · 5 comments
Closed
1 task done
Labels
kind: refactor Restructure code to improve the implementation of FIMS P2 mid-level priority
Milestone

Comments

@Andrea-Havron-NOAA
Copy link
Collaborator

Andrea-Havron-NOAA commented Jul 10, 2023

Refactor request

From @kellijohnson-NOAA: In the future it might be good to not name parameters the same name as major functions in R.

example: test-fims-estimation.R

 # Maturity
    maturity <- new(fims$LogisticMaturity)
    maturity$median$value <- om_input$A50.mat
    maturity$median$is_random_effect <- FALSE
    maturity$median$estimated <- FALSE

Expected behavior

Parameter names that do not conflict with R functions within base R or other major R functions.

Current Parameter Name Proposed Parameter Name
median x50
recruit_deviations #402 recruit_multipliers, recruit_scalars

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Andrea-Havron-NOAA Andrea-Havron-NOAA added status: triage_needed This is not approved for this milestone, do not work on it yet kind: refactor Restructure code to improve the implementation of FIMS labels Jul 10, 2023
@Andrea-Havron-NOAA
Copy link
Collaborator Author

We should go through FIMS and identify other parameter names that conflict with major R functions

@Andrea-Havron-NOAA Andrea-Havron-NOAA added this to the MQ milestone Jul 11, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA added status: needs discussion Dialogue is needed before a decision can be made. and removed status: triage_needed This is not approved for this milestone, do not work on it yet labels Jul 11, 2023
@KyleShertzer-NOAA
Copy link
Contributor

Agree in general. Another reason for changing the name of this particular parameter ("median" in the logistic function) is that it's not actually a median, or at least in rare instances would it be the median in either the X or Y direction. This parameter defines the X location of Y=0.5, but 0.5 isn't necessarily the median value. Maybe we call it x50?

@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this to Needs Discussion in MQ Jul 12, 2023
@msupernaw
Copy link
Contributor

@KyleShertzer-NOAA I agree, we should be mathematically consistent. In addition, if we aren't going to treat recruitment deviations as deviations, they should also be renamed. I'm sure there are other members throughout the API that need review.

@Andrea-Havron-NOAA
Copy link
Collaborator Author

I started a table in the issue to track parameters that need to be renamed along with any proposed names. We should do thorough search and flag any parameter names that conflict with R or have a name inconsistent with its mathematical meaning.

@Andrea-Havron-NOAA Andrea-Havron-NOAA added the P2 mid-level priority label Jul 18, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this from Needs Discussion to Ready for Development in MQ Jul 25, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA removed the status in MQ Jul 25, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this to Ready for Development in MQ Jul 25, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this from Ready for Development to Needs Discussion in MQ Jul 25, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this from Needs Discussion to In Progress in MQ Jul 31, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this from In Progress to Needs Discussion in MQ Jul 31, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this from Needs Discussion to Ready for Development in MQ Sep 26, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA removed the status: needs discussion Dialogue is needed before a decision can be made. label Sep 26, 2023
@k-doering-NOAA
Copy link
Member

Work on this was merged in with #503.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: refactor Restructure code to improve the implementation of FIMS P2 mid-level priority
Projects
No open projects
Status: Done
Development

No branches or pull requests

7 participants