casacore
Classes | Functions
casacore::python::numpy Namespace Reference

Classes

struct  array_scalar_from_python
 Struct with static functions to convert a numpy array scalar to the templated type (e.g. More...
 

Functions

bool PycArrayScalarCheck (PyObject *obj, int &type)
 Check if it is an array scalar object. More...
 
DataType PycArrayScalarType (PyObject *obj_ptr)
 Get the data type of the array scalar object. More...
 
ValueHolder makeScalar (PyObject *obj, int type)
 Make a scalar object. More...
 
void register_convert_arrayscalars ()
 Register all array scalar converters. More...
 
template<typename T >
getScalar (const ValueHolder &)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Bool getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 

Function Documentation

◆ getScalar() [1/2]

template<typename T >
T casacore::python::numpy::getScalar ( const ValueHolder vh)
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 66 of file PycArrayNP.h.

References casacore::ValueHolder::asBool().

◆ getScalar() [2/2]

template<>
DComplex casacore::python::numpy::getScalar ( const ValueHolder vh)
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 66 of file PycArrayNP.h.

References casacore::ValueHolder::asBool().

◆ makeScalar()

ValueHolder casacore::python::numpy::makeScalar ( PyObject *  obj,
int  type 
)

◆ PycArrayScalarCheck()

bool casacore::python::numpy::PycArrayScalarCheck ( PyObject *  obj,
int &  type 
)

◆ PycArrayScalarType()

DataType casacore::python::numpy::PycArrayScalarType ( PyObject *  obj_ptr)

Get the data type of the array scalar object.

It returns TpBool, TpInt, TpFloat, or TpComplex. TpOther is returned if unrecognized.

◆ register_convert_arrayscalars()

void casacore::python::numpy::register_convert_arrayscalars ( )

Register all array scalar converters.