LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
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 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.