Table of Contents

Class TimeToTimeCastingImpl

Namespace
NumSharp
Assembly
NumSharp.dll

The within-class cast of datetime64 / timedelta64 — a unit conversion. Port of NumPy's time_to_time_resolve_descriptors (datetime.c): identical metadata (or an exact 10³ᵏ metric-prefix fold such as [1000ms] → [s]) is a no-op view / equiv byte swap; a generic source is safe; a generic destination or, for timedelta, a jump across the years-months barrier is unsafe; towards a finer unit that divides exactly is safe, anything else same_kind.

public sealed class TimeToTimeCastingImpl : CastingImpl
Inheritance
TimeToTimeCastingImpl
Inherited Members

Methods

ResolveDescriptors(DType[], DType[], out long)

resolve_descriptors: given the operand descriptors (an output entry may be null — "please pick"), fills loopDescrs with the descriptors the loop will actually run on and returns the cast safety of doing so. viewOffset is the byte offset at which the operation is a plain VIEW (0 for a no-op cast between identical descriptors), or NoView.

public override NPY_CASTING ResolveDescriptors(DType[] givenDescrs, DType[] loopDescrs, out long viewOffset)

Parameters

givenDescrs DType[]
loopDescrs DType[]
viewOffset long

Returns

NPY_CASTING

Exceptions

TypeError

The descriptors cannot be resolved (NumPy returns -1 with an error set).