Skip to content
This repository was archived by the owner on Nov 3, 2022. It is now read-only.

Commit 038490f

Browse files
author
Dilawar Singh
committed
Try cython now.
1 parent 8bbf900 commit 038490f

File tree

3 files changed

+5
-52
lines changed

3 files changed

+5
-52
lines changed

pymoose/pymoose.cpp

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,6 @@ class BufPool;
3737
using namespace std;
3838
namespace py = pybind11;
3939

40-
const vector<const char*> classMap { "AdExIF", "AdThreshIF", "Adaptor",
41-
"Annotator", "Arith", "BufPool", "CaConc", "Cell", "ChemCompt", "Cinfo",
42-
"Clock", "Compartment", "ConcChan", "CubeMesh", "CylMesh", "DestField",
43-
"DiagonalMsg", "DifBuffer", "DifShell", "DiffAmp", "Dsolve",
44-
"ElementField", "EndoMesh", "Enz", "ExIF", "Finfo", "Function",
45-
"GapJunction", "GraupnerBrunel2012CaPlasticitySynHandler", "Group",
46-
"Gsolve", "HHChannel", "HHChannel2D", "HHGate", "HHGate2D", "HSolve",
47-
"INFINITE", "IntFire", "Interpol", "Interpol2D", "IzhIF", "IzhikevichNrn",
48-
"Ksolve", "LIF", "Leakage", "LookupField", "MMPump", "MMenz",
49-
"MarkovChannel", "MarkovGslSolver", "MarkovRateTable", "MarkovSolver",
50-
"MeshEntry", "MgBlock", "Msg", "Mstring", "NMDAChan", "Nernst",
51-
"NeuroMesh", "Neuron", "Neutral", "OneToAllMsg", "OneToOneDataIndexMsg",
52-
"OneToOneMsg", "PIDController", "Pool", "PostMaster", "PsdMesh",
53-
"PulseGen", "PyRun", "QIF", "RC", "RandSpike", "Reac", "STDPSynHandler",
54-
"STDPSynapse", "SeqSynHandler", "Shell", "SimpleSynHandler", "SingleMsg",
55-
"SocketStreamer", "SparseMsg", "Species", "SpikeGen", "SpikeStats",
56-
"Spine", "SpineMesh", "Stats", "SteadyState", "StimulusTable", "Stoich",
57-
"Streamer", "SymCompartment", "SynChan", "Synapse", "Table", "Table2",
58-
"TimeTable", "VClamp" };
59-
6040
Id initShell(void)
6141
{
6242
Cinfo::rebuildOpIndex();
@@ -104,27 +84,14 @@ Id initShell(void)
10484
* @Returns
10585
*/
10686
/* ----------------------------------------------------------------------------*/
107-
Id getShell(int argc, char ** argv)
87+
Id getShell()
10888
{
10989
static int inited = 0;
11090
if (inited)
11191
return Id(0);
11292

11393
Id shellId = initShell();
11494
inited = 1;
115-
116-
Shell * shellPtr = reinterpret_cast<Shell*>(shellId.eref().data());
117-
if ( shellPtr->myNode() == 0 )
118-
{
119-
if ( Shell::numNodes() > 1 )
120-
{
121-
// Use the last clock for the postmaster, so that it is called
122-
// after everything else has been processed and all messages
123-
// are ready to send out.
124-
shellPtr->doUseClock( "/postmaster", "process", 9 );
125-
shellPtr->doSetClock( 9, 1.0 ); // Use a sensible default.
126-
}
127-
}
12895
return shellId;
12996
}
13097

@@ -203,6 +170,8 @@ PYBIND11_MODULE(_moose, m)
203170
.def(py::init<>())
204171
;
205172

173+
auto shell = getShell();
174+
206175
// Add Shell Class.
207176
py::class_<Shell>(m, "Shell")
208177
.def(py::init<>())
@@ -228,4 +197,6 @@ PYBIND11_MODULE(_moose, m)
228197

229198
m.attr("__version__") = MOOSE_VERSION;
230199

200+
//m.attr("shell") = shell;
201+
231202
}

python/moose/__init__.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,3 @@
33

44
# Bring everything from c++ module to global namespace.
55
from moose._moose import *
6-
7-
# Bring everything from moose.py to global namespace.
8-
# IMP: It will overwrite any c++ function with the same name. We can override
9-
# some C++ here.
10-
from moose.moose import *
11-
from moose.server import *
12-
13-
# SBML and NML2 support.
14-
from moose.model_utils import *
15-
16-
# create a shorthand for version() call here.
17-
__version__ = version()
18-
19-
# C++ core override
20-
from moose.wrapper import *
21-
22-
# Import moose test.
23-
from moose.moose_test import test

0 commit comments

Comments
 (0)