Table of Contents

Class DatetimeTimedeltaCastingImpl

Namespace
NumSharp
Assembly
NumSharp.dll

The cast between datetime64 and timedelta64 (either direction) — NumPy's datetime_to_timedelta_resolve_descriptors: the destination inherits the SOURCE's unit when none is given (which is how promote_types turns m8[Y] into M8[Y] before taking the GCD), and the cast is always unsafe.

public sealed class DatetimeTimedeltaCastingImpl : CastingImpl
Inheritance
DatetimeTimedeltaCastingImpl
Inherited Members

Methods

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

NumPy's 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.

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

Parameters

givenDescrs DType[]

The operand descriptors, inputs first; an output entry may be null.

loopDescrs DType[]

Receives the descriptors the loop runs on, one per operand.

viewOffset long

The byte offset at which the operation is a plain VIEW (0 for a no-op cast between identical descriptors), or NoView.

Returns

NPY_CASTING

The cast safety of running the loop on loopDescrs.

Exceptions

TypeError

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