From 49a1e13eb24fa9613585cf8c2b8bbe2bbfa994f4 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 23 Feb 2013 01:52:30 -0800 Subject: gras: use new set/get item size api --- python/gras/CMakeLists.txt | 2 -- python/gras/GRAS_Block.i | 5 ++--- python/gras/GRAS_HierBlock.i | 19 ++++--------------- python/gras/GRAS_IOSignature.i | 3 --- 4 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 python/gras/GRAS_IOSignature.i (limited to 'python/gras') diff --git a/python/gras/CMakeLists.txt b/python/gras/CMakeLists.txt index ca38324..8171e7f 100644 --- a/python/gras/CMakeLists.txt +++ b/python/gras/CMakeLists.txt @@ -23,7 +23,6 @@ GR_SWIG_MAKE(GRAS_Block GRAS_Block.i) GR_SWIG_MAKE(GRAS_HierBlock GRAS_HierBlock.i) GR_SWIG_MAKE(GRAS_ThreadPool GRAS_ThreadPool.i) GR_SWIG_MAKE(GRAS_SBuffer GRAS_SBuffer.i) -GR_SWIG_MAKE(GRAS_IOSignature GRAS_IOSignature.i) GR_SWIG_INSTALL( TARGETS GRAS_Tags @@ -31,7 +30,6 @@ GR_SWIG_INSTALL( GRAS_HierBlock GRAS_ThreadPool GRAS_SBuffer - GRAS_IOSignature DESTINATION ${GR_PYTHON_DIR}/gras COMPONENT ${GRAS_COMP_PYTHON} ) diff --git a/python/gras/GRAS_Block.i b/python/gras/GRAS_Block.i index 1cf226e..9e7299c 100644 --- a/python/gras/GRAS_Block.i +++ b/python/gras/GRAS_Block.i @@ -186,7 +186,6 @@ struct BlockPython : Block import numpy import traceback from GRAS_Utils import pointer_to_ndarray -from GRAS_IOSignature import IOSignature from PMC import * def sig_to_dtype_sig(sig): @@ -205,11 +204,11 @@ class Block(BlockPython): def set_input_signature(self, sig): self.__in_sig = sig_to_dtype_sig(sig) - BlockPython.set_input_signature(self, IOSignature([s.itemsize for s in self.__in_sig])) + for i, n in enumerate(self.__in_sig): self.set_input_size(i, n.itemsize) def set_output_signature(self, sig): self.__out_sig = sig_to_dtype_sig(sig) - BlockPython.set_output_signature(self, IOSignature([s.itemsize for s in self.__out_sig])) + for i, n in enumerate(self.__out_sig): self.set_output_size(i, n.itemsize) def input_signature(self): return self.__in_sig def output_signature(self): return self.__out_sig diff --git a/python/gras/GRAS_HierBlock.i b/python/gras/GRAS_HierBlock.i index 9cd705e..f2a9b5a 100644 --- a/python/gras/GRAS_HierBlock.i +++ b/python/gras/GRAS_HierBlock.i @@ -104,17 +104,6 @@ struct HierBlockPython : HierBlock { //NOP } - - HierBlockPython( - const std::string &name, - const IOSignature &input_signature, - const IOSignature &output_signature - ): - HierBlock(name) - { - this->set_input_signature(input_signature); - this->set_output_signature(output_signature); - } }; } @@ -151,8 +140,8 @@ def internal_connect__(fcn, obj, *args): fcn(obj, src, src_index, sink, sink_index) class TopBlock(TopBlockPython): - def __init__(self, *args, **kwargs): - TopBlockPython.__init__(self, *args, **kwargs) + def __init__(self, name="Top", *args, **kwargs): + TopBlockPython.__init__(self, name) def connect(self, *args): return internal_connect__(TopBlockPython.connect, self, *args) @@ -161,8 +150,8 @@ class TopBlock(TopBlockPython): return internal_connect__(TopBlockPython.disconnect, self, *args) class HierBlock(HierBlockPython): - def __init__(self, *args, **kwargs): - HierBlockPython.__init__(self, *args, **kwargs) + def __init__(self, name="Hier", *args, **kwargs): + HierBlockPython.__init__(self, name) #backwards compatible silliness import weakref diff --git a/python/gras/GRAS_IOSignature.i b/python/gras/GRAS_IOSignature.i deleted file mode 100644 index 36f51dd..0000000 --- a/python/gras/GRAS_IOSignature.i +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. - -%include -- cgit