Skip to content

Conversation

@FabrizioSandri
Copy link
Owner

With this pull request, the Rcpp::String datatype has been added to RcppDeepState. Now it is possible to analyze functions that take an argument of type Rcpp::String.

A detailed description of the motivation behind this pull request can be found in the Issue #10.

Fixes #10

@tdhock
Copy link
Collaborator

tdhock commented Aug 18, 2022

also can you please add some documentation (either in the package or on the wiki) about what steps need to be done to add a new supported data type? it looks like there are four parts of the code which need to be edited? Is there any way to reduce that number, to simplify addition of new data types? I'm thinking of some R list data structure which can be read to obtain all of the info necessary.

@FabrizioSandri
Copy link
Owner Author

@tdhock The deepstate_fun_create function has changed significantly since I submitted this pull request. I just submitted another pull request with some new improvements to this function to address an issue that happens when a function takes a std::string as an input. This pull request, I believe, may be closed.

it looks like there are four parts of the code which need to be edited? Is there any way to reduce that number, to simplify addition of new data types?

With #9 I changed the deepstate_fun_create function, where I rearranged the code based on your suggestion(link to the conversation) to have a single table used to lookup what to do. The procedure of introducing a new supported datatype has been simplified to only two steps with this new table:

  • add another entry to this table with some information about the new datatype
  • add a method within /inst/include/RcppDeepState.h that randomly initializes this datatype

@FabrizioSandri
Copy link
Owner Author

Before I add the documentation, I wanted to ask you whether method is better for adding documentation within a package.
Is it a good idea to include this in the package's vignette file?

@tdhock
Copy link
Collaborator

tdhock commented Aug 22, 2022

A vignette is good especially if there are code examples where you want to show the output.
Wiki is good otherwise.
Make sure to add links from the README so people can find these docs easily.

@FabrizioSandri
Copy link
Owner Author

@tdhock In the wiki, I've published a guide on how to add a new datatype to RcppDeepState. As you suggested, I included a link to the wiki in the readme file.

@tdhock
Copy link
Collaborator

tdhock commented Aug 24, 2022

these wiki page docs https://github.com/FabrizioSandri/RcppDeepState/wiki/Add-a-new-datatype-to-RcppDeepState look great thanks!

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.

Missing Rcpp Strings support

3 participants