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

discrete models do not respect use_dde argument #246

Open
hillalex opened this issue Nov 9, 2021 · 4 comments
Open

discrete models do not respect use_dde argument #246

hillalex opened this issue Nov 9, 2021 · 4 comments

Comments

@hillalex
Copy link
Contributor

hillalex commented Nov 9, 2021

To reproduce:

remove.packages("dde")
gen <- odin({
   initial(x) <- 1
   update(x) <- x + 1
})
mod <- gen$new(use_dde=FALSE) # FALSE is the default value anyway, but just to be really clear
mod$run(0:10)

See error:

Error in loadNamespace(name) (odin.R#100): there is no package called ‘dde’

Looks like this code path uses dde unconditionally:

wrapper_run_discrete <- function(self, private, step, y = NULL, ...,

Note also that dde is only a suggested package, but this makes it a true dependency.

@richfitz
Copy link
Member

richfitz commented Nov 9, 2021

Yeah, this is not spectacular, but it's been that way forever - most of it reflects the initial nature of discrete time models as bolted on to odin. We'll shortly move to pushing dust as the main way to run them I think.

There's a similar situation with V8 now - if you compile a model to js then you really need V8 in order to work with it. So the current dependency list is the "core" list.

Probably given how simple the usage is here we should probably write a simple iterator for odin models in the meantime

@hillalex
Copy link
Contributor Author

hillalex commented Nov 9, 2021

Just indicating in the docs that dde is a requirement for discrete models would be a quick improvement.

@richfitz
Copy link
Member

richfitz commented Nov 9, 2021

yeah, that's easy enough to add. Also probably a better error message?

@hillalex
Copy link
Contributor Author

hillalex commented Nov 9, 2021

Yes, I was initially confused and thought I'd done something wrong, until I looked at the source code. A nice odin error message would have reassured me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants