LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
A traits class providing Python conversion functions for Array. More...
#include <numpy.h>
Public Types | |
typedef Array< T, N, C >::Element | Element |
typedef boost::remove_const < Element >::type | NonConst |
Static Public Member Functions | |
static bool | fromPythonStage1 (PyPtr &p) |
Check if a Python object is convertible to T and optionally begin the conversion by replacing the input with an intermediate. More... | |
static bool | fromPythonStage2 (PyPtr const &input, Array< T, N, C > &output) |
Complete a Python to C++ conversion begun with fromPythonStage1(). More... | |
static PyObject * | toPython (Array< T, N, C > const &m, PyObject *owner=NULL) |
Create a numpy.ndarray from an ndarray::Array. More... | |
static PyTypeObject const * | getPyType () |
Static Public Member Functions inherited from ndarray::detail::PyConverterBase< Array< T, N, C > > | |
static bool | matches (PyObject *arg) |
Check if a Python object might be convertible to T. More... | |
static int | fromPython (PyObject *arg, Array< T, N, C > *output) |
Convert a Python object to a C++ object. More... | |
A traits class providing Python conversion functions for Array.
This specialization, for Array, adds addititional optional arguments to the toPython() conversion member function.
typedef Array<T,N,C>::Element ndarray::PyConverter< Array< T, N, C > >::Element |
typedef boost::remove_const<Element>::type ndarray::PyConverter< Array< T, N, C > >::NonConst |
|
inlinestatic |
Check if a Python object is convertible to T and optionally begin the conversion by replacing the input with an intermediate.
p | On input, a Python object to be converted. On output, a Python object to be passed to fromPythonStage2(). |
Definition at line 124 of file numpy.h.
|
inlinestatic |
Complete a Python to C++ conversion begun with fromPythonStage1().
The copy will be shallow if possible and deep if necessary to meet the data type and contiguousness requirements. If a non-const array is required, the copy will always be shallow; if this is not possible, ValueError will be raised.
The output Array's shared_ptr owner attribute will own a reference to the numpy array that ultimately owns the data (either the original or the copy).
input | Result of fromPythonStage1(). |
output | Reference to existing output C++ object. |
Definition at line 191 of file numpy.h.
|
inlinestatic |
|
inlinestatic |
Create a numpy.ndarray from an ndarray::Array.
The Array will be shallow-copied with reference counting if either m.getManager() is not empty or the optional owner argument is supplied; otherwise a deep copy will be made.
m | The input Array object. |
owner | A Python object that owns the memory in the Array. If NULL, one will be constructed from m.getManager(). |
Definition at line 221 of file numpy.h.