fixed btrdb pointwidth.from_timedelta issue#68
Conversation
| that the returned real duration is sufficient. | ||
| """ | ||
| return cls.from_nanoseconds(delta.total_seconds()*1e9) | ||
| return cls.from_nanoseconds(int(delta.total_seconds()*1e9)) |
There was a problem hiding this comment.
This will drop the fractional portion of the float. Is that really what we want to do here? As in, does this matter to the user or do we want to round up? I suppose I'm asking if there is a rare case where they are right on a boundary and we are chopping the value and they pop into the wrong pointwidth....
There was a problem hiding this comment.
I think in the vast majority of cases timedelta() * 1e9 will return a whole number as a float but in the rare cases where this timedelta() * 1e9 is a not a whole number, I think we should always round down since the user expects a point width as close to the length of the timedelta without going over it.
|
@aorticweb actually this cannot be merged to the master branch as that is only for releases. Can you modify this PR to go into the develop branch? |
No description provided.