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

464 loadmodule #525

Closed
wants to merge 3 commits into from
Closed

464 loadmodule #525

wants to merge 3 commits into from

Conversation

Andrea-Havron-NOAA
Copy link
Collaborator

What is the feature?

  • Refactoring from fims <- Rcpp::Module("fims", PACKAGE = "FIMS") to Rcpp::loadModule("fims", TRUE)

How have you implemented the solution?

  • Rcpp::loadModule("fims", TRUE) has been added to zzz.R
  • rcpp_interface.hpp has been moved to the src folder so that Rcpp::compileAttributes() can autogenerate needed code to expose Rcpp classes and functions to R
  • Rcpp classes and functions are made publically available by adding export tags to FIMS-package.R
  • Rcpp::compileAttributes() was run to autogenerate the new RcppExport.cpp file in src. This file, along with the addition of #define TMB_LIB_INIT R_init_FIMS to the top of FIMS.cpp replaces the init.h file in interface. This workflow requires Rcpp::compileAttributes() to be run by the developer if updates are needed to the RcppExport.cpp file
  • tests and vignettes are changed so that Rcpp modules and functions can be called directly without referencing a fims module first
  • file paths are updated throughout

Does the PR impact any other area of the project?

  • Rcpp classes and functions can now be accessed directly after calling library(FIMS)

How to test this change

  • This change cannot be tested in a test environment as devtools::load_all() automatically loads all Rcpp classes and functions into the R environment
  • This change can be tested with the fims-demo.Rmd, which calls Rcpp classes and functions without first specifying a fims module.

Developer pre-PR checklist

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

Co-authored-by: Kathryn Doering <kathryn.doering@noaa.gov>
Co-authored-by: Andrea-Havron-NOAA <Andrea-Havron-NOAA@users.noreply.github.com>
@Andrea-Havron-NOAA Andrea-Havron-NOAA linked an issue Nov 16, 2023 that may be closed by this pull request
@ChristineStawitz-NOAA ChristineStawitz-NOAA deleted the 464-loadmodule branch November 28, 2023 00:37
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.

[Feature]: use loadModule
2 participants