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

fims::Vector operators and implicit scalar conversion #602

Closed
wants to merge 23 commits into from

Conversation

msupernaw
Copy link
Contributor

What is the feature?

How have you implemented the solution?

Does the PR impact any other area of the project?

How to test this change

Developer pre-PR checklist

  • I relied on GitHub actions to 🧪 things for me while I sat on the 🛋️.

MOshima-PIFSC and others added 2 commits May 14, 2024 10:34
by cleaning up the R code

Removes functions
* mkObj
* create_rcpp_interface_object
* use_module
* %>%
* FIMSFrameAge

Adds importFrom(TMB, MakeADFun) to package b/c TMB is no longer
explicitly used in the codebase. And, experimented with removing usethis
b/c it was also used in ./R/ but is still used in data-raw. It is now a
suggested package. Uses :: instead of importing functions, e.g.,
utils::head().

* Constricts line width to 80 characters
* Use full stops at the end of sentences
* Implement more spacing in between roxygen tags
* Move export tag to the end in most instances
* Use explicit brackets for if statements
* Remove duplicated code in gtest by calling run_gtest()
* Parameter and object names to snake_case
* Parameter, function, and object names, largely, w/o abbreviations

fix(run_gtest): Use paste() instead of paste0() to ensure proper spacing
which is not explicit in the instructions. With paste()
they can input as many additional arguments as they want and they are
all automatically separated, e.g.,
`run_gtest("--something", "--something-else")`

Close #588
Close #564
Close #590
Copy link
Contributor

Instructions for code reviewer

Hello reviewer, thanks for taking the time to review this PR!

  • Please use this checklist during your review, checking off items that you have verified are complete!
  • For PRs that don't make changes to code (e.g., changes to README.md or Github actions workflows), feel free to skip over items on the checklist that are not relevant. Remember it is still important to do a thorough review.
  • Then, comment on the pull request with your review indicating where you have questions or changes need to be made before merging.
  • Remember to review every line of code you’ve been asked to review, look at the context, make sure you’re improving code health, and compliment developers on good things that they do.
  • PR reviews are a great way to learn, so feel free to share your tips and tricks. However, for optional changes (i.e., not required for merging), please include nit: (for nitpicking) before making the suggestion. For example, nit: I prefer using a data.frame() instead of a matrix because...
  • Engage with the developer when they respond to comments and check off additional boxes as they become complete so the PR can be merged in when all the tasks are fulfilled. Make it clear when this has been reached by commenting on the PR with something like This PR is now ready to be merged, no changes needed.

Checklist

  • The PR is requested to be merged into the appropriate branch (typically main)
  • The code is well-designed.
  • The functionality is good for the users of the code.
  • Any User Interface changes are sensible and look good.
  • The code isn’t more complex than it needs to be.
  • Code coverage remains high, indicating the new code is tested.
  • The developer used clear names for everything.
  • Comments are clear and useful, and mostly explain why instead of what.
  • Code is appropriately documented (doxygen and roxygen).

@kellijohnson-NOAA
Copy link
Contributor

I think it might be better to just rebase the proto branch with main rather than merging commits into it,

Bai-Li-NOAA and others added 4 commits May 29, 2024 09:42
- document units in code snippets of the fims-demo vignette
- add units to output figures in the fims-demo vignette and add a spawning biomass comparison figure
- add an R test to confirm that age composition intput can be in numbers or proportions
- add units for index_data and age_data in data_mile1.R

Co-authored-by: Kelli Johnson <kelli.johnson@noaa.gov>
This is necessary because changes were made to
codecov.io so that a token is required to upload.
@kellijohnson-NOAA
Copy link
Contributor

@msupernaw do we need to be doing something to move this PR along or did you rebase instead, which would allow this PR to be deleted?

@Andrea-Havron-NOAA
Copy link
Collaborator

I have a comment in our developer's notes that we decided not to implement implicit conversion to keep our code honest. Can you remind me the pros of implicit conversion? If we do move forward with this change, I agree with Kelli that this branch should be rebased either with main or dev.

Bai-Li-NOAA and others added 8 commits June 17, 2024 17:34
- post documentation for users, developers, and project managers
- reorganize vignettes under appropriate sectionss
- remove the navbar for articles to ensure no articles are hidden
* Fixes the triage label to "status: triage_needed"
* Adds text on where to find documentation of reprex and that you should
  use one. Copied from the dplyr issue template.

Close NOAA-FIMS/collaborative_workflow#136
We no longer import the magrittr pipe
For catch and index data the measurement of uncertainty should be the
standard deviation (sd) of the logged observations. The operating model
outputs a CV. I added a temporary function in data_mile1.R to calculate
the sd from the CV. In the future we will need to, behind the scenes,
take the log of the sd so the parameters stay within the bounds, which
is what the vignette is doing now. This time series of uncertainty can
later be fed to the modules but I did not change the vignette.

Close #136
For users and developers, where the information for the latter was
moved to the collaborative workflow see
NOAA-FIMS/collaborative_workflow#146.

A badge for R-universe was placed in the list of all badges!

Work was done by @k-doering-NOAA with suggestions by @kellijohnson-NOAA

Part of NOAA-FIMS/collaborative_workflow#98
They have been moved and updated in NOAA-FIMS/.github/.github
with NOAA-FIMS/.github@33c261d. Now they are available to all repositories
not just NOAA-FIMS/FIMS. I did not migrate over the refactor_request
issue template because it was largely redundant with the developer_other_issue
template and I thought it was not needed.
@kellijohnson-NOAA
Copy link
Contributor

@msupernaw given that we are not going to use implicit conversion, @Andrea-Havron-NOAA is asking what are the "pros of implicit conversion"? Once we answer that, can we delete this PR?

@msupernaw
Copy link
Contributor Author

msupernaw commented Jul 8, 2024 via email

Bai-Li-NOAA and others added 6 commits July 9, 2024 17:38
Co-authored-by: Cole-Monnahan-NOAA <Cole-Monnahan-NOAA@users.noreply.github.com>
and check column names in FIMSFrame

The column names of the S4@data object were being checked with the
validation function but there was no check in FIMSFrame and to do the
calculations within FIMSFrame all of the columns need to be present.
Right now we are checking it twice, once in FIMSFrame and once in the
validator of the FIMSFrame class. We might need a different class like an
input data class and we could check the class upon input to FIMSFrame but
this works for right now. @k-doering-NOAA do you have any ideas here?

Had to change the test of a data frame without the proper columns to just
error out because no warnings are given just a stop() command.

When writing a data frame to a csv and reading it back in, the date
formatting can be lost, e.g., 0001-01-01 turns into 1-1-1. FIMS requires
a yyyy-mm-dd format. Now the use of the as.Date() function will create
a date object from a character object but only if it is in the correct
format. If it is in the wrong format, e.g., yyyy/mm/dd, then the function
will error out.

Right now the start_year and end_year are formatted as integers because for
plotting, I thought it would be better to have year 1 versus year 0001 but
we can change this. @ian-taylor-NOAA what do you think?

Close #639 
---------

Co-authored-by: Kelli.Johnson <1536491690113302@mil>
@kellijohnson-NOAA
Copy link
Contributor

@msupernaw now that parametervectors are in dev can we delete this PR and the proto_fims_vector_operator branch?

@msupernaw
Copy link
Contributor Author

msupernaw commented Oct 10, 2024 via email

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.

6 participants