cython setup imc_termite pytho module

This commit is contained in:
2021-02-12 11:30:16 +01:00
parent 3d9305a1be
commit dd78b37290
7 changed files with 79 additions and 30 deletions

27
cython/py_imc_termite.pyx Normal file
View File

@@ -0,0 +1,27 @@
# distutils: language = c++
from imc_termite cimport imc_termite
import json as jn
# import numpy as np
cdef class imctermite:
# C++ instance of class => stack allocated (requires nullary constructor!)
cdef imc_termite cpp_imc
# constructor
def __cinit__(self, string rawfile):
self.cpp_imc = imc_termite(rawfile)
# provide raw file
def submit_file(self,string rawfile):
self.cpp_tdm.set_file(rawfile)
# get JSON list of channels
def get_channels(self, bool data):
return self.cpp_imc.get_channels()
# print a channels
def print_channel(self, string outputdir):
self.cpp_tdm.print_channels(outputdir)