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
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
givenDescrsDType[]The operand descriptors, inputs first; an output entry may be null.
loopDescrsDType[]Receives the descriptors the loop runs on, one per operand.
viewOffsetlongThe 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).