Class UFuncCastingError
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
NumPy's _UFuncCastingError: the base of the casting refusals, a cast between an operand and the loop's
dtype that the casting= rule forbids. NumPy raises only its two subclasses,
UFuncInputCastingError and UFuncOutputCastingError.
public class UFuncCastingError : UFuncTypeError, ISerializable, INumSharpException
- Inheritance
-
UFuncCastingError
- Implements
- Derived
- Inherited Members
Remarks
It carries casting, from_ and to. Created directly, its text is Python's
str() of its arguments, (<ufunc 'add'>, 'safe', dtype('float64'), dtype('int64')), as NumPy
gives the class no str.
Constructors
UFuncCastingError(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 and ufunc, casting, from_ and to are null.
public UFuncCastingError(string message, Exception innerException)
Parameters
messagestringThe verbatim message.
innerExceptionExceptionThe exception that led to this one, or null for none.
Remarks
Python has no such constructor (NumPy's _UFuncCastingError takes the ufunc, the rule and the two
dtypes); for code that holds a text only.
UFuncCastingError(string, string, object, object)
NumPy's UFuncCastingError(ufunc, casting, from, to).
public UFuncCastingError(string ufunc, string casting, object from_, object to)
Parameters
ufuncstringThe ufunc's name.
castingstringThe rule (
no,equiv,safe,same_kind,unsafe).from_objectThe dtype the cast starts from.
toobjectThe dtype it would reach.
Exceptions
- ArgumentNullException
ufuncis null.
UFuncCastingError(string, string, object, object, string)
The subclasses' form: the four values and the subclass's own text.
protected UFuncCastingError(string ufunc, string casting, object from_, object to, string message)
Parameters
ufuncstringThe ufunc's name.
castingstringThe rule.
from_objectThe dtype the cast starts from.
toobjectThe dtype it would reach.
messagestringThe text, already in NumPy's form.
Exceptions
- ArgumentNullException
ufuncis null.
Properties
casting
The casting rule the cast broke (NumPy's casting: same_kind, safe, …).
public string casting { get; }
Property Value
from_
The dtype the cast starts from (NumPy's from_): a DType, or the placeholder
for NumPy's object dtype (see UFuncTypeError).
public object from_ { get; }
Property Value
to
The dtype the cast would reach (NumPy's to): a DType, or the placeholder for
NumPy's object dtype.
public object to { get; }