From 7bd4318c5ae30d691066e54a811eff5202c374c4 Mon Sep 17 00:00:00 2001 From: Nick Bailey Date: Tue, 14 Sep 2021 19:38:21 +0100 Subject: [PATCH 1/2] Merge upstream, and fix non-pythonesque comments in fir1.i --- fir1.i | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fir1.i b/fir1.i index 816be0d..e31a7b4 100644 --- a/fir1.i +++ b/fir1.i @@ -29,8 +29,11 @@ %feature("shadow") Fir1::getCoeff(double *, unsigned) const %{ def getCoeff(*args): if len(args) < 2 : + # Only one argument given, and that is self. + # Set the number of taps to return from the number of weights. return $action(args[0], args[0].getTaps()) else : + # If any other arguments are supplied, pass them through to the C++ library. return $action(*args) %} From 299062483c3b8afa230ded038a1e095dd2bb24ab Mon Sep 17 00:00:00 2001 From: Nick Bailey Date: Tue, 14 Sep 2021 20:00:21 +0100 Subject: [PATCH 2/2] Ignore getCoeffVector for python binding --- fir1.i | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fir1.i b/fir1.i index e31a7b4..f6e7343 100644 --- a/fir1.i +++ b/fir1.i @@ -26,6 +26,11 @@ // Calling getCoeff() without an argument returns a numpy array of the filter weights. // This is fine in Python, everything is very dynamic. It might be dangerous in C(++) +// This pretty much replaces the functionality of getCoeffVector in the C++ library. +// As we're using numpy, converting std::vector to a list is of little use, so... + +%ignore Fir1::getCoeffVector() const; + %feature("shadow") Fir1::getCoeff(double *, unsigned) const %{ def getCoeff(*args): if len(args) < 2 :