-
Notifications
You must be signed in to change notification settings - Fork 204
[Types] Add timedelta64 support #571
Copy link
Copy link
Open
Labels
coreInternal engine: Shape, Storage, TensorEngine, iteratorsInternal engine: Shape, Storage, TensorEngine, iteratorsdocumentation-neededFeature requires documentation after implementation or depiction of lack of documentationFeature requires documentation after implementation or depiction of lack of documentationenhancementNew feature or requestNew feature or requestmissing feature/sNumPy function not yet implemented in NumSharpNumPy function not yet implemented in NumSharp
Milestone
Metadata
Metadata
Assignees
Labels
coreInternal engine: Shape, Storage, TensorEngine, iteratorsInternal engine: Shape, Storage, TensorEngine, iteratorsdocumentation-neededFeature requires documentation after implementation or depiction of lack of documentationFeature requires documentation after implementation or depiction of lack of documentationenhancementNew feature or requestNew feature or requestmissing feature/sNumPy function not yet implemented in NumSharpNumPy function not yet implemented in NumSharp
Overview
Add support for
timedelta64type to NumSharp for duration arithmetic and time series operations.Problem
NumSharp lacks timedelta support, needed for datetime arithmetic:
Use cases:
datetime64 - datetime64 = timedelta64Proposal
Task List
TimeDelta64struct with unit awareness:NPTypeCode.TimeDelta64toNPTypeCode.cstimedelta + timedelta → timedeltatimedelta - timedelta → timedeltatimedelta * scalar → timedeltatimedelta / scalar → timedeltatimedelta / timedelta → floatdatetime + timedelta → datetimedatetime - timedelta → datetimedatetime - datetime → timedeltanp.timedelta64()constructorUnits (matching NumPy)
Same as datetime64: Y, M, W, D, h, m, s, ms, us, ns
C# Type Mapping
Implementation Effort
MEDIUM — Similar to datetime64, with additional arithmetic operations.
Estimated: ~300 lines for struct and operations.
Related
References