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

better error message when using wrong indexes #166

Closed
annecori opened this issue Apr 11, 2019 · 1 comment
Closed

better error message when using wrong indexes #166

annecori opened this issue Apr 11, 2019 · 1 comment

Comments

@annecori
Copy link

@annecori annecori commented Apr 11, 2019

https://github.com/mrc-ide/patchmodel/tree/dccb6740e75bba58bfe8c68efacd43f78d4c80ba

In R/stochastic_seir_patch_odin.R, line 16, if you uncomment the end - error not very helpful

richfitz added a commit that referenced this issue Apr 11, 2019
Fixes #166
@richfitz
Copy link
Member

@richfitz richfitz commented Apr 11, 2019

With the change above, this is the behaviour:

> odin::odin({
+   m[,] <- user()
+   r[] <- m[i, 1] + m[1, j]
+   dim(m) <- user()
+   dim(r) <- 5
+   initial(x) <- 1
+   update(x) <- 1
+ })
Error: Index variable 'j' not possible for array of rank 1
	r[] <- m[i, 1] + m[1, j] # (line 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.