Commit 8095f9be authored by Markus Mirz's avatar Markus Mirz

add nodes and pybind test notebook

parent 2f56bb4c
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import dpsimpy"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sim = dpsimpy.Simulation('test')\n",
"sim.name()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"node = dpsimpy.dp.SimNode('dpnode')\n",
"node.name()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gndnode = dpsimpy.dp.SimNode.gnd\n",
"gndnode.name()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
......@@ -24,6 +24,18 @@ PYBIND11_MODULE(dpsimpy, m) {
.def(py::init<std::string>())
.def("name", &DPsim::Simulation::name);
py::module mDP = m.def_submodule("dp", "dynamic phasor models");
py::module mEMT = m.def_submodule("emt", "electromagnetic-transient models");
py::class_<CPS::DP::SimNode, std::shared_ptr<CPS::DP::SimNode>>(mDP, "SimNode")
.def(py::init<std::string>())
.def_readonly_static("gnd", &CPS::DP::SimNode::GND)
.def("name", &CPS::DP::SimNode::name);
py::class_<CPS::EMT::SimNode, std::shared_ptr<CPS::EMT::SimNode>>(mEMT, "SimNode")
.def(py::init<std::string>())
.def("name", &CPS::EMT::SimNode::name);
#ifdef VERSION_INFO
m.attr("__version__") = VERSION_INFO;
#else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment