Table of Contents

Class UFuncNoLoopError

Namespace
NumSharp
Assembly
NumSharp.dll

NumPy's _UFuncNoLoopError: a ufunc has no loop for its operands' dtypes. Its text is NumPy's ufunc 'add' did not contain a loop with signature matching types (dtype('<U1'), dtype('int64')) -> None: the input dtypes, then the output ones, each a lone value or a tuple.

public class UFuncNoLoopError : UFuncTypeError, ISerializable, INumSharpException
Inheritance
UFuncNoLoopError
Implements
Derived
Inherited Members

Remarks

A subclass of UFuncTypeError (and so of TypeError); its own subclass is UFuncBinaryResolutionError. NumSharp raises it wherever NumPy does (a numeric ufunc over text, a text ufunc over numbers, a dtype= the ufunc has no loop for), with NumPy's dtype classes or instances as its resolver reported them.

Constructors

UFuncNoLoopError(string, Exception)

Creates the error from a message and the exception that caused it, .NET's standard constructor every NumSharp exception has: the message is kept verbatim, ufunc is null and dtypes is empty.

public UFuncNoLoopError(string message, Exception innerException)

Parameters

message string

The verbatim message.

innerException Exception

The exception that led to this one, or null for none.

Remarks

Python has no such constructor (NumPy's _UFuncNoLoopError takes the ufunc and its dtypes); for code that holds a text only.

UFuncNoLoopError(string, int, params object[])

NumPy's _UFuncNoLoopError(ufunc, dtypes): the message is NumPy's str, splitting dtypes after the ufunc's nin inputs.

public UFuncNoLoopError(string ufunc, int nin, params object[] dtypes)

Parameters

ufunc string

The ufunc's name.

nin int

The ufunc's input count (NumPy reads ufunc.nin): the first nin dtypes are the inputs, the rest the outputs.

dtypes object[]

Every operand's dtype-like value, inputs then outputs (null where NumPy has None, an output nobody requested).

Remarks

One side prints as its lone value when it has one (dtype('<U1') -> None) and as a tuple otherwise ((dtype('<U1'), dtype('int64')) -> (None, None), () when empty), as NumPy's _unpack_tuple does. Footgun: a single literal null argument binds as the whole dtypes array (C#'s params rule), not as one None; write new object[] { null }.

Exceptions

ArgumentNullException

ufunc is null.

ArgumentOutOfRangeException

nin is negative.

TypeError

dtypes is null (Python's tuple(None): 'NoneType' object is not iterable).

UFuncNoLoopError(string, object[], string)

The subclass form: the ufunc, its dtypes and the subclass's own text (NumPy's _UFuncBinaryResolutionError overrides str).

protected UFuncNoLoopError(string ufunc, object[] dtypes, string message)

Parameters

ufunc string

The ufunc's name.

dtypes object[]

The dtypes, already copied.

message string

The text, already in NumPy's form.

Exceptions

ArgumentNullException

ufunc is null.

Properties

dtypes

Every operand's dtype-like value, inputs then outputs (NumPy's dtypes tuple): a DType, a DTypeMeta, or null for None. Read-only, as NumPy's tuple is.

public ReadOnlyCollection<object> dtypes { get; }

Property Value

ReadOnlyCollection<object>