SciRuby / daru

Data Analysis in RUby
BSD 2-Clause "Simplified" License
1.03k stars 139 forks source link

Infer offsets that are a natural number multiple of seconds #529

Closed jpaulgs closed 4 years ago

jpaulgs commented 4 years ago

Fixes #527

I'd prefer to express all inferred offsets as a multiple of seconds, however I've attempted to retain the existing behaviour which could return an instance of Daru::Offsets::Day, Daru::Offsets::Hour, Daru::Offsets::Minute or Daru::Offsets::Second.

Where the offset is less than 1 second I'm still returning nil which could be contentious. So I'm happy to change that but it would means that the method #freq_string can return results like 1/100000S