Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime & TimeSpan Operation overloads #553

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/Deedle/Series.fs
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,10 @@ and
series.Select(fun (KeyValue(k, v)) -> op v)
static member inline internal UnaryOperation<'T>(series:Series<'K, 'T>, op : 'T -> 'T) =
series.Select(fun (KeyValue(k, v)) -> op v)
static member inline internal ScalarGenericOperationL<'T1, 'T2, 'T3>(series:Series<'K, 'T1>, scalar, op: 'T1 -> 'T2 -> 'T3) =
series.Select(fun (KeyValue(k, v)) -> op v scalar)
static member inline internal ScalarGenericOperationR<'T1, 'T2, 'T3>(scalar, series:Series<'K, 'T1>, op: 'T1 -> 'T2 -> 'T3) =
series.Select(fun (KeyValue(k, v)) -> op v scalar)
static member inline internal ScalarOperationL<'T>(series:Series<'K, 'T>, scalar, op : 'T -> 'T -> 'T) =
series.Select(fun (KeyValue(k, v)) -> op v scalar)
static member inline internal ScalarOperationR<'T>(scalar, series:Series<'K, 'T>, op : 'T -> 'T -> 'T) =
Expand Down Expand Up @@ -1005,6 +1009,26 @@ and
/// [category:Operators]
static member (/) (series, scalar) = Series<'K, _>.ScalarOperationL<decimal>(series, scalar, (/))

/// [category:Operators]
static member (+) (scalar, series) = Series<'K, _>.ScalarOperationR<TimeSpan>(scalar, series, (+))
/// [category:Operators]
static member (+) (series, scalar) = Series<'K, _>.ScalarOperationL<TimeSpan>(series, scalar, (+))
/// [category:Operators]
static member (-) (scalar, series) = Series<'K, _>.ScalarOperationR<TimeSpan>(scalar, series, (-))
/// [category:Operators]
static member (-) (series, scalar) = Series<'K, _>.ScalarOperationL<TimeSpan>(series, scalar, (-))

/// [category:Operators]
static member (-) (scalar, series) = Series<'K, _>.ScalarGenericOperationR<DateTime, DateTime, TimeSpan>(scalar, series, (-))
/// [category:Operators]
static member (-) (series, scalar) = Series<'K, _>.ScalarGenericOperationL<DateTime, DateTime, TimeSpan>(series, scalar, (-))
/// [category:Operators]
static member (-) (series, scalar) = Series<'K, _>.ScalarGenericOperationL<DateTime, TimeSpan, DateTime>(series, scalar, (-))
/// [category:Operators]
static member (+) (scalar, series) = Series<'K, _>.ScalarGenericOperationR<DateTime, TimeSpan, DateTime>(scalar, series, (+))
/// [category:Operators]
static member (+) (series, scalar) = Series<'K, _>.ScalarGenericOperationL<DateTime, TimeSpan, DateTime>(series, scalar, (+))

/// [category:Operators]
static member (+) (s1, s2) = Series<'K, _>.VectorOperation<int>(s1, s2, (+))
/// [category:Operators]
Expand Down Expand Up @@ -1034,6 +1058,11 @@ and
/// [category:Operators]
static member (/) (s1, s2) = Series<'K, _>.VectorOperation<decimal>(s1, s2, (/))

/// [category:Operators]
static member (+) (s1, s2) = Series<'K, _>.VectorOperation<TimeSpan>(s1, s2, (+))
/// [category:Operators]
static member (-) (s1, s2) = Series<'K, _>.VectorOperation<TimeSpan>(s1, s2, (-))

/// [category:Operators]
static member (+) (s1, s2) = Series<'K, _>.VectorOperation<string>(s1, s2, (+))
/// [category:Operators]
Expand Down