Further WIP

This commit is contained in:
Laurence Withers 2014-07-10 16:46:22 +00:00
commit 836fa2eb40
15 changed files with 581 additions and 5 deletions

5
python/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
.ipynb_checkpoints/
__pycache__/
build/
fir.py
pyfir_wrap.cxx

File diff suppressed because one or more lines are too long

1
python/fir++.h Symbolic link
View file

@ -0,0 +1 @@
../obj/fir++.h

24
python/pyfir.i Normal file
View file

@ -0,0 +1,24 @@
%module fir
%include <complex.i>
/*
* List conversion
*
* SWIG knows how to turn std::vector<T> func() into a function that returns a
* Python list. We do need to tell it about all <T> types with %template,
* however.
*/
%include <std_vector.i>
%template(vectord) std::vector<double>;
%{
#include "fir++.h"
%}
%include "fir++.h"
// vim: ts=4:sw=4

16
python/setup.py Normal file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env python3
from distutils.core import setup, Extension
fir_module = Extension('_fir',
sources=['pyfir_wrap.cxx'],
libraries=['fir++'],
)
setup(name = 'fir',
version = '0.0.0',
author = 'Laurence Withers',
description = 'FIR filter',
ext_modules = [fir_module],
py_modules = ['fir'],
)