diff --git a/python/recipe.cpp b/python/recipe.cpp index de2cb1329387090a4deded78015bc3460c577b3d..83172209557189b74a9b9bce028529673d2de48a 100644 --- a/python/recipe.cpp +++ b/python/recipe.cpp @@ -14,6 +14,7 @@ #include <arbor/morph/primitives.hpp> #include <arbor/recipe.hpp> +#include "arbor/cable_cell_param.hpp" #include "conversion.hpp" #include "error.hpp" #include "event_generator.hpp" @@ -70,6 +71,9 @@ static std::any convert_gprop(pybind11::object o) { if (o.is(pybind11::none())) { return {}; } + if (!pybind11::isinstance<arb::cable_cell_global_properties>(o)) { + throw pyarb_error("recipe.global_properties must return a valid description of cable cell properties of type arbor.cable_global_properties"); + } return pybind11::cast<arb::cable_cell_global_properties>(o); } diff --git a/python/recipe.hpp b/python/recipe.hpp index 9956b7240e4d050acb928ee4a7ac6aa988847a52..a8a658ab87f114f8fd040548ffdf8cd0b7a803c9 100644 --- a/python/recipe.hpp +++ b/python/recipe.hpp @@ -48,7 +48,6 @@ public: virtual pybind11::object global_properties(arb::cell_kind kind) const { return pybind11::none(); }; - //TODO: virtual pybind11::object global_properties(arb::cell_kind kind) const {return pybind11::none();}; }; class py_recipe_trampoline: public py_recipe {