Skip to content

Commit

Permalink
Release 0.3.0.0
Browse files Browse the repository at this point in the history
* Fits to length data using an age-to-length-conversion matrix, `data1`
  includes the necessary information needed to fit to both ages and lengths.
* Adds C++ ParameterVector to allow for the estimation of time-varying
  parameters.
* Implements R wrapper functions to facilitate
  * creating the input model specifications with `create_default_*()`,
    `update_parameters()`, and `initialize_*()`;
  * adding -999 to the missing fleet, year, age, length, etc. combinations;
  * running the model with a user-supplied argument of n_of_loops, where the
    default is three, to restart the optimizer from the previous run of nlmimb;
  * summarizing the output with the `FIMSFit()` function and class.
* Implements a switch for global verbosity within FIMS through the use
  of {cli} messages and warnings.
* Updates the logging system complete with a vignette about how to use it, the
  logging system can be used for both R and C++ errors, warnings, and
  information.
* Creates the initial infrastructure to implement random effects with density
  functions.
* Implements a helper function to get the parameter names from the
  C++ code and populate the results with those names.
* Makes lpdf_vec return 0 if data is missing.

R ----

doc(FIMSFrame): Adds documentation to accessors and increased consistency
doc(ParameterVector): Adds time-varying example to the vignette that is
  turned off by default but users can experiment
doc(fims-demo): Adds example of a model that is built but not fit
doc: Shares argument documentation across functions

feat(create_default_*()): Creates default values for FIMS parameters
feat(update_parameters()): Updates default values for FIMS parameters
feat(initialize_*()): Uses methods::new() to set up FIMS modules
feat(FIMSFit): Created FIMSFit as an S4 Class with [create_FIMSFit()]
  so people can also create a FIMSFit object without having to use
  [fit_fims()] and so the object returned by [fit_fims()] looks the
  same no matter if you want the uncertainty calculated or not via
  `get_sd`. Objects are not added to things to obj, opt, and report and
  instead they are explicitly returned as a slot in the S4 FIMSFit class
feat(estimates): In FIMSFit
feat(verbose): Uses cli_inform cli_abort. Users can now set the global
  verbose level through `options(rlib_message_verbosity = "quiet")` to stop
  cli::cli_inform() messages from coming through. This allows for the
  verbose argument to be removed from all functions. And,
  [is_fims_verbose()] can check internally in functions to see if FIMS
  is currently verbose.

fix(data1): Renamed from data_mile1 and adds length data
fix(fims-demo): Updates vignette doi Bai et al.
fix(FIMSFrame): Allows for subsetting of multiple fleets with %in%
fix(plot.FIMSFrame): Adds y and ... for plot to be properly documented
  where previously we only had x, which led to scales not being seen as a
  package that was needed. The methods proposed in #672 was a work around
  where this commit fixes the problem.
  fix(Rcpp_Parameter*): Moves to zzz.R because when in operators it was
  leading to warnings when compiling in R. The movement allows this file
  to be ran before the others and it does not matter if Rcpp_Parameter or
  Rcpp_ParameterVector is exported/defined. I also worked on the
  formatting of those functions as well as combining the documentation
  rather for similar, i.e., methods.

refactor(cli): Updates error message to use cli formatting
refactor(DESCRIPTION): Adds packages
  * Adds purrr, tidyr, tibble, stats
  * Removes tidyverse
  * Depends on R 4.1.0 because of the use of the native pipe, which is
    available in R version 4.1.0. Status-quo dependency was R 4.0.
refactor(tests): convert tests to testthat format in
  test-unit-rcpp-interface-variable-vector.R

C++ ----

doc: Remove authors, email from file headers, some cleanup to cpp file
  header with consistent use of @file, @brief, @details, and @copyright
  for every file in inst/include and notes.
doc(mainpage): Adds mainpage for doxygen as discussed by the
documentation group led by @Bai-Li-NOAA in July (notes [here](
  https://docs.google.com/document/d/1tPCSSanZ7SHaSE5SMkPoYrZh_lsswe7o5gtEyJmA0DU/edit?tab=t.0#heading=h.enmw68u5r5hm)).
doc(Parameter): Fully documents Parameter and ParameterVector matching
  documentation at the function definition with what is shown in Rcpp
  methods::show() inside R.
doc(pos): Uses pos in position for time-varying so it does not seem like
  things can only vary with time.

feat: add variable_map infrastructure
  * adds variable map as an object in information.hpp
  * adds std::vector<uint32_t> key to density_components_base
  * adds unique ID to VariableVector class and get_id function
  * resizes key and pass to densities in rcpp_distributions
feat: Uses .estimated_m and .is_random_effect_m in interface
feat(get_force_scalar): method in fims::Vector to return the first index
  if the vector is size one.
feat(get_parameter_names): Gets parameter names from C++

fix: Sets unique key for all tracked parameter/derived value in Rcpp objects
fix(information): add data error checks in information
fix(rcpp_interface): add get and set id functions to fleet interface
fix(multinomial_lpmf.hpp): make lpdf_vec to return 0 if data is missing
fix(Parameter): Removes estimated_m
fix(Makevars): Removes c++17 flag
  In favor of USE_CXX17 = "yes" and removes -w flag where this fix is
  known to work on Windows.
fix(clear): Removes everything because there was some information from
  random effects that was not being cleared leading to crashes. Many
  functions in the C++ code were also changed to CamelCase such as Clear().
  Refactored function names to match style of other member functions.
  clear() procedure creates a new instance of the information singleton object.
fix: Removes log_sigma_recruit from the Beverton--Holt
  stock--recruitment interface because it is now a part of the
  distribution associated with log_devs
fix(logging): Uses macros
  * Removes old logging
  * pretty format for output
  * added format string for json
  * created a logging vignette
  * Adds information about DFIMS_DEBUG information
  * Adds throw on error
fix: Collapses methods using S4 Group Generic Functions
fix: Defines methods for Ops, Math, and Summary
fix: Updates parameter min/max default values

refactor(model.hpp): Loops over all density modules to sum up joint
  negative log-likelihoods
refactor: Adds i=0 in for loops because R CMD check was complaining
  about significant warnings in compiling the c++ code because i was not
  initialized.
refactor(information): Improves readability
refactor: Uses C++ 17
refactor: Renames SIMULATE_F to FIMS_SIMULATE_F
refactor: Renames REPORT_F to FIMS_REPORT_F

GitHub ----

chore: change actions/checkout@v3 to v4

feat: Adds call-spell-check.yml from {ghactions4r} to spellcheck with WORDLIST

fix: Adds .json to .gitignore
fix: Adds .vscode to .gitignore
fix: Removes parallel tests because they were not helpful
fix: revert sim_num to 100 to simulate 100 sets of test data
  (see tests/testthat/fixtures/simulate-integration-test-data.R)

TODO: ----

* Remove code for processR in tests
* Find TODO statements in documentation and add the documentation
* think about renaming some of the Rcpp functions
* cli_* needs to be implemented throughout the package
* fix(fims-demo): Does not use returned object from fit_fims for plots
* no metadata object found to revise superClass error with sdreport class
* Add a standalone test (CI-only) for checking the speed of parallel runs
* fix parallel tests to avoid comparing run time with serial execution

Co-authored-by: Andrea-Havron-NOAA <[email protected]>
Co-authored-by: Bai-Li-NOAA <[email protected]>
Co-authored-by: ChristineStawitz-NOAA <[email protected]>
Co-authored-by: cmlegault <[email protected]>
Co-authored-by: Cole-Monnahan-NOAA <[email protected]>
Co-authored-by: JaneSullivan-NOAA <[email protected]>
Co-authored-by: iantaylor-NOAA <[email protected]>
Co-authored-by: k-doering-NOAA <[email protected]>
Co-authored-by: kellijohnson-NOAA <[email protected]>
Co-authored-by: KyleShertzer-NOAA <[email protected]>
Co-authored-by: msupernaw <[email protected]>
Co-authored-by: nathanvaughan-NOAA <[email protected]>
Co-authored-by: rklasky <[email protected]>

Part of #170: refactor distributions_base
Part of #388
Part of #573: add normal_lpdf
Part of #581: add lognormal_lpdf
Part of #585: add multinomial_lpmf
Part of #586
Part of #630
Part of #644
Part of #645
Part of #646
Part of #662
Part of #671
Part of #695
Part of #702
Close #672
Close #690
  • Loading branch information
ChristineStawitz-NOAA authored and kellijohnson-NOAA committed Jan 1, 2025
1 parent f0d4e76 commit 1332ded
Show file tree
Hide file tree
Showing 165 changed files with 16,618 additions and 6,285 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"packages": "make,gcc,g++,cmake,clang-tidy,clang-format,clang,doxygen,ninja-build,libxtst6,libxt6"
},
"ghcr.io/rocker-org/devcontainer-features/r-packages:1": {
"packages": "RcppEigen,dplyr,ggplot2,jsonlite,magrittr,methods,Rcpp,scales,TMB,usethis,devtools",
"packages": "RcppEigen,dplyr,ggplot2,jsonlite,magrittr,methods,Rcpp,scales,TMB,usethis,devtools,tibble",
"installSystemRequirements": true
},
// option to run rstudio. you can type rserver into the command line to
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy-doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Get repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Installing build dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Get repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Installing build dependencies
run: |
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/call-allcontributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Collect contributors

on:
workflow_dispatch:
schedule:
- cron: '0 8 * * 1'

jobs:
run-r-script:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup R
uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
gh
allcontributors
- name: Collect contributor data
run: Rscript -e 'allcontributors::add_contributors(files = c("README.md"), alphabetical = FALSE)'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "Update contributors"
branch: update-contributors
title: "Update contributors"
body: "This PR updates the contributors list."
labels: "auto-update"
add-paths: |
README.md
17 changes: 17 additions & 0 deletions .github/workflows/call-spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# run devtools::spell_check()
name: call-spell-check
# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
# this workflow runs on pushing to main, pull requests to main, and manually.
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
jobs:
call-workflow:
uses: nmfs-fish-tools/ghactions4r/.github/workflows/spell-check.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/get-gtest-codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Ninja
run: sudo apt-get install ninja-build
- uses: r-lib/actions/setup-r@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-checklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: pr-checklist
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Comment PR'
uses: actions/[email protected]
if: github.event_name == 'pull_request'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# Format hpp and cpp files under inst/include, src/, and test/gtest
# We use Google style to format code.
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: DoozyX/[email protected]
with:
source: './inst/include ./src ./tests/gtest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: install clang-tidy
run: sudo apt update && sudo apt -y install clang-tidy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-googletest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Ninja
shell: bash
run: ${{ runner.os == 'macOS' && 'brew install ninja' || runner.os == 'Windows' && 'choco install ninja' || 'sudo apt-get install ninja-build' }}
Expand Down
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
# RStudio files
.Rproj.user/

# produced vignettes and libraries
vignettes/*.html
vignettes/*.pdf
vignettes/*/libs/

# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth

Expand Down Expand Up @@ -85,12 +80,14 @@ vignettes/*/libs/

# IDE specific files
*.vscode
**/.vscode/

# mac OS files
*.DS_Store

# All log file
# All log files and json output
*.log
*.json

#TMB tmp.def file
src/tmp.def
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(FIMS
) # CXX is the language name

# GoogleTest requires at least C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

include(FetchContent)

Expand Down
178 changes: 132 additions & 46 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,45 +1,123 @@
Package: FIMS
Title: The Fisheries Integrated Modeling System
Version: 0.2.0.0
Version: 0.3.0.0
Authors@R: c(
person("Christine", "Stawitz", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-3122-4501")),
person("Nathan", "Vaughan", role = "aut"),
person("Howard", "Townsend", role = "aut"),
person(c("Ian", "G."), "Taylor", role = "aut",
comment = c(ORCID = "0000-0002-4232-5669")),
person("Matthew", "Supernaw", role = "aut"),
person("Jane", "Sullivan", role = "aut"),
person("Kyle", "Shertzer", role = "aut",
comment = c(ORCID = "0000-0001-7196-5959")),
person("Megumi", "Oshima", role = "aut"),
person(c("Cole", "C."), "Monnahan", role = "aut",
comment = c(ORCID = "0000-0003-0871-6700")),
person(c("Timothy", "J."), "Miller", role = "aut",
comment = c(ORCID = "0000-0003-1411-1206")),
person("Richard", "Methot", role = "aut"),
person("Patrick", "Lynch", role = "aut",
comment = c(ORCID = "0000-0001-7121-6181")),
person("Bai", "Li", role = "aut",
comment = c(ORCID = "0000-0002-8249-1442")),
person("Huihua", "Lee", role = "aut"),
person(c("Christopher", "M."), "Legault", role = "aut",
comment = c(ORCID = "0000-0002-0328-1376")),
person(c("Kelli", "F."), "Johnson", role = "aut",
comment = c(ORCID = "0000-0002-5149-451X")),
person(c("James", "N."), "Ianelli", role = "aut",
comment = c(ORCID = "0000-0002-7170-8677")),
person("Alan", "Haynie", role = "aut"),
person(c("Andrea", "M."), "Havron", role = "aut",
comment = c(ORCID = "0000-0002-4080-448X")),
person(c("Kathryn", "L."), "Doering", role = "aut",
comment = c(ORCID = "0000-0002-0396-7044")),
person(c("Edward", "J."), "Dick", role = "aut",
comment = c(ORCID = "0000-0001-7681-9176")),
person("Jon", "Brodziak", role = "aut"),
person("Kristan", "Blackhart", role = "aut"),
person("Peter", "Kuriyama", role = "aut",
comment = c(ORCID = "0000-0002-6971-4015"))
person(
role = c("aut", "cre"),
family = "Johnson",
given = c("Kelli", "F."),
email = "[email protected]",
comment = c(ORCID = "0000-0002-5149-451X")
),
person(
role = "aut",
family = "Brodziak",
given = c("Jon", "K.", "T."),
comment = c(ORCID = "0000-0001-8690-5588")
),
person(
role = "aut",
family = "Doering",
given = c("Kathryn", "L."),
comment = c(ORCID = "0000-0002-0396-7044")
),
person(
role = "aut",
family = "Havron",
given = c("Andrea", "M."),
comment = c(ORCID = "0000-0002-4080-448X")
),
person(
role = "aut",
family = "Klasky",
given = c("Ronald"),
comment = c(ORCID = "0009-0004-7563-7716")
),
person(
role = "aut",
family = "Kuriyama",
given = c("Peter", "T."),
comment = c(ORCID = "0000-0002-6971-4015")
),
person(
role = "aut",
family = "Legault",
given = c("Christopher", "M."),
comment = c(ORCID = "0000-0002-0328-1376")
),
person(
role = "aut",
family = "Li",
given = "Bai",
comment = c(ORCID = "0000-0002-8249-1442")
),
person(
role = "aut",
family = "Miller",
given = c("Timothy", "J."),
comment = c(ORCID = "0000-0003-1411-1206")
),
person(
role = "aut",
family = "Monnahan",
given = c("Cole", "C."),
comment = c(ORCID = "0000-0003-0871-6700")
),
person(
role = "aut",
family = "Oshima",
given = c("Megumi", "C."),
comment = c(ORCID = "0009-0002-2239-1594")
),
person(
role = "aut",
family = "Shertzer",
given = c("Kyle", "W."),
comment = c(ORCID = "0000-0001-7196-5959")
),
person(
role = "aut",
family = "Stawitz",
given = c("Christine", "C."),
email = "[email protected]",
comment = c(ORCID = "0000-0003-3122-4501")
),
person(
role = "aut",
family = "Sullivan",
given = c("Jane", "Y."),
comment = c(ORCID = "0000-0002-8094-1673")
),
person(
role = "aut",
family = "Supernaw",
given = "Matthew",
comment = c(ORCID = "0009-0007-3681-7433")
),
person(
role = "aut",
family = "Taylor",
given = c("Ian", "G."),
comment = c(ORCID = "0000-0002-4232-5669")
),
person(
role = "aut",
family = "Vaughan",
given = c("Nathan", "R."),
comment = c(ORCID = "0009-0000-3054-6950")
),
person(
role = "ctb",
family = "Blackhart",
given = "Kristan",
comment = c(ORCID = "0000-0003-4232-2510")
),
person(
role = "ctb",
family = "Ianelli",
given = c("James", "N."),
comment = c(ORCID = "0000-0002-7170-8677")
)
)
Description: The Fisheries Integrated Modeling System is a next-generation
framework of stock assessment models, assisting fishery managers with
Expand All @@ -54,31 +132,39 @@ License: GPL (>= 3) | file LICENSE
URL: https://github.com/noaa-fims/fims, https://noaa-fims.github.io
BugReports: https://github.com/noaa-fims/fims/issues
Depends:
R (>= 4.0)
Imports:
R (>= 4.1.0)
Imports:
cli,
dplyr,
ggplot2,
glue,
jsonlite,
methods,
purrr,
Rcpp,
rlang,
scales,
TMB (>= 1.8.0)
Suggests:
stats,
tibble,
TMB (>= 1.8.0),
utils
Suggests:
covr,
knitr,
mockery,
parallel,
remotes,
rmarkdown,
snowfall,
testthat (>= 3.0.0),
tidyverse,
tidyr,
usethis,
withr
LinkingTo:
LinkingTo:
Rcpp,
RcppEigen,
TMB
VignetteBuilder:
VignetteBuilder:
knitr
Config/testthat/edition: 3
Config/testthat/parallel: true
Expand Down
Loading

0 comments on commit 1332ded

Please sign in to comment.