NEURON
nrnpy_p2h.cpp File Reference
#include <../../nrnconf.h>
#include <stdio.h>
#include <InterViews/resource.h>
#include <nrnoc2iv.h>
#include <classreg.h>
#include <nrnpython.h>
#include <hoccontext.h>
#include "nrnpy_utils.h"
#include "parse.hpp"
#include "nrnmpi.h"

Go to the source code of this file.

Classes

struct  NPySecObj
 
class  Py2Nrn
 

Functions

void hoc_nopop ()
 
void hoc_pop_defer ()
 
Objecthoc_new_object (Symbol *, void *)
 
int hoc_stack_type ()
 
char ** hoc_strpop ()
 
Object ** hoc_objpop ()
 
Objecthoc_pop_object ()
 
void hoc_tobj_unref (Object **)
 
int hoc_ipop ()
 
PyObject * nrnpy_hoc2pyobject (Object *)
 
PyObject * hocobj_call_arg (int)
 
Objectnrnpy_pyobject_in_obj (PyObject *)
 
int nrnpy_ho_eq_po (Object *, PyObject *)
 
char * nrnpyerr_str ()
 Full python traceback error message returned as string. More...
 
static voidsave_thread ()
 
static void restore_thread (void *g)
 
NPySecObjnewpysechelp (Section *sec)
 
void nrnpython_reg_real ()
 
PyObject * nrnpy_ho2po (Object *)
 
void nrnpy_decref_defer (PyObject *)
 
PyObject * nrnpy_pyCallObject (PyObject *, PyObject *)
 
Objectnrnpy_po2ho (PyObject *)
 
static void py2n_component (Object *, Symbol *, int, int)
 
static void hpoasgn (Object *, int)
 
static double praxis_efun (Object *, Object *)
 
static int hoccommand_exec (Object *)
 
static int hoccommand_exec_strret (Object *, char *, int)
 
static void grphcmdtool (Object *, int, double, double, int)
 
static double func_call (Object *, int, int *)
 
static Objectcallable_with_args (Object *, int)
 
static double guigetval (Object *)
 
static void guisetval (Object *, double)
 
static int guigetstr (Object *, char **)
 
static char * po2pickle (Object *, size_t *size)
 
static Objectpickle2po (char *, size_t size)
 
static char * call_picklef (char *, size_t size, int narg, size_t *retsize)
 
static Objectpy_alltoall_type (int, int)
 
static int pysame (Object *, Object *)
 
static voidp_cons (Object *)
 
static void p_destruct (void *v)
 
static void call_python_with_section (Object *pyact, Section *sec)
 
static voidopaque_obj2pyobj (Object *ho)
 
static PyObject * hoccommand_exec_help1 (PyObject *po)
 
static PyObject * hoccommand_exec_help (Object *ho)
 
static void setpickle ()
 
static char * pickle (PyObject *p, size_t *size)
 
static PyObject * unpickle (char *s, size_t size)
 
intmk_displ (int *cnts)
 
static PyObject * char2pylist (char *buf, int np, int *cnt, int *displ)
 

Variables

void *(* nrnpy_save_thread )()
 
void(* nrnpy_restore_thread )(void *)
 
Symbolnrnpy_pyobj_sym_
 
void(* nrnpy_py2n_component )(Object *, Symbol *, int, int)
 
void(* nrnpy_hpoasgn )(Object *, int)
 
double(* nrnpy_praxis_efun )(Object *, Object *)
 
int(* nrnpy_hoccommand_exec )(Object *)
 
int(* nrnpy_hoccommand_exec_strret )(Object *, char *, int)
 
void(* nrnpy_cmdtool )(Object *, int, double, double, int)
 
double(* nrnpy_func_call )(Object *, int, int *)
 
Object *(* nrnpy_callable_with_args )(Object *, int)
 
double(* nrnpy_guigetval )(Object *)
 
void(* nrnpy_guisetval )(Object *, double)
 
int(* nrnpy_guigetstr )(Object *, char **)
 
char *(* nrnpy_po2pickle )(Object *, size_t *size)
 
Object *(* nrnpy_pickle2po )(char *, size_t size)
 
char *(* nrnpy_callpicklef )(char *, size_t size, int narg, size_t *retsize)
 
int(* nrnpy_pysame )(Object *, Object *)
 
Object *(* nrnpympi_alltoall_type )(int, int)
 
void(* nrnpy_call_python_with_section )(Object *, Section *)
 
static PyObject * main_module
 
static PyObject * main_namespace
 
static hoc_Listdlist
 
Member_func p_members [] = {0,0}
 
void *(* nrnpy_opaque_obj2pyobj_p_ )(Object *)
 
static PyObject * loads
 
static PyObject * dumps
 

Function Documentation

◆ call_picklef()

char * call_picklef ( char *  fname,
size_t  size,
int  narg,
size_t *  retsize 
)
static

Definition at line 831 of file nrnpy_p2h.cpp.

◆ call_python_with_section()

static void call_python_with_section ( Object pyact,
Section sec 
)
static

Definition at line 102 of file nrnpy_p2h.cpp.

◆ callable_with_args()

static Object * callable_with_args ( Object ho,
int  narg 
)
static

Definition at line 558 of file nrnpy_p2h.cpp.

◆ char2pylist()

static PyObject* char2pylist ( char *  buf,
int  np,
int cnt,
int displ 
)
static

Definition at line 885 of file nrnpy_p2h.cpp.

◆ func_call()

static double func_call ( Object ho,
int  narg,
int err 
)
static

Definition at line 592 of file nrnpy_p2h.cpp.

◆ grphcmdtool()

static void grphcmdtool ( Object ho,
int  type,
double  x,
double  y,
int  key 
)
static

Definition at line 534 of file nrnpy_p2h.cpp.

◆ guigetstr()

static int guigetstr ( Object ho,
char **  cpp 
)
static

Definition at line 678 of file nrnpy_p2h.cpp.

◆ guigetval()

static double guigetval ( Object ho)
static

Definition at line 649 of file nrnpy_p2h.cpp.

◆ guisetval()

static void guisetval ( Object ho,
double  x 
)
static

Definition at line 665 of file nrnpy_p2h.cpp.

◆ hoc_ipop()

int hoc_ipop ( )

◆ hoc_new_object()

Object* hoc_new_object ( Symbol ,
void  
)

Definition at line 465 of file hoc_oop.cpp.

◆ hoc_nopop()

void hoc_nopop ( )

◆ hoc_objpop()

Object** hoc_objpop ( )

Definition at line 849 of file code.cpp.

◆ hoc_pop_defer()

void hoc_pop_defer ( )

Definition at line 250 of file code.cpp.

◆ hoc_pop_object()

Object* hoc_pop_object ( )

Definition at line 860 of file code.cpp.

◆ hoc_stack_type()

int hoc_stack_type ( )

Definition at line 637 of file code.cpp.

◆ hoc_strpop()

char** hoc_strpop ( )

Definition at line 868 of file code.cpp.

◆ hoc_tobj_unref()

void hoc_tobj_unref ( Object **  )

Definition at line 219 of file code.cpp.

◆ hoccommand_exec()

static int hoccommand_exec ( Object ho)
static

Definition at line 488 of file nrnpy_p2h.cpp.

◆ hoccommand_exec_help()

static PyObject* hoccommand_exec_help ( Object ho)
static

Definition at line 452 of file nrnpy_p2h.cpp.

◆ hoccommand_exec_help1()

static PyObject* hoccommand_exec_help1 ( PyObject *  po)
static

Definition at line 426 of file nrnpy_p2h.cpp.

◆ hoccommand_exec_strret()

static int hoccommand_exec_strret ( Object ho,
char *  buf,
int  size 
)
static

Definition at line 508 of file nrnpy_p2h.cpp.

◆ hocobj_call_arg()

PyObject* hocobj_call_arg ( int  )

Definition at line 707 of file nrnpy_hoc.cpp.

◆ hpoasgn()

static void hpoasgn ( Object o,
int  type 
)
static

Definition at line 366 of file nrnpy_p2h.cpp.

◆ mk_displ()

int* mk_displ ( int cnts)

Definition at line 876 of file nrnpy_p2h.cpp.

◆ newpysechelp()

NPySecObj* newpysechelp ( Section sec)

Definition at line 871 of file nrnpy_nrn.cpp.

◆ nrnpy_decref_defer()

void nrnpy_decref_defer ( PyObject *  po)

Definition at line 415 of file nrnpy_p2h.cpp.

◆ nrnpy_ho2po()

PyObject* nrnpy_ho2po ( Object )

Definition at line 503 of file nrnpy_hoc.cpp.

◆ nrnpy_ho_eq_po()

int nrnpy_ho_eq_po ( Object ho,
PyObject *  po 
)

Definition at line 177 of file nrnpy_p2h.cpp.

◆ nrnpy_hoc2pyobject()

PyObject* nrnpy_hoc2pyobject ( Object ho)

Definition at line 191 of file nrnpy_p2h.cpp.

◆ nrnpy_po2ho()

Object* nrnpy_po2ho ( PyObject *  )

Definition at line 524 of file nrnpy_hoc.cpp.

◆ nrnpy_pyCallObject()

PyObject * nrnpy_pyCallObject ( PyObject *  callable,
PyObject *  args 
)

if (!p) { char* mes = nrnpyerr_str(); if (mes) { Fprintf(stderr, "%s\n", mes); free(mes); hoc_execerror("Call of Python Callable failed", NULL); } if (PyErr_Occurred()) { PyErr_Print(); // Python process will exit with the error code specified by the SystemExit instance. } }

Definition at line 215 of file nrnpy_p2h.cpp.

◆ nrnpy_pyobject_in_obj()

Object* nrnpy_pyobject_in_obj ( PyObject *  po)

Definition at line 205 of file nrnpy_p2h.cpp.

◆ nrnpyerr_str()

char * nrnpyerr_str ( )

Full python traceback error message returned as string.

Caller should free the return value if not NULL

Definition at line 773 of file nrnpy_p2h.cpp.

◆ nrnpython_reg_real()

void nrnpython_reg_real ( )

Definition at line 133 of file nrnpy_p2h.cpp.

◆ opaque_obj2pyobj()

static void* opaque_obj2pyobj ( Object ho)
static

Definition at line 126 of file nrnpy_p2h.cpp.

◆ p_cons()

static void* p_cons ( Object )
static

Definition at line 93 of file nrnpy_p2h.cpp.

◆ p_destruct()

static void p_destruct ( void v)
static

Definition at line 98 of file nrnpy_p2h.cpp.

◆ pickle()

static char* pickle ( PyObject *  p,
size_t *  size 
)
static

Definition at line 722 of file nrnpy_p2h.cpp.

◆ pickle2po()

static Object * pickle2po ( char *  s,
size_t  size 
)
static

Definition at line 762 of file nrnpy_p2h.cpp.

◆ po2pickle()

static char * po2pickle ( Object ho,
size_t *  size 
)
static

Definition at line 741 of file nrnpy_p2h.cpp.

◆ praxis_efun()

static double praxis_efun ( Object ho,
Object v 
)
static

Definition at line 458 of file nrnpy_p2h.cpp.

◆ py2n_component()

void py2n_component ( Object ob,
Symbol sym,
int  nindex,
int  isfunc 
)
static

Definition at line 249 of file nrnpy_p2h.cpp.

◆ py_alltoall_type()

Object * py_alltoall_type ( int  size,
int  type 
)
static

Definition at line 982 of file nrnpy_p2h.cpp.

◆ pysame()

int pysame ( Object o1,
Object o2 
)
static

Definition at line 184 of file nrnpy_p2h.cpp.

◆ restore_thread()

static void restore_thread ( void g)
static

Definition at line 29 of file nrnpy_p2h.cpp.

◆ save_thread()

static void* save_thread ( )
static

Definition at line 28 of file nrnpy_p2h.cpp.

◆ setpickle()

static void setpickle ( )
static

Definition at line 702 of file nrnpy_p2h.cpp.

◆ unpickle()

static PyObject* unpickle ( char *  s,
size_t  size 
)
static

Definition at line 752 of file nrnpy_p2h.cpp.

Variable Documentation

◆ dlist

hoc_List* dlist
static

Definition at line 79 of file nrnpy_p2h.cpp.

◆ dumps

PyObject* dumps
static

Definition at line 700 of file nrnpy_p2h.cpp.

◆ loads

PyObject* loads
static

Definition at line 699 of file nrnpy_p2h.cpp.

◆ main_module

PyObject* main_module
static

Definition at line 77 of file nrnpy_p2h.cpp.

◆ main_namespace

PyObject* main_namespace
static

Definition at line 78 of file nrnpy_p2h.cpp.

◆ nrnpy_call_python_with_section

void(* nrnpy_call_python_with_section) (Object *, Section *)

Definition at line 20 of file secbrows.cpp.

◆ nrnpy_callable_with_args

Object*(* nrnpy_callable_with_args) (Object *, int)

Definition at line 46 of file nrnmenu.cpp.

◆ nrnpy_callpicklef

char*(* nrnpy_callpicklef) (char *, size_t size, int narg, size_t *retsize)

Definition at line 37 of file ocbbs.cpp.

◆ nrnpy_cmdtool

void(* nrnpy_cmdtool) (Object *, int, double, double, int)

Definition at line 19 of file objcmd.cpp.

◆ nrnpy_func_call

double(* nrnpy_func_call) (Object *, int, int *)

Definition at line 20 of file objcmd.cpp.

◆ nrnpy_guigetstr

int(* nrnpy_guigetstr) (Object *, char **)

Definition at line 9 of file xmenu.cpp.

◆ nrnpy_guigetval

double(* nrnpy_guigetval) (Object *)

Definition at line 7 of file xmenu.cpp.

◆ nrnpy_guisetval

void(* nrnpy_guisetval) (Object *, double)

Definition at line 8 of file xmenu.cpp.

◆ nrnpy_hoccommand_exec

int(* nrnpy_hoccommand_exec) (Object *)

Definition at line 17 of file objcmd.cpp.

◆ nrnpy_hoccommand_exec_strret

int(* nrnpy_hoccommand_exec_strret) (Object *, char *, int)

Definition at line 18 of file objcmd.cpp.

◆ nrnpy_hpoasgn

void(* nrnpy_hpoasgn) (Object *, int)

◆ nrnpy_opaque_obj2pyobj_p_

void*(* nrnpy_opaque_obj2pyobj_p_) (Object *)

◆ nrnpy_pickle2po

Object*(* nrnpy_pickle2po) (char *, size_t size)

Definition at line 36 of file ocbbs.cpp.

◆ nrnpy_po2pickle

char*(* nrnpy_po2pickle) (Object *, size_t *size)

Definition at line 35 of file ocbbs.cpp.

◆ nrnpy_praxis_efun

double(* nrnpy_praxis_efun) (Object *, Object *)

Definition at line 80 of file hocprax.cpp.

◆ nrnpy_py2n_component

void(* nrnpy_py2n_component) (Object *, Symbol *, int, int)

◆ nrnpy_pyobj_sym_

Symbol* nrnpy_pyobj_sym_

◆ nrnpy_pysame

int(* nrnpy_pysame) (Object *, Object *)

Definition at line 529 of file cvodeobj.cpp.

◆ nrnpy_restore_thread

void(* nrnpy_restore_thread) (void *)

Definition at line 44 of file ivoc.cpp.

◆ nrnpy_save_thread

void*(* nrnpy_save_thread) ()

Definition at line 43 of file ivoc.cpp.

◆ nrnpympi_alltoall_type

Object*(* nrnpympi_alltoall_type) (int, int)

Definition at line 38 of file ocbbs.cpp.

◆ p_members

Member_func p_members[] = {0,0}

Definition at line 100 of file nrnpy_p2h.cpp.