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

Feature request: Either make the error message clearer or switch to a warning with empty arguments in call to rxRename() #688

Closed
billdenney opened this issue Jun 11, 2024 · 1 comment · Fixed by #693
Assignees

Comments

@billdenney
Copy link
Contributor

I just spent an inordinate amount of time trying to find the error with my code where I had an extra comma in the call to rxRename, like below. I can take on the task of making the error message clearer or switching to a warning.

@mattfidler, would you prefer this to switch to a warning (something like "empty argument ignored") or keep as an error with a clearer message (something like "empty arguments not allowed")?

library(rxode2)
#> rxode2 2.1.2 using 8 threads (see ?getRxThreads)
#>   no cache: create with `rxCreateCache()`

mod1 <- function() {
  ini({
    # central 
    KA=2.94E-01
    CL=1.86E+01
    V2=4.02E+01
    # peripheral
    Q=1.05E+01
    V3=2.97E+02
    # effects
    Kin=1
    Kout=1
    EC50=200 
  })
  model({
    C2 <- centr/V2
    C3 <- peri/V3
    d/dt(depot) <- -KA*depot
    d/dt(centr) <- KA*depot - CL*C2 - Q*C2 + Q*C3
    d/dt(peri)  <- Q*C2 - Q*C3
    eff(0) <- 1
    d/dt(eff)   <- Kin - Kout*(1-C2/(EC50+C2))*eff
  })
}

rxRename(mod1, foo = eff, )
#> Error in FUN(X[[i]], ...): argument ".quoted" is missing, with no default

Created on 2024-06-11 with reprex v2.1.0

@billdenney billdenney self-assigned this Jun 11, 2024
@mattfidler
Copy link
Member

I think a warning is easier to deal with as a user. I lean in that direction. You can always turn warnings into errors with options.

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 a pull request may close this issue.

2 participants