RAVE
pypia.h File Reference

Python version of the PIA API. More...

#include "Python.h"
#include "ravepia.h"

Go to the source code of this file.

Classes

struct  PyPia
 A pia. More...
 

Macros

#define PyPia_Type_NUM   0
 index of type
 
#define PyPia_GetNative_NUM   1
 index of GetNative
 
#define PyPia_GetNative_RETURN   RavePIA_t*
 return type for GetNative
 
#define PyPia_GetNative_PROTO   (PyPia*)
 arguments for GetNative
 
#define PyPia_New_NUM   2
 index of New
 
#define PyPia_New_RETURN   PyPia*
 return type for New
 
#define PyPia_New_PROTO   (RavePIA_t*)
 arguments for New
 
#define PyPia_API_pointers   3
 number of API pointers
 
#define PyPia_CAPSULE_NAME   "_pia._C_API"
 
#define PyPia_GetNative    (*(PyPia_GetNative_RETURN (*)PyPia_GetNative_PROTO) PyPia_API[PyPia_GetNative_NUM])
 Returns a pointer to the internal pia, remember to release the reference when done with the object.
 
#define PyPia_New    (*(PyPia_New_RETURN (*)PyPia_New_PROTO) PyPia_API[PyPia_New_NUM])
 Creates a new pia instance.
 
#define PyPia_Check(op)
 Checks if the object is a python gra instance.
 
#define PyPia_Type   (*(PyTypeObject*)PyPia_API[PyPia_Type_NUM])
 
#define import_pia()
 Imports the PyPia module (like import _pia in python).
 

Detailed Description

Python version of the PIA API.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2025-12-04

Macro Definition Documentation

◆ import_pia

#define import_pia ( )
Value:
PyPia_API = (void **)PyCapsule_Import(PyPia_CAPSULE_NAME, 1);

Imports the PyPia module (like import _pia in python).

◆ PyPia_API_pointers

#define PyPia_API_pointers   3

number of API pointers

◆ PyPia_Check

#define PyPia_Check ( op)
Value:
(Py_TYPE(op) == &PyPia_Type)

Checks if the object is a python gra instance.

◆ PyPia_GetNative

#define PyPia_GetNative    (*(PyPia_GetNative_RETURN (*)PyPia_GetNative_PROTO) PyPia_API[PyPia_GetNative_NUM])

Returns a pointer to the internal pia, remember to release the reference when done with the object.

(RAVE_OBJECT_RELEASE).

◆ PyPia_GetNative_NUM

#define PyPia_GetNative_NUM   1

index of GetNative

◆ PyPia_GetNative_PROTO

#define PyPia_GetNative_PROTO   (PyPia*)

arguments for GetNative

◆ PyPia_GetNative_RETURN

#define PyPia_GetNative_RETURN   RavePIA_t*

return type for GetNative

◆ PyPia_New

#define PyPia_New    (*(PyPia_New_RETURN (*)PyPia_New_PROTO) PyPia_API[PyPia_New_NUM])

Creates a new pia instance.

Release this object with Py_DECREF. If a RavePIA_t instance is provided and this instance already is bound to a python instance, this instance will be increfed and returned.

Parameters
[in]pia- the RavePIA_t intance.
Returns
the PyPia instance.

◆ PyPia_New_NUM

#define PyPia_New_NUM   2

index of New

◆ PyPia_New_PROTO

#define PyPia_New_PROTO   (RavePIA_t*)

arguments for New

◆ PyPia_New_RETURN

#define PyPia_New_RETURN   PyPia*

return type for New

◆ PyPia_Type_NUM

#define PyPia_Type_NUM   0

index of type