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 "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
 Neuron/Java Interface code. More...
 
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
 
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;
uint uint32_t

Definition at line 2700 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 2705 of file nrnpy_hoc.cpp.

Function Documentation

◆ add2topdict()

static void add2topdict ( PyObject *  dict)
static

Definition at line 2824 of file nrnpy_hoc.cpp.

◆ araychk()

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

Definition at line 1525 of file nrnpy_hoc.cpp.

◆ araylen()

static int araylen ( Arrayinfo a,
PyHocObject po 
)
static

Definition at line 1504 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 448 of file nrnpy_hoc.cpp.

◆ cpp2refstr()

static PyObject * cpp2refstr ( char **  cpp)
static

Definition at line 2021 of file nrnpy_hoc.cpp.

◆ double_array_interface()

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

Definition at line 2222 of file nrnpy_hoc.cpp.

◆ eval_component()

static void eval_component ( PyHocObject po,
int  ix 
)
static

Definition at line 873 of file nrnpy_hoc.cpp.

◆ fcall()

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

Definition at line 650 of file nrnpy_hoc.cpp.

◆ get_endian_character()

char get_endian_character ( )

Definition at line 2923 of file nrnpy_hoc.cpp.

◆ get_nrncore_opt_value()

static int get_nrncore_opt_value ( const char *  option)
static

Definition at line 2999 of file nrnpy_hoc.cpp.

◆ get_plotshape_data()

PyObject* get_plotshape_data ( PyObject *  sp)

Definition at line 2609 of file nrnpy_hoc.cpp.

◆ getsym()

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

Definition at line 419 of file nrnpy_hoc.cpp.

◆ gui_helper_()

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

Definition at line 2511 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 2483 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 2419 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 2497 of file nrnpy_hoc.cpp.

◆ hoc_ac()

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

Definition at line 175 of file nrnpy_hoc.cpp.

◆ hoc_call()

void hoc_call ( )

◆ hoc_evalpointer()

double* hoc_evalpointer ( )

Definition at line 1891 of file code.cpp.

◆ hoc_newobj1()

Object* hoc_newobj1 ( Symbol ,
int   
)

Definition at line 576 of file hoc_oop.cpp.

◆ hoc_obj_look_inside_stack()

Object* hoc_obj_look_inside_stack ( int  )

Definition at line 759 of file code.cpp.

◆ hoc_object_component()

void hoc_object_component ( )

Definition at line 1032 of file hoc_oop.cpp.

◆ hoc_objectvar()

void hoc_objectvar ( )

Definition at line 888 of file hoc_oop.cpp.

◆ hoc_objpop()

Object** hoc_objpop ( )

Definition at line 849 of file code.cpp.

◆ hoc_push_string()

void hoc_push_string ( )

Definition at line 671 of file code.cpp.

◆ hoc_pushs()

void hoc_pushs ( Symbol )

◆ 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.

◆ hoc_unref_defer()

void hoc_unref_defer ( )

Definition at line 240 of file code.cpp.

◆ hoc_valid_stmt()

bool hoc_valid_stmt ( const char *  ,
Object  
)

Definition at line 35 of file ocjump.cpp.

◆ hocobj_aray()

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

Definition at line 789 of file nrnpy_hoc.cpp.

◆ hocobj_baseattr()

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

Definition at line 1285 of file nrnpy_hoc.cpp.

◆ hocobj_call()

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

Definition at line 711 of file nrnpy_hoc.cpp.

◆ hocobj_call_arg()

PyObject* hocobj_call_arg ( int  i)

Definition at line 707 of file nrnpy_hoc.cpp.

◆ hocobj_dealloc()

static void hocobj_dealloc ( PyHocObject self)
static

Definition at line 186 of file nrnpy_hoc.cpp.

◆ hocobj_getattr()

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

Definition at line 956 of file nrnpy_hoc.cpp.

◆ hocobj_getattro()

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

Definition at line 1294 of file nrnpy_hoc.cpp.

◆ hocobj_getitem()

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

Definition at line 1763 of file nrnpy_hoc.cpp.

◆ hocobj_getsec()

static PyObject* hocobj_getsec ( Symbol sym)
static

Definition at line 861 of file nrnpy_hoc.cpp.

◆ hocobj_hash()

static long hocobj_hash ( PyHocObject self)
static

Definition at line 2102 of file nrnpy_hoc.cpp.

◆ hocobj_init()

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

Definition at line 263 of file nrnpy_hoc.cpp.

◆ hocobj_iter()

static PyObject* hocobj_iter ( PyObject *  self)
static

Definition at line 1594 of file nrnpy_hoc.cpp.

◆ hocobj_iternext()

static PyObject* hocobj_iternext ( PyObject *  self)
static

Definition at line 1738 of file nrnpy_hoc.cpp.

◆ hocobj_len()

static Py_ssize_t hocobj_len ( PyObject *  self)
static

Definition at line 1539 of file nrnpy_hoc.cpp.

◆ hocobj_name()

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

Definition at line 289 of file nrnpy_hoc.cpp.

◆ hocobj_new()

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

Definition at line 212 of file nrnpy_hoc.cpp.

◆ hocobj_nonzero()

static int hocobj_nonzero ( PyObject *  self)
static

Definition at line 1566 of file nrnpy_hoc.cpp.

◆ hocobj_objectvar()

static void hocobj_objectvar ( Symbol sym)
static

Definition at line 853 of file nrnpy_hoc.cpp.

◆ hocobj_pushargs()

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

Definition at line 341 of file nrnpy_hoc.cpp.

◆ hocobj_pushargs_free_strings()

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

Definition at line 409 of file nrnpy_hoc.cpp.

◆ hocobj_pushtop()

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

Definition at line 838 of file nrnpy_hoc.cpp.

◆ hocobj_repr()

static PyObject* hocobj_repr ( PyObject *  p)
static

Definition at line 333 of file nrnpy_hoc.cpp.

◆ hocobj_richcmp()

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

Definition at line 2133 of file nrnpy_hoc.cpp.

◆ hocobj_same()

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

Definition at line 2209 of file nrnpy_hoc.cpp.

◆ hocobj_setattro()

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

Definition at line 1312 of file nrnpy_hoc.cpp.

◆ hocobj_setitem()

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

Definition at line 1888 of file nrnpy_hoc.cpp.

◆ hocobj_vptr()

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

Definition at line 2090 of file nrnpy_hoc.cpp.

◆ hocpickle_reduce()

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

Definition at line 2638 of file nrnpy_hoc.cpp.

◆ hocpickle_setstate()

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

Definition at line 2714 of file nrnpy_hoc.cpp.

◆ intermediate()

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

Definition at line 811 of file nrnpy_hoc.cpp.

◆ iternext_sl()

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

Definition at line 1642 of file nrnpy_hoc.cpp.

◆ ivoc_alias_lookup()

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

Definition at line 103 of file strfun.cpp.

◆ ivoc_list_count()

int ivoc_list_count ( Object )

Definition at line 414 of file oclist.cpp.

◆ libpython_path()

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

Definition at line 2777 of file nrnpy_hoc.cpp.

◆ lvappendsec_and_ref()

void lvappendsec_and_ref ( void sl,
Section sec 
)

Definition at line 24 of file seclist.cpp.

◆ mkref()

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

Definition at line 1989 of file nrnpy_hoc.cpp.

◆ newpysechelp()

NPySecObj * newpysechelp ( Section sec)

Definition at line 871 of file nrnpy_nrn.cpp.

◆ next_valid_secitem()

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

Definition at line 1627 of file nrnpy_hoc.cpp.

◆ nrn_change_nseg()

void nrn_change_nseg ( Section ,
int   
)

Definition at line 1561 of file cabcode.cpp.

◆ nrn_hocobj_ptr()

PyObject* nrn_hocobj_ptr ( double *  pd)

Definition at line 881 of file nrnpy_hoc.cpp.

◆ nrn_is_hocobj_ptr()

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

Definition at line 889 of file nrnpy_hoc.cpp.

◆ nrn_matrix_dim()

int nrn_matrix_dim ( void ,
int   
)

Definition at line 27 of file ocmatrix.cpp.

◆ nrn_netcon_weight()

int nrn_netcon_weight ( NetCon ,
double **   
)

Definition at line 137 of file netcvode.cpp.

◆ nrn_noerr_access()

Section* nrn_noerr_access ( )

Definition at line 464 of file cabcode.cpp.

◆ nrn_ptr_richcmp()

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

Definition at line 2104 of file nrnpy_hoc.cpp.

◆ nrn_secref_nchild()

int nrn_secref_nchild ( Section )

Definition at line 223 of file secref.cpp.

◆ nrncore_arg()

static char* nrncore_arg ( double  tstop)
static

Definition at line 3037 of file nrnpy_hoc.cpp.

◆ nrncore_enable_value()

static int nrncore_enable_value ( )
static

return value of neuron.coreneuron.enable

Definition at line 3022 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 3027 of file nrnpy_hoc.cpp.

◆ nrnexec()

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

Definition at line 166 of file nrnpy_hoc.cpp.

◆ nrnpy_cas()

PyObject* nrnpy_cas ( PyObject *  ,
PyObject *   
)

Definition at line 2385 of file nrnpy_nrn.cpp.

◆ nrnpy_decref_()

static void nrnpy_decref_ ( void pyobj)
static

Definition at line 2412 of file nrnpy_hoc.cpp.

◆ nrnpy_forall()

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

Definition at line 1585 of file nrnpy_hoc.cpp.

◆ nrnpy_get_pyobj_()

static void* nrnpy_get_pyobj_ ( Object obj)
static

Definition at line 2404 of file nrnpy_hoc.cpp.

◆ nrnpy_ho2po()

PyObject* nrnpy_ho2po ( Object o)

Definition at line 503 of file nrnpy_hoc.cpp.

◆ nrnpy_hoc()

PyObject* nrnpy_hoc ( )

Definition at line 3069 of file nrnpy_hoc.cpp.

◆ nrnpy_hoc2pyobject()

PyObject * nrnpy_hoc2pyobject ( Object ho)

Definition at line 191 of file nrnpy_p2h.cpp.

◆ nrnpy_hoc_bool_pop()

static void* nrnpy_hoc_bool_pop ( )
static

Definition at line 646 of file nrnpy_hoc.cpp.

◆ nrnpy_hoc_int_pop()

static void* nrnpy_hoc_int_pop ( )
static

Definition at line 642 of file nrnpy_hoc.cpp.

◆ nrnpy_hoc_pop()

PyObject* nrnpy_hoc_pop ( )

Definition at line 551 of file nrnpy_hoc.cpp.

◆ nrnpy_newsecobj()

PyObject* nrnpy_newsecobj ( PyObject *  ,
PyObject *  ,
PyObject *   
)

Definition at line 375 of file nrnpy_nrn.cpp.

◆ nrnpy_nrn()

PyObject* nrnpy_nrn ( )

Definition at line 2417 of file nrnpy_nrn.cpp.

◆ nrnpy_numbercheck()

int nrnpy_numbercheck ( PyObject *  po)

Definition at line 478 of file nrnpy_hoc.cpp.

◆ nrnpy_po2ho()

Object* nrnpy_po2ho ( PyObject *  po)

Definition at line 524 of file nrnpy_hoc.cpp.

◆ nrnpy_pushsec()

PyObject* nrnpy_pushsec ( PyObject *  )

Definition at line 1270 of file nrnpy_nrn.cpp.

◆ nrnpy_pyobject_in_obj()

Object * nrnpy_pyobject_in_obj ( PyObject *  po)

Definition at line 205 of file nrnpy_p2h.cpp.

◆ nrnpy_restore_savestate_()

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

Definition at line 2357 of file nrnpy_hoc.cpp.

◆ nrnpy_rvp_pyobj_callback_register()

int nrnpy_rvp_pyobj_callback_register ( PyObject *  callback)

Definition at line 2846 of file nrnpy_hoc.cpp.

◆ nrnpy_set_gui_callback()

int nrnpy_set_gui_callback ( PyObject *  new_gui_callback)

Definition at line 2391 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 2379 of file nrnpy_hoc.cpp.

◆ nrnpy_set_vec_as_numpy()

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

Definition at line 2325 of file nrnpy_hoc.cpp.

◆ nrnpy_setpointer_helper()

double** nrnpy_setpointer_helper ( PyObject *  ,
PyObject *   
)

Definition at line 2149 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 2334 of file nrnpy_hoc.cpp.

◆ nrnpy_vec_from_python()

static IvocVect* nrnpy_vec_from_python ( void v)
static

Definition at line 2266 of file nrnpy_hoc.cpp.

◆ nrnpy_vec_math_register()

int nrnpy_vec_math_register ( PyObject *  callback)

Definition at line 2841 of file nrnpy_hoc.cpp.

◆ nrnpy_vec_to_python()

static Object** nrnpy_vec_to_python ( void v)
static

Definition at line 2529 of file nrnpy_hoc.cpp.

◆ object_to_double_()

static double object_to_double_ ( Object obj)
static

Definition at line 2396 of file nrnpy_hoc.cpp.

◆ py_hocobj_add()

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

Definition at line 2890 of file nrnpy_hoc.cpp.

◆ py_hocobj_div()

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

Definition at line 2914 of file nrnpy_hoc.cpp.

◆ py_hocobj_math()

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

Definition at line 2864 of file nrnpy_hoc.cpp.

◆ py_hocobj_math_unary()

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

Definition at line 2881 of file nrnpy_hoc.cpp.

◆ py_hocobj_mul()

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

Definition at line 2910 of file nrnpy_hoc.cpp.

◆ py_hocobj_sub()

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

Definition at line 2906 of file nrnpy_hoc.cpp.

◆ py_hocobj_uabs()

static PyObject* py_hocobj_uabs ( PyObject *  obj)
static

Definition at line 2894 of file nrnpy_hoc.cpp.

◆ py_hocobj_uneg()

static PyObject* py_hocobj_uneg ( PyObject *  obj)
static

Definition at line 2898 of file nrnpy_hoc.cpp.

◆ py_hocobj_upos()

static PyObject* py_hocobj_upos ( PyObject *  obj)
static

Definition at line 2902 of file nrnpy_hoc.cpp.

◆ pyobj_is_vector()

static bool pyobj_is_vector ( PyObject *  obj)
static

Definition at line 2851 of file nrnpy_hoc.cpp.

◆ pyobject_in_objptr()

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

Definition at line 281 of file nrnpy_hoc.cpp.

◆ rvp_rxd_to_callable_()

static Object* rvp_rxd_to_callable_ ( Object obj)
static

Definition at line 2595 of file nrnpy_hoc.cpp.

◆ save_pc()

static Inst* save_pc ( Inst newpc)
static

Definition at line 335 of file nrnpy_hoc.cpp.

◆ sec_access_push()

void sec_access_push ( )

Definition at line 738 of file cabcode.cpp.

◆ sectionlist_helper_()

static void sectionlist_helper_ ( void sl,
Object args 
)
static

Definition at line 2956 of file nrnpy_hoc.cpp.

◆ set_final_from_stk()

static int set_final_from_stk ( PyObject *  po)
static

Definition at line 587 of file nrnpy_hoc.cpp.

◆ setpointer()

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

Definition at line 2042 of file nrnpy_hoc.cpp.

◆ setup_doc_system()

static int setup_doc_system ( )
static

Definition at line 917 of file nrnpy_hoc.cpp.

◆ symlist2dict()

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

Definition at line 901 of file nrnpy_hoc.cpp.

◆ toplevel_get()

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

Definition at line 939 of file nrnpy_hoc.cpp.

◆ vec_as_numpy_helper()

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

Definition at line 2515 of file nrnpy_hoc.cpp.

Variable Documentation

◆ array_interface_typestr

char array_interface_typestr[5] = "|f8"
static

Definition at line 112 of file nrnpy_hoc.cpp.

◆ curargs_

PyObject* curargs_
static

Definition at line 705 of file nrnpy_hoc.cpp.

◆ get_mech_object_

PyObject* get_mech_object_ = NULL
static

Definition at line 159 of file nrnpy_hoc.cpp.

◆ gui_callback

PyObject* gui_callback =NULL
static

Definition at line 2390 of file nrnpy_hoc.cpp.

◆ hoc_built_in_symlist

Symlist* hoc_built_in_symlist

Definition at line 39 of file symbol.cpp.

◆ hoc_list_template_

cTemplate* hoc_list_template_
static

Definition at line 103 of file nrnpy_hoc.cpp.

◆ hoc_max_builtin_class_id

int hoc_max_builtin_class_id

Definition at line 52 of file hoc_oop.cpp.

◆ hoc_pc

Inst* hoc_pc

◆ hoc_return_type_code

int hoc_return_type_code

Definition at line 41 of file code.cpp.

◆ hoc_sectionlist_template_

cTemplate* hoc_sectionlist_template_
static

Definition at line 104 of file nrnpy_hoc.cpp.

◆ hoc_top_level_data

Objectdata* hoc_top_level_data

Definition at line 134 of file hoc_oop.cpp.

◆ hoc_top_level_symlist

Symlist* hoc_top_level_symlist

Neuron/Java Interface code.

Author
Fred Howell
Date
March 2001

Modified by Michael Hines The Java to Neuron JNIEXPORT functions for Neuron.java have been collected in nrnjni.cpp. This file now mostly supports the Neuron to Java direction

Definition at line 41 of file symbol.cpp.

◆ hoc_vec_template_

cTemplate* hoc_vec_template_
static

Definition at line 102 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:166
static PyObject * hoc_ac(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:175
return NULL
Definition: cabcode.cpp:461

Definition at line 180 of file nrnpy_hoc.cpp.

◆ hocobj_docstring

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

Definition at line 124 of file nrnpy_hoc.cpp.

◆ hocobj_members

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

Definition at line 2917 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 * hocpickle_reduce(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:2638
static PyObject * hocobj_baseattr(PyObject *subself, PyObject *args)
Definition: nrnpy_hoc.cpp:1285
static PyObject * hocobj_vptr(PyObject *pself, PyObject *args)
Definition: nrnpy_hoc.cpp:2090
static PyObject * hocobj_name(PyObject *pself, PyObject *args)
Definition: nrnpy_hoc.cpp:289
static PyObject * hocpickle_setstate(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:2714
return NULL
Definition: cabcode.cpp:461
static PyObject * hocobj_same(PyHocObject *pself, PyObject *args)
Definition: nrnpy_hoc.cpp:2209

Definition at line 2797 of file nrnpy_hoc.cpp.

◆ hocobject_type

PyTypeObject* hocobject_type

Definition at line 162 of file nrnpy_hoc.cpp.

◆ nrn_child_sym

Symbol* nrn_child_sym

Definition at line 26 of file secref.cpp.

◆ nrn_inpython_

int nrn_inpython_

Definition at line 37 of file hoc.cpp.

◆ nrnpy_decref

void(* nrnpy_decref) (void *pyobj)

Definition at line 47 of file shapeplt.cpp.

◆ nrnpy_get_pyobj

void*(* nrnpy_get_pyobj) (Object *obj)

Definition at line 46 of file shapeplt.cpp.

◆ nrnpy_gui_helper3_

Object**(* nrnpy_gui_helper3_) (const char *, Object *, int)

Definition at line 15 of file xmenu.cpp.

◆ nrnpy_gui_helper3_str_

char**(* nrnpy_gui_helper3_str_) (const char *, Object *, int)

Definition at line 16 of file xmenu.cpp.

◆ nrnpy_gui_helper_

Object**(* nrnpy_gui_helper_) (const char *, Object *)

HAVE_IV.

Definition at line 13 of file xmenu.cpp.

◆ nrnpy_nrncore_arg_p_

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.

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

Definition at line 145 of file nrncore_write.cpp.

◆ nrnpy_nrncore_enable_value_p_

int(* nrnpy_nrncore_enable_value_p_) ()

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

Definition at line 142 of file nrncore_write.cpp.

◆ nrnpy_nrncore_file_mode_value_p_

int(* nrnpy_nrncore_file_mode_value_p_) ()

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

Definition at line 143 of file nrncore_write.cpp.

◆ nrnpy_object_to_double_

double(* nrnpy_object_to_double_) (Object *)

Definition at line 14 of file xmenu.cpp.

◆ nrnpy_pyobj_sym_

Symbol* nrnpy_pyobj_sym_

◆ nrnpy_restore_savestate

void(* nrnpy_restore_savestate) (int64_t, char *)

Definition at line 31 of file savstate.cpp.

◆ nrnpy_rvp_pyobj_callback

PyObject* nrnpy_rvp_pyobj_callback = NULL
static

Definition at line 160 of file nrnpy_hoc.cpp.

◆ nrnpy_rvp_rxd_to_callable

Object*(* nrnpy_rvp_rxd_to_callable) (Object *)

Definition at line 27 of file spaceplt.cpp.

◆ nrnpy_sectionlist_helper_

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

Definition at line 22 of file seclist.cpp.

◆ nrnpy_store_savestate

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

Definition at line 32 of file savstate.cpp.

◆ nrnpy_vec_as_numpy_helper_

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

Definition at line 125 of file ivocvect.cpp.

◆ nrnpy_vec_from_python_p_

IvocVect*(* nrnpy_vec_from_python_p_) (void *)

Definition at line 123 of file ivocvect.cpp.

◆ nrnpy_vec_math

PyObject* nrnpy_vec_math = NULL
static

Definition at line 2839 of file nrnpy_hoc.cpp.

◆ nrnpy_vec_to_python_p_

Object**(* nrnpy_vec_to_python_p_) (void *)

Definition at line 124 of file ivocvect.cpp.

◆ pfunc_get_docstring

PyObject* pfunc_get_docstring = NULL
static

Definition at line 116 of file nrnpy_hoc.cpp.

◆ plotshape_plot

PyObject* plotshape_plot = NULL
static

Definition at line 157 of file nrnpy_hoc.cpp.

◆ pmech_types

PyObject* pmech_types

Definition at line 88 of file nrnpy_nrn.cpp.

◆ psection_type

PyTypeObject* psection_type

Definition at line 79 of file nrnpy_nrn.cpp.

◆ rangevars_

PyObject* rangevars_

Definition at line 89 of file nrnpy_nrn.cpp.

◆ refuse_to_look

int refuse_to_look
static

Definition at line 1293 of file nrnpy_hoc.cpp.

◆ restore_savestate_

PyObject* restore_savestate_ = NULL
static

Definition at line 2331 of file nrnpy_hoc.cpp.

◆ rvp_plot

PyObject* rvp_plot = NULL
static

Definition at line 156 of file nrnpy_hoc.cpp.

◆ section_object_seen

int section_object_seen

◆ store_savestate_

PyObject* store_savestate_ = NULL
static

Definition at line 2330 of file nrnpy_hoc.cpp.

◆ sym_mat_x

Symbol* sym_mat_x
static

Definition at line 1501 of file nrnpy_hoc.cpp.

◆ sym_netcon_weight

Symbol* sym_netcon_weight
static

Definition at line 1502 of file nrnpy_hoc.cpp.

◆ sym_vec_x

Symbol* sym_vec_x
static

Definition at line 1500 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", libpython_path, METH_NOARGS,
"Return full path to file that contains Py_Initialize()"},
{NULL, NULL, 0, NULL}}
PyObject * nrnpy_newsecobj(PyObject *, PyObject *, PyObject *)
Definition: nrnpy_nrn.cpp:375
static PyObject * setpointer(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:2042
PyObject * nrnpy_forall(PyObject *, PyObject *)
Definition: nrnpy_hoc.cpp:1585
PyObject * nrnpy_cas(PyObject *, PyObject *)
Definition: nrnpy_nrn.cpp:2385
static PyObject * libpython_path(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:2777
static PyObject * mkref(PyObject *self, PyObject *args)
Definition: nrnpy_hoc.cpp:1989
return NULL
Definition: cabcode.cpp:461

Definition at line 2810 of file nrnpy_hoc.cpp.

◆ topmethdict

PyObject* topmethdict = NULL
static

Definition at line 121 of file nrnpy_hoc.cpp.

◆ vec_as_numpy

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

Definition at line 2324 of file nrnpy_hoc.cpp.