audeering / audeer

Helpful Python functions
https://audeering.github.io/audeer/
Other
3 stars 0 forks source link

Textual representation of timedeltas #158

Open ChristianGeng opened 1 week ago

ChristianGeng commented 1 week ago

In other projects, we have an as I find unfortunate way to render timedeltas textually, or example here.

Would it make sense to have a function that converts this into a representation that is better for humans like for example the one here?

Possibly this is already implemented somewhere but I couldn't locate it.

hagenw commented 1 week ago

Possibly this is already implemented somewhere but I couldn't locate it.

No, we have not implemented something like this. So far, I was ok with 0 days 02:00:09.703062500 as it is easy to see how many days, hours, minutes, and seconds we have (at least compared when representing it just as seconds which would be 7209.703062500 in this case.

In the example you show, we don't need the high precision after, e.g. 0 days 02:00:10 would do, but when looking at start and end values of segments, this might be difference.

But feel free to propose something that you think would be better.