You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been playing around with this package (which is fantastic by the way!) and I have stumbled across some issues with the support for datetime.timedetas. Some of the issues appear to be due to the underlying implementation of the datetime.timedelta objects rather than Pint, but the way they are handled does seem a bit strange.
That looks strange, but seems to be simply due to how it is displayed.
The bigger issue to do with functionality is the following;
>>> d = ureg.Quantity(10, 'meters')
>>> t = ureg.Quantity(datetime.timedelta(seconds=4), units='seconds')
>>> d/t
TypeError: unsupported operand type(s) for /: 'int' and 'datetime.timedelta'
That is not completely unexpected, the exception is raised by the underlying datetime.timedelta implementation rather than Pint. However it doesn't feel right... the only way around this seems to be not to use a datetime.timedelta like so;
Would a pull request addressing these issues be accepted? I have never submitted a PR before but I would be happy to give it a go if there is support for these changes?
The text was updated successfully, but these errors were encountered:
I have been playing around with this package (which is fantastic by the way!) and I have stumbled across some issues with the support for datetime.timedetas. Some of the issues appear to be due to the underlying implementation of the datetime.timedelta objects rather than Pint, but the way they are handled does seem a bit strange.
Expanding on the example in issue #608
Looks good, lets try some unit conversions.
All good, try some more.
That looks strange, but seems to be simply due to how it is displayed.
The bigger issue to do with functionality is the following;
That is not completely unexpected, the exception is raised by the underlying datetime.timedelta implementation rather than Pint. However it doesn't feel right... the only way around this seems to be not to use a datetime.timedelta like so;
Would a pull request addressing these issues be accepted? I have never submitted a PR before but I would be happy to give it a go if there is support for these changes?
The text was updated successfully, but these errors were encountered: