NEURON
nrnpy_hoc.cpp File Reference
#include <nrnpython.h>
#include <structmember.h>
#include <InterViews/resource.h>
#include <nrnoc2iv.h>
#include <ocjump.h>
#include "ivocvect.h"
#include "oclist.h"
#include "ocfile.h"
#include <cstdint>
#include "nrniv_mf.h"
#include "nrnpy_utils.h"
#include "../nrniv/shapeplt.h"
#include <vector>
#include "nrnwrap_dlfcn.h"
#include "parse.hpp"
#include <hoccontext.h>
#include "nrnpy_hoc.h"

Go to the source code of this file.

Classes

struct  NPySecObj
 
struct  PyHocObject
 

Macros

#define BYTEHEADER
 
#define BYTESWAP(_X__, _TYPE__)
 

Functions

void lvappendsec_and_ref (void *sl, Section *sec)
 
Sectionnrn_noerr_access ()
 
void hoc_pushs (Symbol *)
 
double * hoc_evalpointer ()
 
double cable_prop_eval (Symbol *sym)
 
void nrn_change_nseg (Section *, int)
 
void hoc_push_string ()
 
char ** hoc_strpop ()
 
void hoc_objectvar ()
 
Objecthoc_newobj1 (Symbol *, int)
 
int ivoc_list_count (Object *)
 
Object ** hoc_objpop ()
 
Objecthoc_obj_look_inside_stack (int)
 
void hoc_object_component ()
 
int hoc_stack_type ()
 
void hoc_call ()
 
void hoc_tobj_unref (Object **)
 
void hoc_unref_defer ()
 
void sec_access_push ()
 
PyObject * nrnpy_pushsec (PyObject *)
 
bool hoc_valid_stmt (const char *, Object *)
 
PyObject * nrnpy_nrn ()
 
PyObject * nrnpy_cas (PyObject *, PyObject *)
 
PyObject * nrnpy_forall (PyObject *, PyObject *)
 
PyObject * nrnpy_newsecobj (PyObject *, PyObject *, PyObject *)
 
int nrn_secref_nchild (Section *)
 
PyObject * nrnpy_hoc2pyobject (Object *)
 
PyObject * nrnpy_ho2po (Object *)
 
Objectnrnpy_po2ho (PyObject *)
 
Objectnrnpy_pyobject_in_obj (PyObject *)
 
static void pyobject_in_objptr (Object **, PyObject *)
 
int nrnpy_set_vec_as_numpy (PyObject *(*p)(int, double *))
 
int nrnpy_set_gui_callback (PyObject *)
 
double ** nrnpy_setpointer_helper (PyObject *, PyObject *)
 
Symbolivoc_alias_lookup (const char *name, Object *ob)
 
int nrn_netcon_weight (NetCon *, double **)
 
int nrn_matrix_dim (void *, int)
 
NPySecObjnewpysechelp (Section *sec)
 
static void add2topdict (PyObject *)
 
static PyObject * cpp2refstr (char **cpp)
 
static PyObject * hocobj_call (PyHocObject *self, PyObject *args, PyObject *kwrds)
 
static PyObject * nrnexec (PyObject *self, PyObject *args)
 
static PyObject * hoc_ac (PyObject *self, PyObject *args)
 
static void hocobj_dealloc (PyHocObject *self)
 
static PyObject * hocobj_new (PyTypeObject *subtype, PyObject *args, PyObject *kwds)
 
static int hocobj_init (PyObject *subself, PyObject *args, PyObject *kwds)
 
static PyObject * hocobj_name (PyObject *pself, PyObject *args)
 
static PyObject * hocobj_repr (PyObject *p)
 
static Instsave_pc (Inst *newpc)
 
static int hocobj_pushargs (PyObject *args, std::vector< char * > &s2free)
 
static void hocobj_pushargs_free_strings (std::vector< char * > &s2free)
 
static Symbolgetsym (char *name, Object *ho, int fail)
 
static int component (PyHocObject *po)
 
int nrnpy_numbercheck (PyObject *po)
 
PyObject * nrnpy_hoc_pop ()
 
static int set_final_from_stk (PyObject *po)
 
static voidnrnpy_hoc_int_pop ()
 
static voidnrnpy_hoc_bool_pop ()
 
static voidfcall (void *vself, void *vargs)
 
PyObject * hocobj_call_arg (int i)
 
static Arrayinfohocobj_aray (Symbol *sym, Object *ho)
 
static PyHocObjectintermediate (PyHocObject *po, Symbol *sym, int ix)
 
static void hocobj_pushtop (PyHocObject *po, Symbol *sym, int ix)
 
static void hocobj_objectvar (Symbol *sym)
 
static PyObject * hocobj_getsec (Symbol *sym)
 
static void eval_component (PyHocObject *po, int ix)
 
PyObject * nrn_hocobj_ptr (double *pd)
 
int nrn_is_hocobj_ptr (PyObject *po, double *&pd)
 
static void symlist2dict (Symlist *sl, PyObject *dict)
 
static int setup_doc_system ()
 
PyObject * toplevel_get (PyObject *subself, const char *n)
 
static PyObject * hocobj_getattr (PyObject *subself, PyObject *pyname)
 
static PyObject * hocobj_baseattr (PyObject *subself, PyObject *args)
 
static PyObject * hocobj_getattro (PyObject *subself, PyObject *name)
 
static int hocobj_setattro (PyObject *subself, PyObject *pyname, PyObject *value)
 
static int araylen (Arrayinfo *a, PyHocObject *po)
 
static int araychk (Arrayinfo *a, PyHocObject *po, int ix)
 
static Py_ssize_t hocobj_len (PyObject *self)
 
static int hocobj_nonzero (PyObject *self)
 
static PyObject * hocobj_iter (PyObject *self)
 
static hoc_Itemnext_valid_secitem (hoc_Item *q, hoc_Item *ql)
 
static PyObject * iternext_sl (PyHocObject *po, hoc_Item *ql)
 
static PyObject * hocobj_iternext (PyObject *self)
 
static PyObject * hocobj_getitem (PyObject *self, Py_ssize_t ix)
 
static int hocobj_setitem (PyObject *self, Py_ssize_t i, PyObject *arg)
 
static PyObject * mkref (PyObject *self, PyObject *args)
 
static PyObject * setpointer (PyObject *self, PyObject *args)
 
static PyObject * hocobj_vptr (PyObject *pself, PyObject *args)
 
static long hocobj_hash (PyHocObject *self)
 
PyObject * nrn_ptr_richcmp (void *self_ptr, void *other_ptr, int op)
 
static PyObject * hocobj_richcmp (PyHocObject *self, PyObject *other, int op)
 
static PyObject * hocobj_same (PyHocObject *pself, PyObject *args)
 
static char * double_array_interface (PyObject *po, long &stride)
 
static IvocVectnrnpy_vec_from_python (void *v)
 
static void nrnpy_store_savestate_ (char **save_data, uint64_t *save_data_size)
 
static void nrnpy_restore_savestate_ (int64_t size, char *data)
 
int nrnpy_set_toplevel_callbacks (PyObject *rvp_plot0, PyObject *plotshape_plot0, PyObject *get_mech_object_0, PyObject *store_savestate, PyObject *restore_savestate)
 
static double object_to_double_ (Object *obj)
 
static voidnrnpy_get_pyobj_ (Object *obj)
 
static void nrnpy_decref_ (void *pyobj)
 
static PyObject * gui_helper_3_helper_ (const char *name, Object *obj, int handle_strptr)
 
static Object ** gui_helper_3_ (const char *name, Object *obj, int handle_strptr)
 
static char ** gui_helper_3_str_ (const char *name, Object *obj, int handle_strptr)
 
static Object ** gui_helper_ (const char *name, Object *obj)
 
static Object ** vec_as_numpy_helper (int size, double *data)
 
static Object ** nrnpy_vec_to_python (void *v)
 
static Objectrvp_rxd_to_callable_ (Object *obj)
 
PyObject * get_plotshape_data (PyObject *sp)
 
static PyObject * hocpickle_reduce (PyObject *self, PyObject *args)
 
static PyObject * hocpickle_setstate (PyObject *self, PyObject *args)
 
static PyObject * libpython_path (PyObject *self, PyObject *args)
 
int nrnpy_vec_math_register (PyObject *callback)
 
int nrnpy_rvp_pyobj_callback_register (PyObject *callback)
 
static bool pyobj_is_vector (PyObject *obj)
 
static PyObject * py_hocobj_math (const char *op, PyObject *obj1, PyObject *obj2)
 
static PyObject * py_hocobj_math_unary (const char *op, PyObject *obj)
 
static PyObject * py_hocobj_add (PyObject *obj1, PyObject *obj2)
 
static PyObject * py_hocobj_uabs (PyObject *obj)
 
static PyObject * py_hocobj_uneg (PyObject *obj)
 
static PyObject * py_hocobj_upos (PyObject *obj)
 
static PyObject * py_hocobj_sub (PyObject *obj1, PyObject *obj2)
 
static PyObject * py_hocobj_mul (PyObject *obj1, PyObject *obj2)
 
static PyObject * py_hocobj_div (PyObject *obj1, PyObject *obj2)
 
char get_endian_character ()
 
static void sectionlist_helper_ (void *sl, Object *args)
 
static int get_nrncore_opt_value (const char *option)
 
static int nrncore_enable_value ()
 return value of neuron.coreneuron.enable More...
 
static int nrncore_file_mode_value ()
 return value of neuron.coreneuron.file_mode More...
 
static char * nrncore_arg (double tstop)
 
PyObject * nrnpy_hoc ()
 

Variables

PyTypeObject * psection_type
 
void(* nrnpy_sectionlist_helper_ )(void *, Object *)
 
Object **(* nrnpy_gui_helper_ )(const char *, Object *)
 HAVE_IV. More...
 
Object **(* nrnpy_gui_helper3_ )(const char *, Object *, int)
 
char **(* nrnpy_gui_helper3_str_ )(const char *, Object *, int)
 
double(* nrnpy_object_to_double_ )(Object *)
 
void *(* nrnpy_get_pyobj )(Object *obj)
 
void(* nrnpy_restore_savestate )(int64_t, char *)
 
void(* nrnpy_store_savestate )(char **save_data, uint64_t *save_data_size)
 
void(* nrnpy_decref )(void *pyobj)
 
Symlisthoc_top_level_symlist
 
Symlisthoc_built_in_symlist
 
Insthoc_pc
 
int nrn_inpython_
 
Objectdatahoc_top_level_data
 
int section_object_seen
 
Symbolnrnpy_pyobj_sym_
 
Symbolnrn_child_sym
 
IvocVect *(* nrnpy_vec_from_python_p_ )(void *)
 
Object **(* nrnpy_vec_to_python_p_ )(void *)
 
Object **(* nrnpy_vec_as_numpy_helper_ )(int, double *)
 
Object *(* nrnpy_rvp_rxd_to_callable )(Object *)
 
PyObject * pmech_types
 
PyObject * rangevars_
 
int hoc_max_builtin_class_id
 
int hoc_return_type_code
 
static cTemplatehoc_vec_template_
 
static cTemplatehoc_list_template_
 
static cTemplatehoc_sectionlist_template_
 
static char array_interface_typestr [5] = "|f8"
 
static PyObject * pfunc_get_docstring = NULL
 
static PyObject * topmethdict = NULL
 
static const char * hocobj_docstring = "class neuron.hoc.HocObject - Hoc Object wrapper"
 
static PyObject * rvp_plot = NULL
 
static PyObject * plotshape_plot = NULL
 
static PyObject * get_mech_object_ = NULL
 
static PyObject * nrnpy_rvp_pyobj_callback = NULL
 
PyTypeObject * hocobject_type
 
static PyMethodDef HocMethods []
 
static PyObject * curargs_
 
static int refuse_to_look
 
static Symbolsym_vec_x
 
static Symbolsym_mat_x
 
static Symbolsym_netcon_weight
 
static PyObject *(* vec_as_numpy )(int, double *)
 
static PyObject * store_savestate_ = NULL
 
static PyObject * restore_savestate_ = NULL
 
static PyObject * gui_callback = NULL
 
static PyMethodDef hocobj_methods []
 
static PyMethodDef toplevel_methods []
 
static PyObject * nrnpy_vec_math = NULL
 
static PyMemberDef hocobj_members [] = {{NULL, 0, 0, 0, NULL}}
 
int(* nrnpy_nrncore_enable_value_p_ )()
 value of neuron.coreneuron.enable as 0, 1 (-1 if error) More...
 
int(* nrnpy_nrncore_file_mode_value_p_ )()
 value of neuron.coreneuron.file_mode as 0, 1 (-1 if error) More...
 
char *(* nrnpy_nrncore_arg_p_ )(double tstop)
 Gets the python string returned by neuron.coreneuron.nrncore_arg(tstop) return a strdup() copy of the string which should be free when the caller finishes with it. More...
 

Macro Definition Documentation

◆ BYTEHEADER

#define BYTEHEADER
Value:
uint32_t _II__; \
char* _IN__; \
char _OUT__[16]; \
int BYTESWAP_FLAG = 0;

Definition at line 2707 of file nrnpy_hoc.cpp.

◆ BYTESWAP

#define BYTESWAP (   _X__,
  _TYPE__ 
)
Value:
if (BYTESWAP_FLAG == 1) { \
_IN__ = (char*) &(_X__); \
for (_II__ = 0; _II__ < sizeof(_TYPE__); _II__++) { \
_OUT__[_II__] = _IN__[sizeof(_TYPE__) - _II__ - 1]; \
} \
(_X__) = *((_TYPE__*) &_OUT__); \
}

Definition at line 2712 of file nrnpy_hoc.cpp.

Function Documentation

◆ add2topdict()

static void add2topdict ( PyObject *  dict)
static

Definition at line 2833 of file nrnpy_hoc.cpp.

◆ araychk()

static int araychk ( Arrayinfo a,
PyHocObject po,
int  ix 
)
static

Definition at line 1524 of file nrnpy_hoc.cpp.

◆ araylen()

static int araylen ( Arrayinfo a,
PyHocObject po 
)
static

Definition at line 1503 of file nrnpy_hoc.cpp.

◆ cable_prop_eval()

double cable_prop_eval ( Symbol sym)

Definition at line 1518 of file cabcode.cpp.

◆ component()

static int component ( PyHocObject po)
static

Definition at line 445 of file nrnpy_hoc.cpp.

◆ cpp2refstr()

static PyObject * cpp2refstr ( char **  cpp)
static

Definition at line 2022 of file nrnpy_hoc.cpp.

◆ double_array_interface()

static char* double_array_interface ( PyObject *  po,
long &  stride 
)
static

Definition at line 2226 of file nrnpy_hoc.cpp.

◆ eval_component()

static void eval_component ( PyHocObject po,
int  ix 
)
static

Definition at line 862 of file nrnpy_hoc.cpp.

◆ fcall()

static void* fcall ( void vself,
void vargs 
)
static

Definition at line 643 of file nrnpy_hoc.cpp.

◆ get_endian_character()

char get_endian_character ( )

Definition at line 2932 of file nrnpy_hoc.cpp.

◆ get_nrncore_opt_value()

static int get_nrncore_opt_value ( const char *  option)
static

Definition at line 3006 of file nrnpy_hoc.cpp.

◆ get_plotshape_data()

PyObject* get_plotshape_data ( PyObject *  sp)

Definition at line 2616 of file nrnpy_hoc.cpp.

◆ getsym()

static Symbol* getsym ( char *  name,
Object ho,
int  fail 
)
static

Definition at line 416 of file nrnpy_hoc.cpp.

◆ gui_helper_()

static Object** gui_helper_ ( const char *  name,
Object obj 
)
static

Definition at line 2519 of file nrnpy_hoc.cpp.

◆ gui_helper_3_()

static Object** gui_helper_3_ ( const char *  name,
Object obj,
int  handle_strptr 
)
static

Definition at line 2491 of file nrnpy_hoc.cpp.

◆ gui_helper_3_helper_()

static PyObject* gui_helper_3_helper_ ( const char *  name,
Object obj,
int  handle_strptr 
)
static

Definition at line 2424 of file nrnpy_hoc.cpp.

◆ gui_helper_3_str_()

static char** gui_helper_3_str_ ( const char *  name,
Object obj,
int  handle_strptr 
)
static

Definition at line 2505 of file nrnpy_hoc.cpp.

◆ hoc_ac()

static PyObject* hoc_ac ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 171 of file nrnpy_hoc.cpp.

◆ hoc_call()

void hoc_call ( )

◆ hoc_evalpointer()

double* hoc_evalpointer ( )

Definition at line 1909 of file code.cpp.

◆ hoc_newobj1()

Object* hoc_newobj1 ( Symbol sym,
int  narg 
)

Definition at line 565 of file hoc_oop.cpp.

◆ hoc_obj_look_inside_stack()

Object* hoc_obj_look_inside_stack ( int  i)

Definition at line 770 of file code.cpp.

◆ hoc_object_component()

void hoc_object_component ( )

Definition at line 999 of file hoc_oop.cpp.

◆ hoc_objectvar()

void hoc_objectvar ( )

Definition at line 855 of file hoc_oop.cpp.

◆ hoc_objpop()

Object** hoc_objpop ( )

Definition at line 860 of file code.cpp.

◆ hoc_push_string()

void hoc_push_string ( )

Definition at line 685 of file code.cpp.

◆ hoc_pushs()

void hoc_pushs ( Symbol )

◆ hoc_stack_type()

int hoc_stack_type ( )

Definition at line 654 of file code.cpp.

◆ hoc_strpop()

char** hoc_strpop ( )

Definition at line 879 of file code.cpp.

◆ hoc_tobj_unref()

void hoc_tobj_unref ( Object **  p)

Definition at line 226 of file code.cpp.

◆ hoc_unref_defer()

void hoc_unref_defer ( )

Definition at line 247 of file code.cpp.

◆ hoc_valid_stmt()

bool hoc_valid_stmt ( const char *  stmt,
Object ob 
)

Definition at line 35 of file ocjump.cpp.

◆ hocobj_aray()

static Arrayinfo* hocobj_aray ( Symbol sym,
Object ho 
)
static

Definition at line 780 of file nrnpy_hoc.cpp.

◆ hocobj_baseattr()

static PyObject* hocobj_baseattr ( PyObject *  subself,
PyObject *  args 
)
static

Definition at line 1283 of file nrnpy_hoc.cpp.

◆ hocobj_call()

static PyObject * hocobj_call ( PyHocObject self,
PyObject *  args,
PyObject *  kwrds 
)
static

Definition at line 704 of file nrnpy_hoc.cpp.

◆ hocobj_call_arg()

PyObject* hocobj_call_arg ( int  i)

Definition at line 700 of file nrnpy_hoc.cpp.

◆ hocobj_dealloc()

static void hocobj_dealloc ( PyHocObject self)
static

Definition at line 181 of file nrnpy_hoc.cpp.

◆ hocobj_getattr()

static PyObject* hocobj_getattr ( PyObject *  subself,
PyObject *  pyname 
)
static

Definition at line 944 of file nrnpy_hoc.cpp.

◆ hocobj_getattro()

static PyObject* hocobj_getattro ( PyObject *  subself,
PyObject *  name 
)
static

Definition at line 1292 of file nrnpy_hoc.cpp.

◆ hocobj_getitem()

static PyObject* hocobj_getitem ( PyObject *  self,
Py_ssize_t  ix 
)
static

Definition at line 1765 of file nrnpy_hoc.cpp.

◆ hocobj_getsec()

static PyObject* hocobj_getsec ( Symbol sym)
static

Definition at line 850 of file nrnpy_hoc.cpp.

◆ hocobj_hash()

static long hocobj_hash ( PyHocObject self)
static

Definition at line 2103 of file nrnpy_hoc.cpp.

◆ hocobj_init()

static int hocobj_init ( PyObject *  subself,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 256 of file nrnpy_hoc.cpp.

◆ hocobj_iter()

static PyObject* hocobj_iter ( PyObject *  self)
static

Definition at line 1596 of file nrnpy_hoc.cpp.

◆ hocobj_iternext()

static PyObject* hocobj_iternext ( PyObject *  self)
static

Definition at line 1740 of file nrnpy_hoc.cpp.

◆ hocobj_len()

static Py_ssize_t hocobj_len ( PyObject *  self)
static

Definition at line 1541 of file nrnpy_hoc.cpp.

◆ hocobj_name()

static PyObject* hocobj_name ( PyObject *  pself,
PyObject *  args 
)
static

Definition at line 282 of file nrnpy_hoc.cpp.

◆ hocobj_new()

static PyObject* hocobj_new ( PyTypeObject *  subtype,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 207 of file nrnpy_hoc.cpp.

◆ hocobj_nonzero()

static int hocobj_nonzero ( PyObject *  self)
static

Definition at line 1568 of file nrnpy_hoc.cpp.

◆ hocobj_objectvar()

static void hocobj_objectvar ( Symbol sym)
static

Definition at line 842 of file nrnpy_hoc.cpp.

◆ hocobj_pushargs()

static int hocobj_pushargs ( PyObject *  args,
std::vector< char * > &  s2free 
)
static

Definition at line 337 of file nrnpy_hoc.cpp.

◆ hocobj_pushargs_free_strings()

static void hocobj_pushargs_free_strings ( std::vector< char * > &  s2free)
static

Definition at line 406 of file nrnpy_hoc.cpp.

◆ hocobj_pushtop()

static void hocobj_pushtop ( PyHocObject po,
Symbol sym,
int  ix 
)
static

Definition at line 827 of file nrnpy_hoc.cpp.

◆ hocobj_repr()

static PyObject* hocobj_repr ( PyObject *  p)
static

Definition at line 327 of file nrnpy_hoc.cpp.

◆ hocobj_richcmp()

static PyObject* hocobj_richcmp ( PyHocObject self,
PyObject *  other,
int  op 
)
static

Definition at line 2136 of file nrnpy_hoc.cpp.

◆ hocobj_same()

static PyObject* hocobj_same ( PyHocObject pself,
PyObject *  args 
)
static

Definition at line 2213 of file nrnpy_hoc.cpp.

◆ hocobj_setattro()

static int hocobj_setattro ( PyObject *  subself,
PyObject *  pyname,
PyObject *  value 
)
static

Definition at line 1310 of file nrnpy_hoc.cpp.

◆ hocobj_setitem()

static int hocobj_setitem ( PyObject *  self,
Py_ssize_t  i,
PyObject *  arg 
)
static

Definition at line 1890 of file nrnpy_hoc.cpp.

◆ hocobj_vptr()

static PyObject* hocobj_vptr ( PyObject *  pself,
PyObject *  args 
)
static

Definition at line 2091 of file nrnpy_hoc.cpp.

◆ hocpickle_reduce()

static PyObject* hocpickle_reduce ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 2647 of file nrnpy_hoc.cpp.

◆ hocpickle_setstate()

static PyObject* hocpickle_setstate ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 2721 of file nrnpy_hoc.cpp.

◆ intermediate()

static PyHocObject* intermediate ( PyHocObject po,
Symbol sym,
int  ix 
)
static

Definition at line 801 of file nrnpy_hoc.cpp.

◆ iternext_sl()

static PyObject* iternext_sl ( PyHocObject po,
hoc_Item ql 
)
static

Definition at line 1644 of file nrnpy_hoc.cpp.

◆ ivoc_alias_lookup()

Symbol* ivoc_alias_lookup ( const char *  name,
Object ob 
)

Definition at line 104 of file strfun.cpp.

◆ ivoc_list_count()

int ivoc_list_count ( Object olist)

Definition at line 408 of file oclist.cpp.

◆ libpython_path()

static PyObject* libpython_path ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 2783 of file nrnpy_hoc.cpp.

◆ lvappendsec_and_ref()

void lvappendsec_and_ref ( void sl,
Section sec 
)

Definition at line 25 of file seclist.cpp.

◆ mkref()

static PyObject* mkref ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 1991 of file nrnpy_hoc.cpp.

◆ newpysechelp()

NPySecObj * newpysechelp ( Section sec)

Definition at line 865 of file nrnpy_nrn.cpp.

◆ next_valid_secitem()

static hoc_Item* next_valid_secitem ( hoc_Item q,
hoc_Item ql 
)
static

Definition at line 1629 of file nrnpy_hoc.cpp.

◆ nrn_change_nseg()

void nrn_change_nseg ( Section sec,
int  n 
)

Definition at line 1557 of file cabcode.cpp.

◆ nrn_hocobj_ptr()

PyObject* nrn_hocobj_ptr ( double *  pd)

Definition at line 870 of file nrnpy_hoc.cpp.

◆ nrn_is_hocobj_ptr()

int nrn_is_hocobj_ptr ( PyObject *  po,
double *&  pd 
)

Definition at line 878 of file nrnpy_hoc.cpp.

◆ nrn_matrix_dim()

int nrn_matrix_dim ( void vm,
int  d 
)

Definition at line 27 of file ocmatrix.cpp.

◆ nrn_netcon_weight()

int nrn_netcon_weight ( NetCon nc,
double **  pw 
)

Definition at line 160 of file netcvode.cpp.

◆ nrn_noerr_access()

Section* nrn_noerr_access ( )

Definition at line 472 of file cabcode.cpp.

◆ nrn_ptr_richcmp()

PyObject* nrn_ptr_richcmp ( void self_ptr,
void other_ptr,
int  op 
)

Definition at line 2107 of file nrnpy_hoc.cpp.

◆ nrn_secref_nchild()

int nrn_secref_nchild ( Section sec)

Definition at line 226 of file secref.cpp.

◆ nrncore_arg()

static char* nrncore_arg ( double  tstop)
static

Definition at line 3044 of file nrnpy_hoc.cpp.

◆ nrncore_enable_value()

static int nrncore_enable_value ( )
static

return value of neuron.coreneuron.enable

Definition at line 3029 of file nrnpy_hoc.cpp.

◆ nrncore_file_mode_value()

static int nrncore_file_mode_value ( )
static

return value of neuron.coreneuron.file_mode

Definition at line 3034 of file nrnpy_hoc.cpp.

◆ nrnexec()

static PyObject* nrnexec ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 162 of file nrnpy_hoc.cpp.

◆ nrnpy_cas()

PyObject* nrnpy_cas ( PyObject *  self,
PyObject *  args 
)

Definition at line 2448 of file nrnpy_nrn.cpp.

◆ nrnpy_decref_()

static void nrnpy_decref_ ( void pyobj)
static

Definition at line 2417 of file nrnpy_hoc.cpp.

◆ nrnpy_forall()

PyObject * nrnpy_forall ( PyObject *  self,
PyObject *  args 
)

Definition at line 1587 of file nrnpy_hoc.cpp.

◆ nrnpy_get_pyobj_()

static void* nrnpy_get_pyobj_ ( Object obj)
static

Definition at line 2409 of file nrnpy_hoc.cpp.

◆ nrnpy_ho2po()

PyObject* nrnpy_ho2po ( Object o)

Definition at line 499 of file nrnpy_hoc.cpp.

◆ nrnpy_hoc()

PyObject* nrnpy_hoc ( )

Definition at line 3078 of file nrnpy_hoc.cpp.

◆ nrnpy_hoc2pyobject()

PyObject * nrnpy_hoc2pyobject ( Object ho)

Definition at line 196 of file nrnpy_p2h.cpp.

◆ nrnpy_hoc_bool_pop()

static void* nrnpy_hoc_bool_pop ( )
static

Definition at line 639 of file nrnpy_hoc.cpp.

◆ nrnpy_hoc_int_pop()

static void* nrnpy_hoc_int_pop ( )
static

Definition at line 635 of file nrnpy_hoc.cpp.

◆ nrnpy_hoc_pop()

PyObject* nrnpy_hoc_pop ( )

Definition at line 547 of file nrnpy_hoc.cpp.

◆ nrnpy_newsecobj()

PyObject* nrnpy_newsecobj ( PyObject *  self,
PyObject *  args,
PyObject *  kwds 
)

Definition at line 373 of file nrnpy_nrn.cpp.

◆ nrnpy_nrn()

PyObject* nrnpy_nrn ( )

Definition at line 2481 of file nrnpy_nrn.cpp.

◆ nrnpy_numbercheck()

int nrnpy_numbercheck ( PyObject *  po)

Definition at line 474 of file nrnpy_hoc.cpp.

◆ nrnpy_po2ho()

Object* nrnpy_po2ho ( PyObject *  po)

Definition at line 520 of file nrnpy_hoc.cpp.

◆ nrnpy_pushsec()

PyObject* nrnpy_pushsec ( PyObject *  sec)

Definition at line 1263 of file nrnpy_nrn.cpp.

◆ nrnpy_pyobject_in_obj()

Object * nrnpy_pyobject_in_obj ( PyObject *  po)

Definition at line 210 of file nrnpy_p2h.cpp.

◆ nrnpy_restore_savestate_()

static void nrnpy_restore_savestate_ ( int64_t  size,
char *  data 
)
static

Definition at line 2358 of file nrnpy_hoc.cpp.

◆ nrnpy_rvp_pyobj_callback_register()

int nrnpy_rvp_pyobj_callback_register ( PyObject *  callback)

Definition at line 2855 of file nrnpy_hoc.cpp.

◆ nrnpy_set_gui_callback()

int nrnpy_set_gui_callback ( PyObject *  new_gui_callback)

Definition at line 2396 of file nrnpy_hoc.cpp.

◆ nrnpy_set_toplevel_callbacks()

int nrnpy_set_toplevel_callbacks ( PyObject *  rvp_plot0,
PyObject *  plotshape_plot0,
PyObject *  get_mech_object_0,
PyObject *  store_savestate,
PyObject *  restore_savestate 
)

Definition at line 2380 of file nrnpy_hoc.cpp.

◆ nrnpy_set_vec_as_numpy()

int nrnpy_set_vec_as_numpy ( PyObject *(*)(int, double *)  p)

Definition at line 2326 of file nrnpy_hoc.cpp.

◆ nrnpy_setpointer_helper()

double** nrnpy_setpointer_helper ( PyObject *  pyname,
PyObject *  mech 
)

Definition at line 2141 of file nrnpy_nrn.cpp.

◆ nrnpy_store_savestate_()

static void nrnpy_store_savestate_ ( char **  save_data,
uint64_t *  save_data_size 
)
static

Definition at line 2335 of file nrnpy_hoc.cpp.

◆ nrnpy_vec_from_python()

static IvocVect* nrnpy_vec_from_python ( void v)
static

Definition at line 2268 of file nrnpy_hoc.cpp.

◆ nrnpy_vec_math_register()

int nrnpy_vec_math_register ( PyObject *  callback)

Definition at line 2850 of file nrnpy_hoc.cpp.

◆ nrnpy_vec_to_python()

static Object** nrnpy_vec_to_python ( void v)
static

Definition at line 2537 of file nrnpy_hoc.cpp.

◆ object_to_double_()

static double object_to_double_ ( Object obj)
static

Definition at line 2401 of file nrnpy_hoc.cpp.

◆ py_hocobj_add()

static PyObject* py_hocobj_add ( PyObject *  obj1,
PyObject *  obj2 
)
static

Definition at line 2899 of file nrnpy_hoc.cpp.

◆ py_hocobj_div()

static PyObject* py_hocobj_div ( PyObject *  obj1,
PyObject *  obj2 
)
static

Definition at line 2923 of file nrnpy_hoc.cpp.

◆ py_hocobj_math()

static PyObject* py_hocobj_math ( const char *  op,
PyObject *  obj1,
PyObject *  obj2 
)
static

Definition at line 2873 of file nrnpy_hoc.cpp.

◆ py_hocobj_math_unary()

static PyObject* py_hocobj_math_unary ( const char *  op,
PyObject *  obj 
)
static

Definition at line 2890 of file nrnpy_hoc.cpp.

◆ py_hocobj_mul()

static PyObject* py_hocobj_mul ( PyObject *  obj1,
PyObject *  obj2 
)
static

Definition at line 2919 of file nrnpy_hoc.cpp.

◆ py_hocobj_sub()

static PyObject* py_hocobj_sub ( PyObject *  obj1,
PyObject *  obj2 
)
static

Definition at line 2915 of file nrnpy_hoc.cpp.

◆ py_hocobj_uabs()

static PyObject* py_hocobj_uabs ( PyObject *  obj)
static

Definition at line 2903 of file nrnpy_hoc.cpp.

◆ py_hocobj_uneg()

static PyObject* py_hocobj_uneg ( PyObject *  obj)
static

Definition at line 2907 of file nrnpy_hoc.cpp.

◆ py_hocobj_upos()

static PyObject* py_hocobj_upos ( PyObject *  obj)
static

Definition at line 2911 of file nrnpy_hoc.cpp.

◆ pyobj_is_vector()

static bool pyobj_is_vector ( PyObject *  obj)
static

Definition at line 2860 of file nrnpy_hoc.cpp.

◆ pyobject_in_objptr()

static void pyobject_in_objptr ( Object **  op,
PyObject *  po 
)
static

Definition at line 274 of file nrnpy_hoc.cpp.

◆ rvp_rxd_to_callable_()

static Object* rvp_rxd_to_callable_ ( Object obj)
static

Definition at line 2602 of file nrnpy_hoc.cpp.

◆ save_pc()

static Inst* save_pc ( Inst newpc)
static

Definition at line 331 of file nrnpy_hoc.cpp.

◆ sec_access_push()

void sec_access_push ( )

Definition at line 747 of file cabcode.cpp.

◆ sectionlist_helper_()

static void sectionlist_helper_ ( void sl,
Object args 
)
static

Definition at line 2963 of file nrnpy_hoc.cpp.

◆ set_final_from_stk()

static int set_final_from_stk ( PyObject *  po)
static

Definition at line 582 of file nrnpy_hoc.cpp.

◆ setpointer()

static PyObject* setpointer ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 2043 of file nrnpy_hoc.cpp.

◆ setup_doc_system()

static int setup_doc_system ( )
static

Definition at line 907 of file nrnpy_hoc.cpp.

◆ symlist2dict()

static void symlist2dict ( Symlist sl,
PyObject *  dict 
)
static

Definition at line 890 of file nrnpy_hoc.cpp.

◆ toplevel_get()

PyObject* toplevel_get ( PyObject *  subself,
const char *  n 
)

Definition at line 927 of file nrnpy_hoc.cpp.

◆ vec_as_numpy_helper()

static Object** vec_as_numpy_helper ( int  size,
double *  data 
)
static

Definition at line 2523 of file nrnpy_hoc.cpp.

Variable Documentation

◆ array_interface_typestr

char array_interface_typestr[5] = "|f8"
static

Definition at line 110 of file nrnpy_hoc.cpp.

◆ curargs_

PyObject* curargs_
static

Definition at line 698 of file nrnpy_hoc.cpp.

◆ get_mech_object_

PyObject* get_mech_object_ = NULL
static

Definition at line 156 of file nrnpy_hoc.cpp.

◆ gui_callback

PyObject* gui_callback = NULL
static

Definition at line 2395 of file nrnpy_hoc.cpp.

◆ hoc_built_in_symlist

Symlist* hoc_built_in_symlist
extern

Definition at line 76 of file ivocmac.cpp.

◆ hoc_list_template_

cTemplate* hoc_list_template_
static

Definition at line 101 of file nrnpy_hoc.cpp.

◆ hoc_max_builtin_class_id

int hoc_max_builtin_class_id
extern

Definition at line 40 of file hoc_oop.cpp.

◆ hoc_pc

Inst* hoc_pc
extern

◆ hoc_return_type_code

int hoc_return_type_code
extern

Definition at line 42 of file code.cpp.

◆ hoc_sectionlist_template_

cTemplate* hoc_sectionlist_template_
static

Definition at line 102 of file nrnpy_hoc.cpp.

◆ hoc_top_level_data

Objectdata* hoc_top_level_data
extern

Definition at line 124 of file hoc_oop.cpp.

◆ hoc_top_level_symlist

Symlist* hoc_top_level_symlist
extern

Definition at line 23 of file symdir.cpp.

◆ hoc_vec_template_

cTemplate* hoc_vec_template_
static

Definition at line 100 of file nrnpy_hoc.cpp.

◆ HocMethods

PyMethodDef HocMethods[]
static
Initial value:
= {
{"execute", nrnexec, METH_VARARGS, "Execute a hoc command, return 1 on success, 0 on failure."},
{"hoc_ac", hoc_ac, METH_VARARGS, "Get (or set) the scalar hoc_ac_."},
{NULL, NULL, 0, NULL}}
static PyObject * nrnexec(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:162
static PyObject * hoc_ac(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:171
#define NULL
Definition: sptree.h:16

Definition at line 176 of file nrnpy_hoc.cpp.

◆ hocobj_docstring

const char* hocobj_docstring = "class neuron.hoc.HocObject - Hoc Object wrapper"
static

Definition at line 122 of file nrnpy_hoc.cpp.

◆ hocobj_members

PyMemberDef hocobj_members[] = {{NULL, 0, 0, 0, NULL}}
static

Definition at line 2926 of file nrnpy_hoc.cpp.

◆ hocobj_methods

PyMethodDef hocobj_methods[]
static
Initial value:
= {
{"baseattr", hocobj_baseattr, METH_VARARGS, "To allow use of an overrided base method"},
{"hocobjptr", hocobj_vptr, METH_NOARGS, "Hoc Object pointer as a long int"},
{"same",
(PyCFunction) hocobj_same,
METH_VARARGS,
"o1.same(o2) return True if o1 and o2 wrap the same internal HOC Object"},
{"hname", hocobj_name, METH_NOARGS, "More specific than __str__() or __attr__()."},
{"__reduce__", hocpickle_reduce, METH_VARARGS, "pickle interface"},
{"__setstate__", hocpickle_setstate, METH_VARARGS, "pickle interface"},
{NULL, NULL, 0, NULL}}
static PyObject * hocobj_name(PyObject *pself, PyObject *args)
Definition: nrnpy_hoc.cpp:282
static PyObject * hocobj_same(PyHocObject *pself, PyObject *args)
Definition: nrnpy_hoc.cpp:2213
static PyObject * hocpickle_reduce(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:2647
static PyObject * hocobj_baseattr(PyObject *subself, PyObject *args)
Definition: nrnpy_hoc.cpp:1283
static PyObject * hocobj_vptr(PyObject *pself, PyObject *args)
Definition: nrnpy_hoc.cpp:2091
static PyObject * hocpickle_setstate(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:2721

Definition at line 2805 of file nrnpy_hoc.cpp.

◆ hocobject_type

PyTypeObject* hocobject_type

Definition at line 159 of file nrnpy_hoc.cpp.

◆ nrn_child_sym

Symbol* nrn_child_sym
extern

Definition at line 27 of file secref.cpp.

◆ nrn_inpython_

int nrn_inpython_
extern

Definition at line 37 of file hoc.cpp.

◆ nrnpy_decref

void(* nrnpy_decref) (void *pyobj) ( void pyobj)
extern

Definition at line 47 of file shapeplt.cpp.

◆ nrnpy_get_pyobj

void*(* nrnpy_get_pyobj) (Object *obj) ( Object obj)
extern

Definition at line 46 of file shapeplt.cpp.

◆ nrnpy_gui_helper3_

Object**(* nrnpy_gui_helper3_) (const char *, Object *, int) ( const char *  name,
Object obj,
int  handle_strptr 
)
extern

Definition at line 15 of file xmenu.cpp.

◆ nrnpy_gui_helper3_str_

char**(* nrnpy_gui_helper3_str_) (const char *, Object *, int) ( const char *  name,
Object obj,
int  handle_strptr 
)
extern

Definition at line 16 of file xmenu.cpp.

◆ nrnpy_gui_helper_

Object**(* nrnpy_gui_helper_) (const char *, Object *) ( const char *  name,
Object obj 
)
extern

HAVE_IV.

Definition at line 13 of file xmenu.cpp.

◆ nrnpy_nrncore_arg_p_

char*(* nrnpy_nrncore_arg_p_) (double tstop) ( double  tstop)
extern

Gets the python string returned by neuron.coreneuron.nrncore_arg(tstop) return a strdup() copy of the string which should be free when the caller finishes with it.

Return NULL if error or bool(neuron.coreneuron.enable) is False.

Definition at line 129 of file nrncore_write.cpp.

◆ nrnpy_nrncore_enable_value_p_

int(* nrnpy_nrncore_enable_value_p_) () ( )
extern

value of neuron.coreneuron.enable as 0, 1 (-1 if error)

Definition at line 126 of file nrncore_write.cpp.

◆ nrnpy_nrncore_file_mode_value_p_

int(* nrnpy_nrncore_file_mode_value_p_) () ( )
extern

value of neuron.coreneuron.file_mode as 0, 1 (-1 if error)

Definition at line 127 of file nrncore_write.cpp.

◆ nrnpy_object_to_double_

double(* nrnpy_object_to_double_) (Object *) ( Object )
extern

Definition at line 14 of file xmenu.cpp.

◆ nrnpy_pyobj_sym_

Symbol* nrnpy_pyobj_sym_
extern

◆ nrnpy_restore_savestate

void(* nrnpy_restore_savestate) (int64_t, char *) ( int64_t  ,
char *   
)
extern

Definition at line 31 of file savstate.cpp.

◆ nrnpy_rvp_pyobj_callback

PyObject* nrnpy_rvp_pyobj_callback = NULL
static

Definition at line 157 of file nrnpy_hoc.cpp.

◆ nrnpy_rvp_rxd_to_callable

Object*(* nrnpy_rvp_rxd_to_callable) (Object *) ( Object )
extern

Definition at line 27 of file spaceplt.cpp.

◆ nrnpy_sectionlist_helper_

void(* nrnpy_sectionlist_helper_) (void *, Object *) ( void ,
Object  
)
extern

◆ nrnpy_store_savestate

void(* nrnpy_store_savestate) (char **save_data, uint64_t *save_data_size) ( char **  save_data,
uint64_t *  save_data_size 
)
extern

Definition at line 32 of file savstate.cpp.

◆ nrnpy_vec_as_numpy_helper_

Object**(* nrnpy_vec_as_numpy_helper_) (int, double *) ( int  ,
double *   
)
extern

Definition at line 140 of file ivocvect.cpp.

◆ nrnpy_vec_from_python_p_

IvocVect*(* nrnpy_vec_from_python_p_) (void *) ( void )
extern

Definition at line 138 of file ivocvect.cpp.

◆ nrnpy_vec_math

PyObject* nrnpy_vec_math = NULL
static

Definition at line 2848 of file nrnpy_hoc.cpp.

◆ nrnpy_vec_to_python_p_

Object**(* nrnpy_vec_to_python_p_) (void *) ( void )
extern

Definition at line 139 of file ivocvect.cpp.

◆ pfunc_get_docstring

PyObject* pfunc_get_docstring = NULL
static

Definition at line 114 of file nrnpy_hoc.cpp.

◆ plotshape_plot

PyObject* plotshape_plot = NULL
static

Definition at line 154 of file nrnpy_hoc.cpp.

◆ pmech_types

PyObject* pmech_types
extern

Definition at line 88 of file nrnpy_nrn.cpp.

◆ psection_type

PyTypeObject* psection_type
extern

Definition at line 79 of file nrnpy_nrn.cpp.

◆ rangevars_

PyObject* rangevars_
extern

Definition at line 89 of file nrnpy_nrn.cpp.

◆ refuse_to_look

int refuse_to_look
static

Definition at line 1291 of file nrnpy_hoc.cpp.

◆ restore_savestate_

PyObject* restore_savestate_ = NULL
static

Definition at line 2332 of file nrnpy_hoc.cpp.

◆ rvp_plot

PyObject* rvp_plot = NULL
static

Definition at line 153 of file nrnpy_hoc.cpp.

◆ section_object_seen

int section_object_seen
extern

◆ store_savestate_

PyObject* store_savestate_ = NULL
static

Definition at line 2331 of file nrnpy_hoc.cpp.

◆ sym_mat_x

Symbol* sym_mat_x
static

Definition at line 1500 of file nrnpy_hoc.cpp.

◆ sym_netcon_weight

Symbol* sym_netcon_weight
static

Definition at line 1501 of file nrnpy_hoc.cpp.

◆ sym_vec_x

Symbol* sym_vec_x
static

Definition at line 1499 of file nrnpy_hoc.cpp.

◆ toplevel_methods

PyMethodDef toplevel_methods[]
static
Initial value:
= {
{"ref", mkref, METH_VARARGS, "Wrap to allow call by reference in a hoc function"},
{"cas", nrnpy_cas, METH_VARARGS, "Return the currently accessed section."},
{"allsec", nrnpy_forall, METH_VARARGS, "Return iterator over all sections."},
{"Section",
(PyCFunction) nrnpy_newsecobj,
METH_VARARGS | METH_KEYWORDS,
"Return a new Section"},
{"setpointer", setpointer, METH_VARARGS, "Assign hoc variable address to NMODL POINTER"},
{"libpython_path",
METH_NOARGS,
"Return full path to file that contains Py_Initialize()"},
{NULL, NULL, 0, NULL}}
static PyObject * setpointer(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:2043
PyObject * nrnpy_forall(PyObject *, PyObject *)
Definition: nrnpy_hoc.cpp:1587
static PyObject * libpython_path(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:2783
PyObject * nrnpy_cas(PyObject *, PyObject *)
Definition: nrnpy_nrn.cpp:2448
static PyObject * mkref(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:1991
PyObject * nrnpy_newsecobj(PyObject *, PyObject *, PyObject *)
Definition: nrnpy_nrn.cpp:373

Definition at line 2818 of file nrnpy_hoc.cpp.

◆ topmethdict

PyObject* topmethdict = NULL
static

Definition at line 119 of file nrnpy_hoc.cpp.

◆ vec_as_numpy

PyObject*(* vec_as_numpy) (int, double *) ( int  ,
double *   
)
static

Definition at line 2325 of file nrnpy_hoc.cpp.