-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adapt get_custom_effort
#335
Conversation
@damianooldoni see review below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include a new assert_that
to check for NA
s in package$data$deployments$start
and package$data$deployments$end
to prevent the uniformative error message: Error in seq.int(0, to0 - from, by) : 'to' must be a finite number.
See comment on R95.
"Did you forget to convert a string to Date with `as.Date()`?" | ||
) | ||
) | ||
|
||
# Define possible unit values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damianooldoni the function seems to behave as intended. The only minor issue that I have found is that the function returns an uninformative error message (i.e. Error in seq.int(0, to0 - from, by) : 'to' must be a finite number
) when either start
or end
columns of package$data$deployments
contains NA
s. This could be improved by returning a more informative error message.
I suggest that after these first assert_that
checks, another check should evaluate if the start
and end
columns of the deployments do not contain NA
s:
- include new
assert_that
to check forNA
s inpackage$data$deployments$start
andpackage$data$deployments$end
Thanks @MartijnUH. I will check it. I also got an email so I could find your comment there 👍 |
This PR will solve #333.
Thanks @MartijnUH for the very well description of the requested feature and the code.
I think I adapted
get_custom_effort
as you wished.Test it hard please 🔨
Can you please test the PR and so review it? Thanks.
You can install this PR directly in R:
Notice that in the example on how to calculate the total effort over all deployments (added as example in function documentation), I needed to add
dplyr::filter(effort > 0)
to your provided code, otherwise I get all deployments indeploymentIDs
,ndep
andnloc
: