diff options
author | Marcus Müller <marcus.mueller@ettus.com> | 2018-03-06 12:44:36 +0100 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-03-06 15:29:49 +0100 |
commit | e635ae442132a7e3bab75796d2ac0b66bd289bdb (patch) | |
tree | c232b95acc048c25c69d96671fe9dafbc074e640 /gnuradio-runtime/python/gnuradio/gr/gateway.py | |
parent | 47f86bce7f101bd312f05dbbe939f2207448b244 (diff) |
runtime: py_io_signature method documentation
Only moved code comments to become docstrings.
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/gr/gateway.py')
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gr/gateway.py | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr/gateway.py b/gnuradio-runtime/python/gnuradio/gr/gateway.py index 9c6a5fcd9b..8f4b930fd2 100644 --- a/gnuradio-runtime/python/gnuradio/gr/gateway.py +++ b/gnuradio-runtime/python/gnuradio/gr/gateway.py @@ -81,36 +81,42 @@ class msg_handler(gr.feval_p): # io_signature for Python ######################################################################## class py_io_signature(object): - """Describes the type/number of ports for block input or output. - - Args: - - min_ports (int): mininum number of connected ports. - - max_ports (int): maximum number of connected ports. -1 indicates - no limit. - - type_list (list[str]): numpy type names for each port. If the - number of connected ports is greater than the number of types - provided, the last type in the list is repeated. + """ + Describes the type/number of ports for block input or output. """ # Minimum and maximum number of ports, and a list of numpy types. def __init__(self, min_ports, max_ports, type_list): + """ + Args: + + min_ports (int): mininum number of connected ports. + + max_ports (int): maximum number of connected ports. -1 indicates + no limit. + + type_list (list[str]): numpy type names for each port. If the + number of connected ports is greater than the number of types + provided, the last type in the list is repeated. + """ self.__min_ports = min_ports self.__max_ports = max_ports self.__types = map(numpy.dtype, type_list) - # Make/return a gr.io_signature. A non-empty list of sizes is - # required, even if there are no ports. def gr_io_signature(self): + """ + Make/return a gr.io_signature. A non-empty list of sizes is + required, even if there are no ports. + """ return io_signaturev(self.__min_ports, self.__max_ports, [t.itemsize for t in self.__types] or [0]) - # Return data types for the first nports ports. If nports is - # smaller than the provided type list, return a truncated list. If - # larger, fill with the last type. def port_types(self, nports): + """ + Return data types for the first nports ports. If nports is + smaller than the provided type list, return a truncated list. If + larger, fill with the last type. + """ ntypes = len(self.__types) if ntypes == 0: return () |