NEURON
nrnpy_nrn.h
Go to the documentation of this file.
1 static PyType_Slot nrnpy_SectionType_slots[] = {
2  {Py_tp_dealloc, (void*)NPySecObj_dealloc},
3  {Py_tp_repr, (void*)pysec_repr},
4  {Py_tp_hash, (void*)pysec_hash},
5  {Py_tp_call, (void*)NPySecObj_call},
6  {Py_tp_getattro, (void*)section_getattro},
7  {Py_tp_setattro, (void*)section_setattro},
8  {Py_tp_richcompare, (void*)pysec_richcmp},
9  {Py_tp_iter, (void*)seg_of_section_iter},
10  {Py_tp_methods, (void*)NPySecObj_methods},
11  {Py_tp_init, (void*)NPySecObj_init},
12  {Py_tp_new, (void*)NPySecObj_new},
13  {Py_tp_doc, (void*)"Section objects"},
14  {Py_sq_contains, (void*) NPySecObj_contains},
15  {0, 0},
16 };
17 static PyType_Spec nrnpy_SectionType_spec = {
18  "nrn.Section",
19  sizeof(NPySecObj),
20  0,
21  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23 };
24 
25 
26 static PyType_Slot nrnpy_AllSegOfSecIterType_slots[] = {
27  {Py_tp_dealloc, (void*)NPyAllSegOfSecIter_dealloc},
28  {Py_tp_iter, (void*)allseg_of_sec_iter},
29  {Py_tp_iternext, (void*)allseg_of_sec_next},
30  {Py_tp_init, (void*)NPyAllSegOfSecIter_init},
31  {Py_tp_new, (void*)NPyAllSegOfSecIter_new},
32  {Py_tp_doc, (void*)"Iterate over all Segments of a Section, including x=0 and 1"},
33  {0, 0},
34 };
35 static PyType_Spec nrnpy_AllSegOfSecIterType_spec = {
36  "nrn.AllsegIter",
37  sizeof(NPyAllSegOfSecIter),
38  0,
39  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41 };
42 
43 static PyType_Slot nrnpy_SegOfSecIterType_slots[] = {
44  {Py_tp_dealloc, (void*)NPySegOfSecIter_dealloc},
45  {Py_tp_iter, (void*)PyObject_SelfIter},
46  {Py_tp_iternext, (void*)seg_of_sec_next},
47  {Py_tp_doc, (void*)"Iterate over nonzero area Segments of a Section (does not include x=0 and 1)"},
48  {0, 0},
49 };
50 static PyType_Spec nrnpy_SegOfSecIterType_spec = {
51  "nrn.SegOfSecIter",
52  sizeof(NPySegOfSecIter),
53  0,
54  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
56 };
57 
58 static PyType_Slot nrnpy_SegmentType_slots[] = {
59  {Py_tp_dealloc, (void*)NPySegObj_dealloc},
60  {Py_tp_repr, (void*)pyseg_repr},
61  {Py_tp_hash, (void*)pyseg_hash},
62  {Py_tp_getattro, (void*)segment_getattro},
63  {Py_tp_setattro, (void*)segment_setattro},
64  {Py_tp_richcompare, (void*)pyseg_richcmp},
65  {Py_tp_iter, (void*)mech_of_segment_iter},
66  {Py_tp_methods, (void*)NPySegObj_methods},
67  {Py_tp_members, (void*)NPySegObj_members},
68  {Py_tp_init, (void*)NPySegObj_init},
69  {Py_tp_new, (void*)NPySegObj_new},
70  {Py_tp_doc, (void*)"Segment objects"},
71  {0, 0},
72 };
73 static PyType_Spec nrnpy_SegmentType_spec = {
74  "nrn.Segment",
75  sizeof(NPySegObj),
76  0,
77  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
79 };
80 
81 static PyType_Slot nrnpy_MechOfSegIterType_slots[] = {
82  {Py_tp_dealloc, (void*)NPyMechOfSegIter_dealloc},
83  {Py_tp_iter, (void*)PyObject_SelfIter},
84  {Py_tp_iternext, (void*)mech_of_seg_next},
85  {Py_tp_doc, (void*)"Iterate over Mechanisms in a Segment of a Section"},
86  {0, 0},
87 };
88 static PyType_Spec nrnpy_MechOfSegIterType_spec = {
89  "nrn.MechOfSegIter",
90  sizeof(NPyMechOfSegIter),
91  0,
92  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
94 };
95 
96 static PyType_Slot nrnpy_MechanismType_slots[] = {
97  {Py_tp_dealloc, (void*)NPyMechObj_dealloc},
98  {Py_tp_repr, (void*)pymech_repr},
99  {Py_tp_getattro, (void*)mech_getattro},
100  {Py_tp_setattro, (void*)mech_setattro},
101  {Py_tp_iter, (void*)var_of_mech_iter},
102  {Py_tp_methods, (void*)NPyMechObj_methods},
103  {Py_tp_members, (void*)NPyMechObj_members},
104  {Py_tp_init, (void*)NPyMechObj_init},
105  {Py_tp_new, (void*)NPyMechObj_new},
106  {Py_tp_doc, (void*)"Mechanism objects"},
107  {0, 0},
108 };
109 static PyType_Spec nrnpy_MechanismType_spec = {
110  "nrn.Mechanism",
111  sizeof(NPyMechObj),
112  0,
113  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
115 };
116 
117 static PyType_Slot nrnpy_VarOfMechIterType_slots[] = {
118  {Py_tp_dealloc, (void*)NPyVarOfMechIter_dealloc},
119  {Py_tp_iter, (void*)PyObject_SelfIter},
120  {Py_tp_iternext, (void*)var_of_mech_next},
121  {Py_tp_doc, (void*)"Iterate over variables in a Mechanism"},
122  {0, 0},
123 };
124 static PyType_Spec nrnpy_VarOfMechIterType_spec = {
125  "nrn.VarOfMechIter",
126  sizeof(NPyVarOfMechIter),
127  0,
128  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
130 };
131 
132 static PyType_Slot nrnpy_RangeType_slots[] = {
133  {Py_tp_dealloc, (void*)NPyRangeVar_dealloc},
134  {Py_tp_methods, (void*)NPyRangeVar_methods},
135  {Py_tp_init, (void*)NPyRangeVar_init},
136  {Py_tp_new, (void*)NPyRangeVar_new},
137  {Py_tp_doc, (void*)"Range Variable Array objects"},
138  {Py_sq_length, (void*)rv_len},
139  {Py_sq_item, (void*)rv_getitem},
140  {Py_sq_ass_item, (void*)rv_setitem},
141  {0, 0},
142 };
143 static PyType_Spec nrnpy_RangeType_spec = {
144  "nrn.RangeVar",
145  sizeof(NPyRangeVar),
146  0,
147  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
149 };
150 
151 static struct PyModuleDef nrnmodule = {PyModuleDef_HEAD_INIT, "nrn",
152  "NEURON interaction with Python", -1,
153  nrnpy_methods, NULL, NULL, NULL, NULL};
154 
155 /*
156 limited namespace version of nrn module which will not have the mechanism
157 names added. (At least one ModelDB model has a mechanism called 'cas')
158 */
159 static struct PyModuleDef nrnsectionmodule = {
160  PyModuleDef_HEAD_INIT,
161  "_neuron_section", "NEURON interaction with Python",
162  -1, nrnpy_methods, NULL, NULL, NULL, NULL};
static int NPyRangeVar_init(NPyRangeVar *self, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:555
static int section_setattro(NPySecObj *self, PyObject *pyname, PyObject *value)
Definition: nrnpy_nrn.cpp:1657
static PyObject * pymech_repr(PyObject *p)
Definition: nrnpy_nrn.cpp:1107
static PyObject * mech_of_seg_next(NPyMechOfSegIter *self)
Definition: nrnpy_nrn.cpp:1744
static int NPySegObj_init(NPySegObj *self, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:434
static int mech_setattro(NPyMechObj *self, PyObject *pyname, PyObject *value)
Definition: nrnpy_nrn.cpp:2094
static PyMemberDef NPyMechObj_members[]
Definition: nrnpy_nrn.cpp:2383
static PyObject * seg_of_section_iter(NPySecObj *self)
Definition: nrnpy_nrn.cpp:1285
static int rv_setitem(PyObject *self, Py_ssize_t ix, PyObject *value)
Definition: nrnpy_nrn.cpp:2216
static PyObject * segment_getattro(NPySegObj *self, PyObject *pyname)
Definition: nrnpy_nrn.cpp:1796
static PyObject * var_of_mech_next(NPyVarOfMechIter *self)
Definition: nrnpy_nrn.cpp:1780
static PyMemberDef NPySegObj_members[]
Definition: nrnpy_nrn.cpp:2360
static PyType_Spec nrnpy_SegmentType_spec
Definition: nrnpy_nrn.h:73
static void NPyMechObj_dealloc(NPyMechObj *self)
Definition: nrnpy_nrn.cpp:248
static PyObject * mech_of_segment_iter(NPySegObj *self)
Definition: nrnpy_nrn.cpp:1519
static int NPyAllSegOfSecIter_init(NPyAllSegOfSecIter *self, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:333
static PyType_Slot nrnpy_SegmentType_slots[]
Definition: nrnpy_nrn.h:58
static PyType_Spec nrnpy_SegOfSecIterType_spec
Definition: nrnpy_nrn.h:50
static PyType_Slot nrnpy_SegOfSecIterType_slots[]
Definition: nrnpy_nrn.h:43
static struct PyModuleDef nrnsectionmodule
Definition: nrnpy_nrn.h:159
static PyObject * pysec_richcmp(NPySecObj *self, PyObject *other, int op)
Definition: nrnpy_nrn.cpp:1050
static void NPyVarOfMechIter_dealloc(NPyVarOfMechIter *self)
Definition: nrnpy_nrn.cpp:260
static long pyseg_hash(PyObject *self)
Definition: nrnpy_nrn.cpp:1032
static PyObject * var_of_mech_iter(NPyMechObj *self)
Definition: nrnpy_nrn.cpp:1761
static PyMethodDef NPyRangeVar_methods[]
Definition: nrnpy_nrn.cpp:2376
static int NPySecObj_contains(PyObject *sec, PyObject *obj)
Definition: nrnpy_nrn.cpp:173
static struct PyModuleDef nrnmodule
Definition: nrnpy_nrn.h:151
static void NPySegObj_dealloc(NPySegObj *self)
Definition: nrnpy_nrn.cpp:236
static PyType_Slot nrnpy_SectionType_slots[]
Definition: nrnpy_nrn.h:1
static PyObject * rv_getitem(PyObject *self, Py_ssize_t ix)
Definition: nrnpy_nrn.cpp:2188
static int segment_setattro(NPySegObj *self, PyObject *pyname, PyObject *value)
Definition: nrnpy_nrn.cpp:1932
static void NPyAllSegOfSecIter_dealloc(NPyAllSegOfSecIter *self)
Definition: nrnpy_nrn.cpp:224
static PyType_Slot nrnpy_MechOfSegIterType_slots[]
Definition: nrnpy_nrn.h:81
static PyType_Slot nrnpy_RangeType_slots[]
Definition: nrnpy_nrn.h:132
static PyType_Slot nrnpy_MechanismType_slots[]
Definition: nrnpy_nrn.h:96
static PyType_Spec nrnpy_MechOfSegIterType_spec
Definition: nrnpy_nrn.h:88
static PyObject * pysec_repr(PyObject *p)
Definition: nrnpy_nrn.cpp:803
static PyObject * NPyMechObj_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:404
static PyMethodDef NPyMechObj_methods[]
Definition: nrnpy_nrn.cpp:2367
static PyMethodDef NPySegObj_methods[]
Definition: nrnpy_nrn.cpp:2334
static PyMethodDef nrnpy_methods[]
Definition: nrnpy_nrn.cpp:2395
static PyType_Slot nrnpy_AllSegOfSecIterType_slots[]
Definition: nrnpy_nrn.h:26
static PyType_Spec nrnpy_RangeType_spec
Definition: nrnpy_nrn.h:143
static int NPySecObj_init(NPySecObj *self, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:276
static PyObject * NPySegObj_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:379
static PyObject * seg_of_sec_next(NPySegOfSecIter *self)
Definition: nrnpy_nrn.cpp:1341
static void NPyRangeVar_dealloc(NPyRangeVar *self)
Definition: nrnpy_nrn.cpp:242
static PyObject * pyseg_repr(PyObject *p)
Definition: nrnpy_nrn.cpp:811
static PyObject * section_getattro(NPySecObj *self, PyObject *pyname)
Definition: nrnpy_nrn.cpp:1600
static PyMethodDef NPySecObj_methods[]
Definition: nrnpy_nrn.cpp:2258
static PyObject * allseg_of_sec_iter(NPyAllSegOfSecIter *self)
Definition: nrnpy_nrn.cpp:1310
static PyType_Slot nrnpy_VarOfMechIterType_slots[]
Definition: nrnpy_nrn.h:117
static PyType_Spec nrnpy_MechanismType_spec
Definition: nrnpy_nrn.h:109
static PyType_Spec nrnpy_VarOfMechIterType_spec
Definition: nrnpy_nrn.h:124
PyObject * NPySecObj_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:348
static void NPyMechOfSegIter_dealloc(NPyMechOfSegIter *self)
Definition: nrnpy_nrn.cpp:254
PyObject * NPyAllSegOfSecIter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:361
static long pysec_hash(PyObject *self)
Definition: nrnpy_nrn.cpp:1028
static PyObject * NPySecObj_call(NPySecObj *self, PyObject *args)
Definition: nrnpy_nrn.cpp:2169
static int NPyMechObj_init(NPyMechObj *self, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:542
return NULL
Definition: cabcode.cpp:461
static PyObject * allseg_of_sec_next(NPyAllSegOfSecIter *self)
Definition: nrnpy_nrn.cpp:1316
static PyObject * mech_getattro(NPyMechObj *self, PyObject *pyname)
Definition: nrnpy_nrn.cpp:2027
static PyType_Spec nrnpy_AllSegOfSecIterType_spec
Definition: nrnpy_nrn.h:35
static Py_ssize_t rv_len(PyObject *self)
Definition: nrnpy_nrn.cpp:2179
static PyType_Spec nrnpy_SectionType_spec
Definition: nrnpy_nrn.h:17
static PyObject * NPyRangeVar_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Definition: nrnpy_nrn.cpp:421
static void NPySecObj_dealloc(NPySecObj *self)
Definition: nrnpy_nrn.cpp:204
static PyObject * pyseg_richcmp(NPySegObj *self, PyObject *other, int op)
Definition: nrnpy_nrn.cpp:1037
static void NPySegOfSecIter_dealloc(NPySegOfSecIter *self)
Definition: nrnpy_nrn.cpp:230