beacon-biosignals / TimeSpans.jl

A Julia package that provides a `TimeSpan` type for representing a continuous span between two points in time.
Other
6 stars 2 forks source link

More generic NamedTuple handling #42

Open haberdashPI opened 2 years ago

haberdashPI commented 2 years ago

As noted in #41 by @ararslan:

kleinschmidt commented 2 years ago

I think automatically supporting anything that can be converted to Nanosecond is a huge footgun. It's not hard to imagine someone creating a timespan with e.g. Ints giving start/stop in seconds or milliseconds without fully understanding what's going on internally and having mysterious, silent breakage (when comparing to other spans with nanosecond-based times).

kleinschmidt commented 2 years ago

(of course, the same goes for the TimeSpan(0, 10) constructor)

haberdashPI commented 2 years ago

Oh good point... mm... for now maybe the #41 should only accept tuples with Period values.

ararslan commented 2 years ago

Yeah, that's a very good point. Scratch that part then.