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

Allow numeric as offsetDays #90

Closed
schuemie opened this issue Feb 2, 2024 · 2 comments
Closed

Allow numeric as offsetDays #90

schuemie opened this issue Feb 2, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@schuemie
Copy link
Member

schuemie commented Feb 2, 2024

Currently this throws an error:

fixedExit(offsetDays = 0)
# Error in validObject(.Object) : 
#   invalid class “FixedDurationExit” object: invalid object for slot "offsetDays" in class "FixedDurationExit": got class # "numeric", should be or extend class "integer"

which technically is correct, but would be nice if numeric is also allowed since R defaults all numbers to numeric.

@schuemie schuemie added the enhancement New feature or request label Feb 2, 2024
@mdlavallee92
Copy link
Collaborator

adding a coercion to integer within the function. in the json serialization if the value is numeric I have seen it turn into a double so I force everything to be an integer to avoid that problem. Adding the fix in the develop branch for now and will push to main when I add a few updates to the vignettes. Will close this issue when it is merged into main

mdlavallee92 added a commit that referenced this issue Feb 2, 2024
@mdlavallee92
Copy link
Collaborator

See adjustment here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants