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

How to best reexport greta internals #12

Open
njtierney opened this issue Jun 10, 2022 · 2 comments
Open

How to best reexport greta internals #12

njtierney opened this issue Jun 10, 2022 · 2 comments
Labels
Constructor Tools Components that help users write and test new distributions

Comments

@njtierney
Copy link
Collaborator

Currently the internals are internally exported here:

https://github.com/greta-dev/greta.distributions/blob/main/R/internals.R#L1-L18

However I think if we want users to use this package to create their own greta distributions, then we need to make these exported?

In which case, we need to add documentation, so it might look like this?

#' @param distribution
#' @param ...
#' @export
distrib <- greta::.internals$nodes$constructors$distrib

It feels a bit funny to be reexporting internal functions and then giving them documentation here?

@njtierney
Copy link
Collaborator Author

We also need all of the helper functions from https://github.com/greta-dev/greta/blob/master/tests/testthat/helpers.R to establish tests, at the moment we could just copy these over into tests/testthat/helpers.R here - are you happy with that approach, @goldingn ?

@goldingn
Copy link
Member

Yep, I think copying them over is a good stopgap. We can think if there's a tidier option (like a standalone package of testing functions) later.

@njtierney njtierney added the Constructor Tools Components that help users write and test new distributions label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Constructor Tools Components that help users write and test new distributions
Projects
None yet
Development

No branches or pull requests

2 participants