|
TECA
The Toolkit for Extreme Climate Analysis
|
Codes for interfacing with numpy arrays. More...
Functions | |
| TECA_EXPORT bool | append (teca_variant_array *varr, PyObject *obj) |
| Append values from the object to the variant array. More... | |
| TECA_EXPORT bool | copy (teca_variant_array *varr, PyObject *obj) |
| Copy values from the object into variant array. More... | |
| TECA_EXPORT bool | set (teca_variant_array *varr, unsigned long i, PyObject *obj) |
| Set i'th element of the variant array to the value of the object. More... | |
| TECA_EXPORT p_teca_variant_array | new_variant_array (PyObject *obj, bool deep_copy=false) |
| template<typename NT > | |
| void | variant_array_capsule_destrcutor (PyObject *cap) |
| a destructor used with the following funciton More... | |
| template<typename NT > | |
| TECA_EXPORT PyArrayObject * | new_object (teca_variant_array_impl< NT > *varrt, bool deep_copy=false) |
| Construct a new numpy array initialized with the contents of the variant array. More... | |
| TECA_EXPORT PyArrayObject * | new_object (teca_variant_array *varr, bool deep_copy=false) |
| Construct a new numpy array initialized with the contents of the variant array. More... | |
Codes for interfacing with numpy arrays.
| TECA_EXPORT bool teca_py_array::append | ( | teca_variant_array * | varr, |
| PyObject * | obj | ||
| ) |
Append values from the object to the variant array.
| TECA_EXPORT bool teca_py_array::copy | ( | teca_variant_array * | varr, |
| PyObject * | obj | ||
| ) |
Copy values from the object into variant array.
| TECA_EXPORT PyArrayObject* teca_py_array::new_object | ( | teca_variant_array * | varr, |
| bool | deep_copy = false |
||
| ) |
Construct a new numpy array initialized with the contents of the variant array.
| TECA_EXPORT PyArrayObject* teca_py_array::new_object | ( | teca_variant_array_impl< NT > * | varrt, |
| bool | deep_copy = false |
||
| ) |
Construct a new numpy array initialized with the contents of the variant array.
| TECA_EXPORT p_teca_variant_array teca_py_array::new_variant_array | ( | PyObject * | obj, |
| bool | deep_copy = false |
||
| ) |
Construct a new variant array and initialize it from the object. The data is transferred by zero-copy operation if possible and if not then a deep copy is made. One can force a deep copy. Returns a new variant array if successful and a nullptr otherwise.
| TECA_EXPORT bool teca_py_array::set | ( | teca_variant_array * | varr, |
| unsigned long | i, | ||
| PyObject * | obj | ||
| ) |
Set i'th element of the variant array to the value of the object.
| void teca_py_array::variant_array_capsule_destrcutor | ( | PyObject * | cap | ) |
a destructor used with the following funciton