SciRuby / daru

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

Offsets should be comparable [feature request] #526

Closed jpaulgs closed 4 years ago

jpaulgs commented 4 years ago

This is a feature request / bug report.

It would be awesome if the offsets where comparable. However they are not...

one_minute_in_seconds = Daru::Offsets::Second.new(60)
one_minute = Daru::Offsets::Minute.new()

raise 'not equal' unless one_minute_in_seconds == one_minute

Why would you want to do this?

Given I have a time series Which I expect to have a specific frequency And I create the Daru::Vector from a hash (timestamp: value) Then I want to be able to compare the derived frequency with the expected frequency So that I can confirm I am working with validated data