Remove duplicate timestamps when querying data
Remove duplicate timestamps when querying data

There is one specific instance where for historical reasons there are
duplicate timestamps in the data: the last timestamp of the last segment
of 2017 is duplicated in the first timestamp of the first segment of
2018. Until the data is fixed, we need to deduplicate the data when
reading.
Since the values at the timestamps are only really equal within a
certain margin, I'm checking for equality of non-numerical data and for
being within a certain margin of error for numerical data. If the data
falls within this margin, then I'm just taking the first value inserted,
because it should be the correct one and the one that was inserted after
that only got inserted because it was necessary to establish the
boundary conditions for the rest of the data which wasn't in the
database yet.

oemof/feedinlib