diff options
80 files changed, 4280 insertions, 105 deletions
diff --git a/cmake/Modules/FindSphinx.cmake b/cmake/Modules/FindSphinx.cmake new file mode 100644 index 000000000..da12ee93d --- /dev/null +++ b/cmake/Modules/FindSphinx.cmake @@ -0,0 +1,37 @@ +# - This module looks for Sphinx +# Find the Sphinx documentation generator +# +# This modules defines +# SPHINX_EXECUTABLE +# SPHINX_FOUND + +#============================================================================= +# Copyright 2002-2009 Kitware, Inc. +# Copyright 2009-2011 Peter Colberg +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file COPYING-CMAKE-SCRIPTS for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +find_program(SPHINX_EXECUTABLE NAMES sphinx-build + HINTS + $ENV{SPHINX_DIR} + PATH_SUFFIXES bin + DOC "Sphinx documentation generator" +) + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(Sphinx DEFAULT_MSG + SPHINX_EXECUTABLE +) + +mark_as_advanced( + SPHINX_EXECUTABLE +) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index f67fdd7a8..24bf2405e 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -21,12 +21,14 @@ # Setup dependencies ######################################################################## find_package(Doxygen) +find_package(Sphinx) ######################################################################## # Register component ######################################################################## include(GrComponent) GR_REGISTER_COMPONENT("doxygen" ENABLE_DOXYGEN DOXYGEN_FOUND) +GR_REGISTER_COMPONENT("sphinx" ENABLE_SPHINX SPHINX_FOUND) ######################################################################## # Begin conditional configuration @@ -48,3 +50,25 @@ CPACK_COMPONENT("docs" add_subdirectory(doxygen) endif(ENABLE_DOXYGEN) + + +######################################################################## +# Begin conditional configuration +######################################################################## +if(ENABLE_SPHINX) + +######################################################################## +# Setup CPack components +######################################################################## +include(GrPackage) +CPACK_COMPONENT("docs" + DISPLAY_NAME "Documentation" + DESCRIPTION "Sphinx generated documentation" +) + +######################################################################## +# Add subdirectories +######################################################################## +add_subdirectory(sphinx) + +endif(ENABLE_SPHINX) diff --git a/docs/doxygen/Doxyfile.in b/docs/doxygen/Doxyfile.in index f3485316c..ad3c2d01f 100644 --- a/docs/doxygen/Doxyfile.in +++ b/docs/doxygen/Doxyfile.in @@ -628,7 +628,6 @@ EXCLUDE = @abs_top_builddir@/docs/doxygen/html \ @abs_top_builddir@/gr-gsm-fr-vocoder/src/lib/gsm_full_rate.py \ @abs_top_builddir@/gr-gsm-fr-vocoder/src/python/encdec.py \ @abs_top_builddir@/gr-howto-write-a-block \ - @abs_top_builddir@/gr-howto-write-a-block-cmake \ @abs_top_builddir@/gr-pager/src/pager_swig.py \ @abs_top_builddir@/gr-trellis/doc \ @abs_top_builddir@/gr-trellis/src/lib/generate_all.py \ @@ -640,7 +639,7 @@ EXCLUDE = @abs_top_builddir@/docs/doxygen/html \ @abs_top_builddir@/_CPack_Packages \ @abs_top_srcdir@/cmake \ @abs_top_srcdir@/gr-qtgui/lib \ - @abs_top_srcdir@/gr-howto-write-a-block-cmake + @abs_top_srcdir@/gr-howto-write-a-block # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded diff --git a/docs/doxygen/doxyxml/doxyindex.py b/docs/doxygen/doxyxml/doxyindex.py index 0132ab86f..84bc7b88c 100644 --- a/docs/doxygen/doxyxml/doxyindex.py +++ b/docs/doxygen/doxyxml/doxyindex.py @@ -1,23 +1,23 @@ # # Copyright 2010 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# """ Classes providing more user-friendly interfaces to the doxygen xml docs than the generated classes provide. @@ -40,7 +40,7 @@ class DoxyIndex(Base): if self._parsed: return super(DoxyIndex, self)._parse() - self._root = index.parse(os.path.join(self._xml_path, 'index.xml')) + self._root = index.parse(os.path.join(self._xml_path, 'index.xml')) for mem in self._root.compound: converted = self.convert_mem(mem) # For files we want the contents to be accessible directly @@ -78,14 +78,14 @@ class DoxyCompMem(Base): bd = description(getattr(parse_data, 'briefdescription', None)) dd = description(getattr(parse_data, 'detaileddescription', None)) self._data['brief_description'] = bd - self._data['detailed_description'] = dd + self._data['detailed_description'] = dd class DoxyCompound(DoxyCompMem): pass class DoxyMember(DoxyCompMem): pass - + class DoxyFunction(DoxyMember): @@ -111,7 +111,7 @@ Base.mem_classes.append(DoxyFunction) class DoxyParam(DoxyMember): - + __module__ = "gnuradio.utils.doxyxml" def _parse(self): @@ -125,12 +125,33 @@ class DoxyParam(DoxyMember): detailed_description = property(lambda self: self.data()['detailed_description']) declname = property(lambda self: self.data()['declname']) -class DoxyClass(DoxyCompound): +class DoxyParameterItem(DoxyMember): + """A different representation of a parameter in Doxygen.""" + + def _parse(self): + if self._parsed: + return + super(DoxyParameterItem, self)._parse() + names = [] + for nl in self._parse_data.parameternamelist: + for pn in nl.parametername: + names.append(description(pn)) + # Just take first name + self._data['name'] = names[0] + # Get description + pd = description(self._parse_data.get_parameterdescription()) + self._data['description'] = pd + + description = property(lambda self: self.data()['description']) + name = property(lambda self: self.data()['name']) + +class DoxyClass(DoxyCompound): + __module__ = "gnuradio.utils.doxyxml" kind = 'class' - + def _parse(self): if self._parsed: return @@ -139,22 +160,40 @@ class DoxyClass(DoxyCompound): if self._error: return self.set_descriptions(self._retrieved_data.compounddef) + self.set_parameters(self._retrieved_data.compounddef) # Sectiondef.kind tells about whether private or public. # We just ignore this for now. self.process_memberdefs() + def set_parameters(self, data): + vs = [ddc.value for ddc in data.detaileddescription.content_] + pls = [] + for v in vs: + if hasattr(v, 'parameterlist'): + pls += v.parameterlist + pis = [] + for pl in pls: + pis += pl.parameteritem + dpis = [] + for pi in pis: + dpi = DoxyParameterItem(pi) + dpi._parse() + dpis.append(dpi) + self._data['params'] = dpis + brief_description = property(lambda self: self.data()['brief_description']) detailed_description = property(lambda self: self.data()['detailed_description']) + params = property(lambda self: self.data()['params']) Base.mem_classes.append(DoxyClass) - + class DoxyFile(DoxyCompound): - + __module__ = "gnuradio.utils.doxyxml" kind = 'file' - + def _parse(self): if self._parsed: return @@ -164,7 +203,7 @@ class DoxyFile(DoxyCompound): if self._error: return self.process_memberdefs() - + brief_description = property(lambda self: self.data()['brief_description']) detailed_description = property(lambda self: self.data()['detailed_description']) @@ -172,16 +211,16 @@ Base.mem_classes.append(DoxyFile) class DoxyNamespace(DoxyCompound): - + __module__ = "gnuradio.utils.doxyxml" kind = 'namespace' - + Base.mem_classes.append(DoxyNamespace) class DoxyGroup(DoxyCompound): - + __module__ = "gnuradio.utils.doxyxml" kind = 'group' @@ -209,7 +248,7 @@ class DoxyGroup(DoxyCompound): self.process_memberdefs() title = property(lambda self: self.data()['title']) - + Base.mem_classes.append(DoxyGroup) @@ -224,7 +263,7 @@ Base.mem_classes.append(DoxyFriend) class DoxyOther(Base): - + __module__ = "gnuradio.utils.doxyxml" kinds = set(['variable', 'struct', 'union', 'define', 'typedef', 'enum', 'dir', 'page']) @@ -232,6 +271,6 @@ class DoxyOther(Base): @classmethod def can_parse(cls, obj): return obj.kind in cls.kinds - + Base.mem_classes.append(DoxyOther) diff --git a/docs/doxygen/swig_doc.py b/docs/doxygen/swig_doc.py index bd35b8efd..414748bba 100644 --- a/docs/doxygen/swig_doc.py +++ b/docs/doxygen/swig_doc.py @@ -1,23 +1,23 @@ # # Copyright 2010,2011 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# """ Creates the swig_doc.i SWIG interface file. Execute using: python swig_doc.py xml_path outputfilename @@ -29,11 +29,7 @@ python docstrings. import sys, time -try: - from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base -except ImportError: - from gnuradio.doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base - +from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base def py_name(name): bits = name.split('_') @@ -56,7 +52,9 @@ class Block(object): # Check for a parsing error. if item.error(): return False - return item.has_member(make_name(item.name()), DoxyFriend) + friendname = make_name(item.name()) + is_a_block = item.has_member(friendname, DoxyFriend) + return is_a_block def utoascii(text): @@ -82,13 +80,19 @@ def combine_descriptions(obj): if dd: description.append(dd) return utoascii('\n\n'.join(description)).strip() - + +def format_params(parameteritems): + output = ['Args:'] + template = ' {0} : {1}' + for pi in parameteritems: + output.append(template.format(pi.name, pi.description)) + return '\n'.join(output) entry_templ = '%feature("docstring") {name} "{docstring}"' -def make_entry(obj, name=None, templ="{description}", description=None): +def make_entry(obj, name=None, templ="{description}", description=None, params=[]): """ Create a docstring entry for a swig interface file. - + obj - a doxyxml object from which documentation will be extracted. name - the name of the C object (defaults to obj.name()) templ - an optional template for the docstring containing only one @@ -102,6 +106,9 @@ def make_entry(obj, name=None, templ="{description}", description=None): return '' if description is None: description = combine_descriptions(obj) + if params: + description += '\n\n' + description += utoascii(format_params(params)) docstring = templ.format(description=description) if not docstring: return '' @@ -121,16 +128,17 @@ def make_func_entry(func, name=None, description=None, params=None): used as the description instead of extracting it from func. params - a parameter list that overrides using func.params. """ - if params is None: - params = func.params - params = [prm.declname for prm in params] - if params: - sig = "Params: (%s)" % ", ".join(params) - else: - sig = "Params: (NONE)" - templ = "{description}\n\n" + sig - return make_entry(func, name=name, templ=utoascii(templ), - description=description) + #if params is None: + # params = func.params + #params = [prm.declname for prm in params] + #if params: + # sig = "Params: (%s)" % ", ".join(params) + #else: + # sig = "Params: (NONE)" + #templ = "{description}\n\n" + sig + #return make_entry(func, name=name, templ=utoascii(templ), + # description=description) + return make_entry(func, name=name, description=description, params=params) def make_class_entry(klass, description=None): @@ -138,7 +146,7 @@ def make_class_entry(klass, description=None): Create a class docstring for a swig interface file. """ output = [] - output.append(make_entry(klass, description=description)) + output.append(make_entry(klass, description=description, params=klass.params)) for func in klass.in_category(DoxyFunction): name = klass.name() + '::' + func.name() output.append(make_func_entry(func, name=name)) @@ -177,16 +185,33 @@ def make_block_entry(di, block): output.append(make_class_entry(block, description=super_description)) creator = block.get_member(block.name(), DoxyFunction) output.append(make_func_entry(make_func, description=super_description, - params=creator.params)) + params=block.params)) return "\n\n".join(output) +def wait_if_necessary(tries, swigdocfilename, item=None): + if item is not None: + extra = ', item {0}'.format(item.name()) + else: + extra = '' + if(tries < 3): + # May not be built just yet; sleep and try again + sys.stderr.write("XML parsing problem with file {0}{1}, retrying.\n".format( + swigdocfilename, extra)) + time.sleep(1) + tries += 1 + return tries, True + else: + # if we've given it three tries, give up and raise an error + sys.stderr.write("XML parsing error with file {0}{1}. giving up.\n".format( + swigdocfilename, extra)) + return tries, False -def make_swig_interface_file(di, swigdocfilename, custom_output=None): - +def make_swig_interface_file(di, swigdocfilename, custom_output=None, tries=0): + output = [""" /* * This file was automatically generated using swig_doc.py. - * + * * Any changes to it will be lost next time it is regenerated. */ """] @@ -195,46 +220,29 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None): output.append(custom_output) # Create docstrings for the blocks. - tries = 0 while(1): try: blocks = di.in_category(Block) except: - if(tries < 3): - # May not be built just yet; sleep and try again - sys.stderr.write("XML parsing problem with file {0}, retrying.\n".format( - swigdocfilename)) - time.sleep(1) - tries += 1 - else: - # if we've given it three tries, give up and raise an error - sys.stderr.write("XML parsing error with file {0}. giving up.\n".format( - swigdocfilename)) + tries, try_again = wait_if_necessary(tries, swigdocfilename) + if not try_again: raise else: break - make_funcs = set([]) for block in blocks: - tries = 0 while(1): try: make_func = di.get_member(make_name(block.name()), DoxyFunction) - make_funcs.add(make_func.name()) - output.append(make_block_entry(di, block)) + # Don't want to risk writing to output twice. + if make_func.name() not in make_funcs: + make_funcs.add(make_func.name()) + output.append(make_block_entry(di, block)) except block.ParsingError: - sys.stderr.write('Parsing error for block {0}'.format(block.name())) + sys.stderr.write('Parsing error for block {0}\n'.format(block.name())) except: - if(tries < 3): - # May not be built just yet; sleep and try again - sys.stderr.write("XML parsing problem with file {0}, retrying.\n".format( - swigdocfilename)) - time.sleep(1) - tries += 1 - else: - # if we've given it three tries, give up and raise an error - sys.stderr.write("XML parsing error with file {0}. giving up.\n".format( - swigdocfilename)) + tries, try_again = wait_if_necessary(tries, swigdocfilename, block) + if not try_again: raise else: break @@ -246,7 +254,7 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None): try: output.append(make_func_entry(f)) except f.ParsingError: - sys.stderr.write('Parsing error for function {0}'.format(f.name())) + sys.stderr.write('Parsing error for function {0}\n'.format(f.name())) # Create docstrings for classes block_names = [block.name() for block in blocks] @@ -255,7 +263,7 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None): try: output.append(make_class_entry(k)) except k.ParsingError: - sys.stderr.write('Parsing error for class {0}'.format(k.name())) + sys.stderr.write('Parsing error for class {0}\n'.format(k.name())) # Docstrings are not created for anything that is not a function or a class. # If this excludes anything important please add it here. @@ -291,19 +299,11 @@ if __name__ == "__main__": tries = 0 while(1): try: - make_swig_interface_file(di, swigdocfilename, custom_output=custom_output) + make_swig_interface_file(di, swigdocfilename, custom_output=custom_output, tries=tries) except: - if(tries < 3): - # May not be built just yet; sleep and try again - sys.stderr.write("XML parsing problem with file {0}, retrying.\n".format( - swigdocfilename)) - time.sleep(1) - tries += 1 - else: - # if we've given it three tries, give up and raise an error - sys.stderr.write("XML parsing error with file {0}. giving up.\n".format( - swigdocfilename)) + tries, try_again = wait_if_necessary(tries, swigdocfilename) + if not try_again: raise else: break - + diff --git a/docs/sphinx/CMakeLists.txt b/docs/sphinx/CMakeLists.txt new file mode 100644 index 000000000..38d77fb3a --- /dev/null +++ b/docs/sphinx/CMakeLists.txt @@ -0,0 +1,35 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +include(GrPython) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/source/conf.py.in + ${CMAKE_CURRENT_BINARY_DIR}/conf.py +@ONLY) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/run_sphinx_build.sh.in + ${CMAKE_BINARY_DIR}/run_sphinx_build.sh +@ONLY) + +if(UNIX) + #make the shell file executable + execute_process(COMMAND chmod +x ${CMAKE_BINARY_DIR}/run_sphinx_build.sh) +endif(UNIX) diff --git a/docs/sphinx/README b/docs/sphinx/README new file mode 100644 index 000000000..c3ac38264 --- /dev/null +++ b/docs/sphinx/README @@ -0,0 +1,69 @@ +INTRODUCTION +The Sphinx documentation system uses the fully installed Python tree +to build a set of documents (generally in HTML). In GNU Radio, the +documentation system is done through Doxygen in the public header +(/include/foo.h) files. Doxygen first builds its documentation files, +then the swig_docs program uses Doxygen's XML output and smashed the +documentation from each header file into the SWIG'd Python +block. Basically, using a single documentation markup, Doxygen, we +expose the documentation strings in both the Doxygen-built manual and +within the Python blocks themselves. + +Sphinx takes this process one step farther by reading the docstrings +of all Python blocks and creating its own manual. This has two +benefits. First, the Sphinx documentation looks nice and is formatted +in such a way that Python users of GNU Radio can easy see the module +structure and hierarchy. It also not only takes the Doxygen +documentation from C++, but it also allows us to take any Python files +and include their documentation. + +The end result is two manuals: one for Python and one for C++ users +without having to duplicate comments, markup, or documentation. + + +BUILDING THE SPHINX MANUAL +Building the Sphinx docs takes some manual intervention as it +requires GNU Radio to already be installed. So first follow the steps +to build and install GNU Radio. + +In the build directory, a helper file is created called +run_sphinx_build.sh. This is a Linux shell script that runs the +sphinx-build command with all of the normal settings and important +directories preloaded. For non Linux systems, it should be easy to +pull out the executable and options to run it by hand. + +The run_sphinx_build.sh outputs the manual into +$builddir/docs/sphinx/sphinx_out. Open up the index.html file in a +browser to view it. + +ADDING NEW CONTENT TO THE SPHINX MANUAL +Although the content of the sphinx manual is automatically generated, +new blocks are not automatically added to the generated documentation. +The procedure for adding new content is best illustrated with two +examples. + +1) Adding a new C++ signal processing block gnuradio.gr.myslicer + Edit file gnuradio/docs/sphinx/source/gr/index.rst and add the line + > gnuradio.gr.myslicer + under the "Slicing and Dicing Streams" subheading. + Edit file gnuradio/docs/sphinx/source/gr/slicedice_blk.rst and add + the line + >.. autoblock:: gnuradio.gr.myslicer + +2) Adding a new python hierarchical block gnuradio.digital.mymod + Edit file gnruadio/docs/sphinx/source/digital/index.rst and add the + line + > gnuradio.digital.mymod + under the "Signal Processing Blocks" subheading. + Edit file gnuradio/docs/sphinx/source/digital/blocks.rst and add + the line + >.. autopyblock:: gnuradio.digital.mymod + Notice that the 'autopyblock' directive is used rather than the + 'autoblock' directive. This lets sphinx know that it is displaying + a python hierarchical signal processing block so that it can format + it appropriately. + +The process for documenting objects that are not signal processing blocks is +similar but rather than using the 'autoblock' and 'autopyblock' directives +the standard sphinx directives such as 'autofunction' and 'autoclass' can +be used.
\ No newline at end of file diff --git a/docs/sphinx/gnuradio_sphinx.py b/docs/sphinx/gnuradio_sphinx.py new file mode 100644 index 000000000..6f35a6fce --- /dev/null +++ b/docs/sphinx/gnuradio_sphinx.py @@ -0,0 +1,151 @@ +""" +Customizations of sphinx for gnuradio use. +""" + +from sphinx.ext.autodoc import py_ext_sig_re +from sphinx.ext.autodoc import ClassDocumenter, FunctionDocumenter, members_option +from sphinx.ext.autodoc import bool_option, members_set_option, identity +from sphinx.ext.autodoc import ALL + +# A dictionary of the number of lines to delete from the beginning of docstrings +lines_to_delete = {} + +def setup(sp): + # Fix line-breaks in signature. + sp.connect('autodoc-process-signature', fix_signature) + sp.connect('autodoc-process-docstring', remove_lines) + # Add node to autodocument signal-processing blocks. + sp.add_autodocumenter(BlockDocumenter) + sp.add_autodocumenter(PyBlockDocumenter) + +def remove_lines(app, what, name, obj, options, lines): + del_lines = lines_to_delete.get(name, 0) + # Don't delete any lines if this is called again. + lines_to_delete[name] = 0 + lines[:] = lines[del_lines:] + +def fix_signature(app, what, name, obj, options, signature, return_annotation): + """ + SWIG produces signature at the top of docstrings of the form + 'blah(int arg1, float arg2) -> return_type' + and if the string is long it breaks it over multiple lines. + + Sphinx gets confused if it is broken over multiple lines. + fix_signature and remove_lines get around this problem. + """ + if return_annotation is not None: + return + + if hasattr(obj, '__doc__'): + docs = obj.__doc__ + else: + docs = None + if not docs: + return None + doclines = docs.split('\n') + del_lines = remove_linebreaks_in_signature(doclines) + # match first line of docstring against signature RE + match = py_ext_sig_re.match(doclines[0]) + if not match: + return None + exmod, path, base, args, retann = match.groups() + # ok, now jump over remaining empty lines and set the remaining + # lines as the new doclines + i = 1 + while i < len(doclines) and not doclines[i].strip(): + i += 1 + lines_to_delete[name] = i - 1 + del_lines + # format args + signature = "({0})".format(args) + return signature, retann + +def remove_linebreaks_in_signature(lines): + alllines = '\n'.join(lines) + alllines = alllines.lstrip() + bits = alllines.split('->') + if len(bits) == 1: + return 0 + after = '->'.join(bits[1:]) + after_lines = after.split('\n') + ending = None + remainder = [] + for line in after_lines: + if line and ending is None: + ending = line + elif ending is not None: + remainder.append(line) + first_line = ' '.join([a.strip() for a in bits[0].split('\n') if a.strip()]) + ' -> ' + ending.strip() + match = py_ext_sig_re.match(first_line) + # If it is a signature, make the change to lines. + if match: + new_lines = [first_line] + remainder + lines[:] = new_lines + return len(bits[0].split('\n')) + else: + return 0 + +# These methods are not displayed in the documentation of blocks to +# avoid redundancy. +common_block_members =[ + 'check_topology', + 'detail', + 'history', + 'input_signature', + 'name', + 'nitems_read', + 'nitems_written', + 'nthreads', + 'output_multiple', + 'output_signature', + 'relative_rate', + 'set_detail', + 'set_nthreads', + 'start', + 'stop', + 'thisown', + 'to_basic_block', + 'unique_id', + ] + +class BlockDocumenter(FunctionDocumenter): + """ + Specialized Documenter subclass for gnuradio blocks. + + It merges together the documentation for the generator function (e.g. gr.head) + with the wrapped sptr (e.g. gr.gr_head_sptr) to keep the documentation + tidier. + """ + objtype = 'block' + directivetype = 'function' + # Don't want to use this for generic functions for give low priority. + priority = -10 + + def __init__(self, *args, **kwargs): + super(BlockDocumenter, self).__init__(*args, **kwargs) + # Get class name + bits = self.name.split('.') + if len(bits) != 3 or bits[0] != 'gnuradio': + raise ValueError("expected name to be of form gnuradio.x.y but it is {0}".format(self.name)) + sptr_name = 'gnuradio.{0}.{0}_{1}_sptr'.format(bits[1], bits[2]) + # Create a Class Documenter to create documentation for the classes members. + self.classdoccer = ClassDocumenter(self.directive, sptr_name, indent=self.content_indent) + self.classdoccer.real_modname = self.classdoccer.get_real_modname() + self.classdoccer.options.members = ALL + self.classdoccer.options.exclude_members = common_block_members + self.classdoccer.parse_name() + self.classdoccer.import_object() + + def document_members(self, *args, **kwargs): + return self.classdoccer.document_members(*args, **kwargs) + +class PyBlockDocumenter(ClassDocumenter): + """ + Specialized Documenter subclass for hierarchical python gnuradio blocks. + """ + objtype = 'pyblock' + directivetype = 'class' + + def __init__(self, *args, **kwargs): + super(PyBlockDocumenter, self).__init__(*args, **kwargs) + self.options.members = ALL + self.options.exclude_members = common_block_members diff --git a/docs/sphinx/hieroglyph/LICENSE.txt b/docs/sphinx/hieroglyph/LICENSE.txt new file mode 100644 index 000000000..3f7a63830 --- /dev/null +++ b/docs/sphinx/hieroglyph/LICENSE.txt @@ -0,0 +1,26 @@ +Copyright (c) 2011, Robert Smallshire +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Robert Smallshire nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/sphinx/hieroglyph/README.txt b/docs/sphinx/hieroglyph/README.txt new file mode 100644 index 000000000..c26409d89 --- /dev/null +++ b/docs/sphinx/hieroglyph/README.txt @@ -0,0 +1,10 @@ +Sphinx is a popular tool for documenting Python APIs which uses reStructuredText +as a its lightweight markup language. Sphinx extends restructured text with +semantic markup elements for documenting Python APIs but once these are used the +ratio of markup to content becomes too high and readability is compromised +enough that the docstring becomes unsuitable for use with standard Python +introspection mechanisms like help() or IDEs. + +Hieroglyph is an a Sphinx extension which automatically converts a highly +readable docstring format suitable for use with help() and IDEs to the +reStructuredText hieroglyphics required by Sphinx.
\ No newline at end of file diff --git a/docs/sphinx/hieroglyph/__init__.py b/docs/sphinx/hieroglyph/__init__.py new file mode 100644 index 000000000..25dea27fb --- /dev/null +++ b/docs/sphinx/hieroglyph/__init__.py @@ -0,0 +1,6 @@ +# We only need to expose the setup function to Sphinx + +from .hieroglyph import setup +from .version import __version__ + +__author__ = 'Robert Smallshire'
\ No newline at end of file diff --git a/docs/sphinx/hieroglyph/errors.py b/docs/sphinx/hieroglyph/errors.py new file mode 100644 index 000000000..334b097d8 --- /dev/null +++ b/docs/sphinx/hieroglyph/errors.py @@ -0,0 +1,10 @@ +
+from sphinx.errors import ExtensionError
+
+__author__ = 'rjs'
+
+class HieroglyphError(ExtensionError):
+ '''
+ An exception type specific to the Hieroglyph Sphinx extension.
+ '''
+ pass
\ No newline at end of file diff --git a/docs/sphinx/hieroglyph/hieroglyph.py b/docs/sphinx/hieroglyph/hieroglyph.py new file mode 100644 index 000000000..0056d9ab8 --- /dev/null +++ b/docs/sphinx/hieroglyph/hieroglyph.py @@ -0,0 +1,404 @@ +from __future__ import print_function + +import re + +from errors import HieroglyphError +from nodes import (Node, Raises, Except, Note, Warning, Returns, Arg, + ensure_terminal_blank) + +__author__ = 'Robert Smallshire' + +def parse_hieroglyph_text(lines): + '''Parse text in hieroglyph format and return a reStructuredText equivalent + + Args: + lines: A sequence of strings representing the lines of a single + docstring as read from the source by Sphinx. This string should be + in a format that can be parsed by hieroglyph. + + Returns: + A list of lines containing the transformed docstring as + reStructuredText as produced by hieroglyph. + + Raises: + RuntimeError: If the docstring cannot be parsed. + ''' + indent_lines = unindent(lines) + indent_lines = pad_blank_lines(indent_lines) + indent_lines = first_paragraph_indent(indent_lines) + indent_paragraphs = gather_lines(indent_lines) + parse_tree = group_paragraphs(indent_paragraphs) + syntax_tree = extract_structure(parse_tree) + result = syntax_tree.render_rst() + ensure_terminal_blank(result) + return result + + +def unindent(lines): + '''Convert an iterable of indented lines into a sequence of tuples. + + The first element of each tuple is the indent in number of characters, and + the second element is the unindented string. + + Args: + lines: A sequence of strings representing the lines of text in a docstring. + + Returns: + A list of tuples where each tuple corresponds to one line of the input + list. Each tuple has two entries - the first is an integer giving the + size of the indent in characters, the second is the unindented text. + ''' + unindented_lines = [] + for line in lines: + unindented_line = line.lstrip() + indent = len(line) - len(unindented_line) + unindented_lines.append((indent, unindented_line)) + return unindented_lines + + +def pad_blank_lines(indent_texts): + '''Give blank (empty) lines the same indent level as the preceding line. + + Args: + indent_texts: An iterable of tuples each containing an integer in the + first element and a string in the second element. + + Returns: + A list of tuples each containing an integer in the first element and a + string in the second element. + ''' + current_indent = 0 + result = [] + for indent, text in indent_texts: + if len(text) > 0: + current_indent = indent + result.append((current_indent, text)) + return result + + +def extract_structure(parse_tree): + '''Create an Abstract Syntax Tree representing the semantics of a parse tree. + + Args: + parse_tree: TODO + + Returns: + A Node with is the result of an Abstract Syntax Tree representing the + docstring. + + Raises: + HieroglyphError: In the event that the parse tree cannot be understood. + ''' + return convert_node(parse_tree) + + +def convert_node(node): + if node.indent == 0 and len(node.lines) == 0: + return convert_children(node) + if node.lines[0].startswith('Args:'): + return convert_args(node) + if node.lines[0].startswith('Returns:'): + return convert_returns(node) + if node.lines[0].startswith('Raises:'): + return convert_raises(node) + if node.lines[0].startswith('Note:'): + return convert_note(node) + if node.lines[0].startswith('Warning:'): + return convert_warning(node) + result = convert_children(node) + result.lines = node.lines + result.indent = node.indent + return result + + +def convert_children(node): + converted_children = [convert_node(child) for child in node.children] + result = Node() + result.children = converted_children + return result + + +ARG_REGEX = re.compile(r'(\*{0,2}\w+)(\s+\((\w+)\))?\s*:\s*(.*)') + +def append_child_to_args_group_node(child, group_node, indent): + arg = None + non_empty_lines = (line for line in child.lines if line) + for line in non_empty_lines: + m = ARG_REGEX.match(line) + if m is None: + raise HieroglyphError("Invalid hieroglyph argument syntax: {0}".format(line)) + param_name = m.group(1) + param_type = m.group(3) + param_text = m.group(4) + + arg = Arg(indent, child.indent, param_name) + group_node.children.append(arg) + arg.type = param_type + + if param_text is not None: + arg.children.append(Node(indent, [param_text], arg)) + if arg is not None: + last_child = arg.children[-1] if len(arg.children) != 0 else arg + for grandchild in child.children: + last_child.children.append(grandchild) + + +def convert_args(node): + assert node.lines[0].startswith('Args:') + group_node = Node() + for child in node.children: + append_child_to_args_group_node(child, group_node, node.indent) + return group_node + + +def convert_returns(node): + assert node.lines[0].startswith('Returns:') + returns = Returns(node.indent) + returns.line = node.lines[0][8:].strip() + returns.children = node.children + return returns + + +def convert_note(node): + assert node.lines[0].startswith('Note:') + note = Note(node.indent) + note.line = node.lines[0][5:].strip() + note.children = node.children + return note + + +def convert_warning(node): + assert node.lines[0].startswith('Warning:') + warning = Warning(node.indent) + warning.line = node.lines[0][8:].strip() + warning.children = node.children + return warning + + +def convert_raises(node): + assert node.lines[0].startswith('Raises:') + group_node = Raises(node.indent) + for child in node.children: + append_child_to_raise_node(child, group_node) + return group_node + + +RAISE_REGEX = re.compile(r'(\w+)\s*:\s*(.*)') + +def extract_exception_type_and_text(line): + m = RAISE_REGEX.match(line) + if m is None: + raise HieroglyphError("Invalid hieroglyph exception syntax: {0}".format(line)) + return (m.group(2), m.group(1)) + + +def append_child_to_raise_node(child, group_node): + exception = None + non_empty_lines = (line for line in child.lines if line) + for line in non_empty_lines: + exception_text, exception_type = extract_exception_type_and_text(line) + + exception = Except(child.indent, exception_type) + group_node.children.append(exception) # TODO: Could use parent here. + + if exception_text is not None: + exception.children.append( Node(child.indent, + [exception_text], exception)) + if exception is not None: + last_child = exception.children[-1] if len(exception.children) != 0 else exception + for grandchild in child.children: + last_child.children.append(grandchild) + + +def group_paragraphs(indent_paragraphs): + ''' + Group paragraphs so that more indented paragraphs become children of less + indented paragraphs. + ''' + # The tree consists of tuples of the form (indent, [children]) where the + # children may be strings or other tuples + + root = Node(0, [], None) + current_node = root + + previous_indent = -1 + for indent, lines in indent_paragraphs: + if indent > previous_indent: + current_node = create_child_node(current_node, indent, lines) + elif indent == previous_indent: + current_node = create_sibling_node(current_node, indent, lines) + elif indent < previous_indent: + current_node = create_uncle_node(current_node, indent, lines) + previous_indent = indent + return root + + +def create_sibling_node(current_node, indent, lines): + sibling = Node(indent, lines, current_node.parent) + current_node.parent.add_child(sibling) + current_node = sibling + return current_node + + +def create_child_node(current_node, indent, lines): + child = Node(indent, lines, current_node) + current_node.add_child(child) + current_node = child + return current_node + + +def create_uncle_node(current_node, indent, lines): + ancestor = current_node + while ancestor.indent >= indent: + if ancestor.parent is None: + break + ancestor = ancestor.parent + uncle = Node(indent, lines, ancestor) + ancestor.add_child(uncle) + current_node = uncle + return current_node + + +def gather_lines(indent_lines): + '''Split the list of (int, str) tuples into a list of (int, [str]) tuples + to group the lines into paragraphs of consistent indent. + ''' + return remove_empty_paragraphs(split_separated_lines(gather_lines_by_indent(indent_lines))) + +def gather_lines_by_indent(indent_lines): + result = [] + previous_indent = -1 + for indent, line in indent_lines: + if indent != previous_indent: + paragraph = (indent, []) + result.append(paragraph) + else: + paragraph = result[-1] + paragraph[1].append(line) + previous_indent = indent + return result + +def split_separated_lines(indent_paragraphs): + result = [] + for indent, paragraph in indent_paragraphs: + result.append((indent, [])) + + if len(paragraph) > 0: + result[-1][1].append(paragraph[0]) + + if len(paragraph) > 2: + for line in paragraph[1: -1]: + result[-1][1].append(line) + if len(line) == 0: + result.append((indent, [])) + + if len(paragraph) > 1: + result[-1][1].append(paragraph[-1]) + + return result + +def remove_empty_paragraphs(indent_paragraphs): + return [(indent, paragraph) for indent, paragraph in indent_paragraphs if len(paragraph)] + +def first_paragraph_indent(indent_texts): + '''Fix the indentation on the first paragraph. + + This occurs because the first line of a multi-line docstring following the + opening quote usually has no indent. + + Args: + indent_texts: The lines of the docstring as an iterable over 2-tuples + each containing an integer indent level as the first element and + the text as the second element. + + Return: + A list of 2-tuples, each containing an integer indent level as the + first element and the text as the second element. + ''' + opening_indent = determine_opening_indent(indent_texts) + + result = [] + input = iter(indent_texts) + for indent, text in input: + if indent == 0: + result.append((opening_indent, text)) + else: + result.append((indent, text)) + break + + for indent, text in input: + result.append((indent, text)) + + return result + + +def determine_opening_indent(indent_texts): + '''Determine the opening indent level for a docstring. + + The opening indent level is the indent level is the first non-zero indent + level of a non-empty line in the docstring. + + Args: + indent_texts: The lines of the docstring as an iterable over 2-tuples + each containing an integer indent level as the first element and + the text as the second element. + + Returns: + The opening indent level as an integer. + ''' + num_lines = len(indent_texts) + + if num_lines < 1: + return 0 + + assert num_lines >= 1 + + first_line_indent = indent_texts[0][0] + + if num_lines == 1: + return first_line_indent + + assert num_lines >= 2 + + second_line_indent = indent_texts[1][0] + second_line_text = indent_texts[1][1] + + if len(second_line_text) == 0: + return first_line_indent + + return second_line_indent + + + +def rewrite_autodoc(app, what, name, obj, options, lines): + '''Convert lines from Hieroglyph to Sphinx format. + + The function to be called by the Sphinx autodoc extension when autodoc + has read and processed a docstring. This function modified its + ``lines`` argument *in place* replacing Hieroglyph syntax input into + Sphinx reStructuredText output. + + Args: + apps: The Sphinx application object. + + what: The type of object which the docstring belongs to. One of + 'module', 'class', 'exception', 'function', 'method', 'attribute' + + name: The fully qualified name of the object. + + obj: The object itself. + + options: The options given to the directive. An object with attributes + ``inherited_members``, ``undoc_members``, ``show_inheritance`` and + ``noindex`` that are ``True`` if the flag option of the same name + was given to the auto directive. + + lines: The lines of the docstring. Will be modified *in place*. + ''' + lines[:] = parse_hieroglyph_text(lines) + + +def setup(app): + app.connect('autodoc-process-docstring', rewrite_autodoc) + + diff --git a/docs/sphinx/hieroglyph/nodes.py b/docs/sphinx/hieroglyph/nodes.py new file mode 100644 index 000000000..e583ce04d --- /dev/null +++ b/docs/sphinx/hieroglyph/nodes.py @@ -0,0 +1,267 @@ +__author__ = 'Robert Smallshire'
+
+class Node(object):
+
+ def __init__(self, indent=None, lines=None, parent=None):
+ if indent is not None:
+ self.indent = indent
+ else:
+ self.indent = 0
+
+ if lines is not None:
+ self.lines = lines
+ else:
+ self.lines = []
+
+ self._parent = parent
+
+ self.children = []
+
+ parent = property(lambda self: self._parent)
+
+ def add_child(self, child):
+ assert(child.parent is self)
+ self.children.append(child)
+
+
+ def __repr__(self):
+ return "Node(" + repr(self.indent) + ", " + repr(self.lines) + ", children=" + repr(self.children) + ")"
+
+
+ def render_rst(self, *args, **kwargs):
+ result = []
+ prefix = ' ' * self.indent
+ result.extend(prefix + line for line in self.lines)
+ for child in self.children:
+ result.extend(child.render_rst())
+ return result
+
+
+
+class Arg(Node):
+
+ def __init__(self, indent, child_indent, name):
+ super(Arg, self).__init__(indent)
+ self.child_indent = child_indent
+ self.name = name
+ self.type = None
+
+
+ def __repr__(self):
+ return "Arg(" + repr(self.name) + ", " + repr(self.type) + ", children=" + repr(self.children) + ")"
+
+
+ def render_rst(self, *args, **kwargs):
+ result = []
+ indent = ' ' * self.indent
+
+ # Render the param description
+ description = []
+ for child in self.children:
+ child_lines = child.render_rst()
+ description.extend(child_lines)
+
+ dedent = self.child_indent - self.indent
+
+ name = self.name.replace('*', r'\*')
+
+ first_description = description[0].lstrip() if len(description) else ''
+ if not first_description:
+ # TODO: Emit a warning about a missing argument description
+ pass
+
+ result.append("{indent}:param {name}: {first_description}".format(indent=indent, name=name,
+ first_description=first_description))
+
+ dedented_body = [line[dedent:] for line in description[1:]]
+
+ result.extend(dedented_body)
+
+ # If a type was specified render the type
+ if self.type is not None:
+ result.append("{indent}:type {name}: {type}".format(indent=indent, name=self.name, type=self.type))
+ result.append('')
+
+ ensure_terminal_blank(result)
+
+ return result
+
+
+
+class Raises(Node):
+
+ def __init__(self, indent=None):
+ super(Raises, self).__init__(indent=indent)
+
+ def __repr__(self):
+ return "Raises(" + repr(self.indent) + ", children=" + repr(self.children) + ")"
+
+
+ def render_rst(self, *args, **kwargs):
+ result = []
+ indent = ' ' * self.indent
+ result.append(indent + ':raises:')
+ for child in self.children:
+ result.extend(child.render_rst(only_child=len(self.children) == 1))
+
+ ensure_terminal_blank(result)
+
+ return result
+
+
+class Except(Node):
+
+ def __init__(self, indent, type):
+ super(Except, self).__init__(indent=indent)
+ #self.child_indent = child_indent
+ self.type = type
+
+
+ def __repr__(self):
+ return "Except(" + repr(self.type) + ", children=" + repr(self.children) + ")"
+
+
+ def render_rst(self, only_child=False, *args, **kwargs):
+ result = []
+ indent = ' ' * self.indent
+
+ # Render the param description
+ description = []
+ for child in self.children:
+ child_lines = child.render_rst()
+ description.extend(child_lines)
+
+ #dedent = self.child_indent - self.indent
+ bullet = '* ' if not only_child else ''
+
+ first_description = description[0].lstrip() if len(description) else ''
+ result.append("{indent}{bullet}{type} - {first_description}".format(indent=indent,
+ bullet=bullet, type=self.type,
+ first_description=first_description))
+
+ #dedented_body = [' ' * len(bullet) + line[dedent:] for line in description[1:]]
+ #result.extend(dedented_body)
+ result.extend(description[1:])
+ ensure_terminal_blank(result)
+
+ return result
+
+
+
+class Returns(Node):
+
+ def __init__(self, indent):
+ super(Returns, self).__init__(indent=indent)
+ self.title = 'Returns'
+ self.line = ''
+
+
+ def __repr__(self):
+ return "Returns(" + str(self.indent) + ", children=" + str(self.children) + ")"
+
+
+ def render_rst(self, *args, **kwargs):
+ result = []
+ indent = ' ' * self.indent
+
+ # Render the param description
+ description = [self.line] if self.line else []
+ for child in self.children:
+ child_lines = child.render_rst()
+ description.extend(child_lines)
+
+ self.render_title(description, indent, result)
+
+ result.extend(description[1:])
+
+ ensure_terminal_blank(result)
+ return result
+
+
+ def render_title(self, description, indent, result):
+ result.append(
+ "{indent}:returns: {first_description}".format(indent=indent,
+ first_description=description[0].lstrip()))
+
+
+
+class Warning(Node):
+
+ def __init__(self, indent):
+ super(Warning, self).__init__(indent=indent)
+
+ def __repr__(self):
+ return "Warning(" + repr(self.indent) + ", children=" + str(self.children) + ")"
+
+ def render_rst(self, *args, **kwargs):
+ # TODO: Factor out the commonality between this and Note below
+ result = []
+ indent = ' ' * self.indent
+
+ # Render the param description
+ description = [self.line] if self.line else []
+ for child in self.children:
+ child_lines = child.render_rst()
+ description.extend(child_lines)
+
+ # Fix the indent on the first line
+ if len(description) > 1 and len(description[1].strip()) != 0:
+ body_indent = len(description[1]) - len(description[1].strip())
+ else:
+ body_indent = self.indent + 4
+
+ if len(description) > 0:
+ description[0] = ' ' * body_indent + description[0]
+
+ result.append(indent + ".. warning::")
+ result.append(indent + '')
+ result.extend(description)
+
+ ensure_terminal_blank(result)
+ return result
+
+
+class Note(Node):
+
+ def __init__(self, indent):
+ super(Note, self).__init__(indent=indent)
+ self.line = ''
+
+
+ def __repr__(self):
+ return "Note(" + repr(self.indent) + ", children=" + str(self.children) + ")"
+
+
+ def render_rst(self, *args, **kwargs):
+ # TODO: Factor out the commonality between this and Warning above
+ result = []
+ indent = ' ' * self.indent
+
+ # Render the param description
+ description = [self.line] if self.line else []
+ for child in self.children:
+ child_lines = child.render_rst()
+ description.extend(child_lines)
+
+ # Fix the indent on the first line
+ if len(description) > 1 and len(description[1].strip()) != 0:
+ body_indent = len(description[1]) - len(description[1].strip())
+ else:
+ body_indent = self.indent + 4
+
+ if len(description) > 0:
+ description[0] = ' ' * body_indent + description[0]
+
+ result.append(indent + ".. note::")
+ result.append(indent + '')
+ result.extend(description)
+
+ ensure_terminal_blank(result)
+ return result
+
+
+def ensure_terminal_blank(result):
+ '''If the description didn't end with a blank line add one here.'''
+ if len(result) > 0:
+ if len(result[-1].strip()) != 0:
+ result.append('')
diff --git a/docs/sphinx/hieroglyph/test/__init__.py b/docs/sphinx/hieroglyph/test/__init__.py new file mode 100644 index 000000000..fd249423f --- /dev/null +++ b/docs/sphinx/hieroglyph/test/__init__.py @@ -0,0 +1,2 @@ +__author__ = 'rjs' +
\ No newline at end of file diff --git a/docs/sphinx/hieroglyph/test/test_comments.py b/docs/sphinx/hieroglyph/test/test_comments.py new file mode 100644 index 000000000..d1a1453ee --- /dev/null +++ b/docs/sphinx/hieroglyph/test/test_comments.py @@ -0,0 +1,586 @@ +import unittest + +from hieroglyph.hieroglyph import parse_hieroglyph_text +from hieroglyph.errors import HieroglyphError + +class CommentTests(unittest.TestCase): + + def test_comment1(self): + source = """Fetches rows from a Bigtable. + This is a continuation of the opening paragraph. + + Retrieves rows pertaining to the given keys from the Table instance + represented by big_table. Silly things may happen if + other_silly_variable is not None. + + Args: + big_table: An open Bigtable Table instance. + keys: A sequence of strings representing the key of each table row + to fetch. + other_silly_variable (str): Another optional variable, that has a much + longer name than the other args, and which does nothing. + + Returns: + A dict mapping keys to the corresponding table row data + fetched. Each row is represented as a tuple of strings. For + example: + + {'Serak': ('Rigel VII', 'Preparer'), + 'Zim': ('Irk', 'Invader'), + 'Lrrr': ('Omicron Persei 8', 'Emperor')} + + If a key from the keys argument is missing from the dictionary, + then that row was not found in the table. + + Raises: + IOError: An error occurred accessing the bigtable.Table object. + """ + + expected = """ Fetches rows from a Bigtable. + This is a continuation of the opening paragraph. + + Retrieves rows pertaining to the given keys from the Table instance + represented by big_table. Silly things may happen if + other_silly_variable is not None. + + :param big_table: An open Bigtable Table instance. + + :param keys: A sequence of strings representing the key of each table row + to fetch. + + :param other_silly_variable: Another optional variable, that has a much + longer name than the other args, and which does nothing. + + :type other_silly_variable: str + + :returns: A dict mapping keys to the corresponding table row data + fetched. Each row is represented as a tuple of strings. For + example: + + {'Serak': ('Rigel VII', 'Preparer'), + 'Zim': ('Irk', 'Invader'), + 'Lrrr': ('Omicron Persei 8', 'Emperor')} + + If a key from the keys argument is missing from the dictionary, + then that row was not found in the table. + + :raises: + IOError - An error occurred accessing the bigtable.Table object. + """ + source_lines = source.splitlines() + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment2(self): + source = """Determine if all elements in the source sequence satisfy a condition. + + All of the source sequence will be consumed. + + Note: This method uses immediate execution. + + Args: + predicate: An optional single argument function used to test each + elements. If omitted, the bool() function is used resulting in + the elements being tested directly. + + Returns: + True if all elements in the sequence meet the predicate condition, + otherwise False. + + Raises: + ValueError: If the Queryable is closed() + TypeError: If predicate is not callable. + """ + + expected = """Determine if all elements in the source sequence satisfy a condition. + + All of the source sequence will be consumed. + + .. note:: + + This method uses immediate execution. + + :param predicate: An optional single argument function used to test each + elements. If omitted, the bool() function is used resulting in + the elements being tested directly. + + :returns: True if all elements in the sequence meet the predicate condition, + otherwise False. + + :raises: + * ValueError - If the Queryable is closed() + + * TypeError - If predicate is not callable. + """ + source_lines = source.splitlines() + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment3(self): + source = """Determine if all elements in the source sequence satisfy a condition. + + All of the source sequence will be consumed. + + Note: This method uses immediate execution. + + Args: + predicate: An optional single argument function used to test each + elements. If omitted, the bool() function is used resulting in + the elements being tested directly. + + Returns: + True if all elements in the sequence meet the predicate condition, + otherwise False. + + Raises: + ValueError: If the Queryable is closed() + TypeError: If predicate is not callable. + """ + + expected = """Determine if all elements in the source sequence satisfy a condition. + + All of the source sequence will be consumed. + + .. note:: + + This method uses immediate execution. + + :param predicate: An optional single argument function used to test each + elements. If omitted, the bool() function is used resulting in + the elements being tested directly. + + :returns: True if all elements in the sequence meet the predicate condition, + otherwise False. + + :raises: + * ValueError - If the Queryable is closed() + + * TypeError - If predicate is not callable. + """ + source_lines = source.splitlines() + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment4(self): + source_lines = [u'Determine if all elements in the source sequence satisfy a condition.', + u'', + u'All of the source sequence will be consumed.', + u'', + u'Note: This method uses immediate execution.', + u'', + u'Args:', + u' predicate: An optional single argument function used to test each', + u' elements. If omitted, the bool() function is used resulting in', + u' the elements being tested directly.', + u'', + u'Returns:', + u' True if all elements in the sequence meet the predicate condition,', + u' otherwise False.', + u'', + u'Raises:', + u' ValueError: If the Queryable is closed()', + u' TypeError: If predicate is not callable.', + u''] + + expected = """Determine if all elements in the source sequence satisfy a condition. + +All of the source sequence will be consumed. + +.. note:: + + This method uses immediate execution. + +:param predicate: An optional single argument function used to test each + elements. If omitted, the bool() function is used resulting in + the elements being tested directly. + +:returns: True if all elements in the sequence meet the predicate condition, + otherwise False. + +:raises: + * ValueError - If the Queryable is closed() + + * TypeError - If predicate is not callable. + +""" + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment5(self): + source_lines = [u'An empty Queryable.', + u'', + u'Note: The same empty instance will be returned each time.', + u'', + u'Returns: A Queryable over an empty sequence.', + u''] + + expected = """An empty Queryable. + +.. note:: + + The same empty instance will be returned each time. + +:returns: A Queryable over an empty sequence. + +""" + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment6(self): + source_lines = [u'A convenience factory for creating Records.', + u'', + u'Args:', + u' **kwargs: Each keyword argument will be used to initialise an', + u' attribute with the same name as the argument and the given', + u' value.', + u'', + u'Returns:', + u' A Record which has a named attribute for each of the keyword arguments.', + u''] + + expected = """A convenience factory for creating Records. + +:param \*\*kwargs: Each keyword argument will be used to initialise an + attribute with the same name as the argument and the given + value. + +:returns: A Record which has a named attribute for each of the keyword arguments. + +""" + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment7(self): + source = """Projects each element of a sequence to an intermediate new sequence, + flattens the resulting sequences into one sequence and optionally + transforms the flattened sequence using a selector function. + + Note: This method uses deferred execution. + + Args: + collection_selector: A unary function mapping each element of the + source iterable into an intermediate sequence. The single + argument of the collection_selector is the value of an element + from the source sequence. The return value should be an + iterable derived from that element value. The default + collection_selector, which is the identity function, assumes + that each element of the source sequence is itself iterable. + + result_selector: An optional unary function mapping the elements in + the flattened intermediate sequence to corresponding elements + of the result sequence. The single argument of the + result_selector is the value of an element from the flattened + intermediate sequence. The return value should be the + corresponding value in the result sequence. The default + result_selector is the identity function. + + Returns: + A Queryable over a generated sequence whose elements are the result + of applying the one-to-many collection_selector to each element of + the source sequence, concatenating the results into an intermediate + sequence, and then mapping each of those elements through the + result_selector into the result sequence. + + Raises: + ValueError: If this Queryable has been closed. + TypeError: If either collection_selector or result_selector are not + callable. + """ + + expected = """ Projects each element of a sequence to an intermediate new sequence, + flattens the resulting sequences into one sequence and optionally + transforms the flattened sequence using a selector function. + + .. note:: + + This method uses deferred execution. + + :param collection_selector: A unary function mapping each element of the + source iterable into an intermediate sequence. The single + argument of the collection_selector is the value of an element + from the source sequence. The return value should be an + iterable derived from that element value. The default + collection_selector, which is the identity function, assumes + that each element of the source sequence is itself iterable. + + :param result_selector: An optional unary function mapping the elements in + the flattened intermediate sequence to corresponding elements + of the result sequence. The single argument of the + result_selector is the value of an element from the flattened + intermediate sequence. The return value should be the + corresponding value in the result sequence. The default + result_selector is the identity function. + + :returns: A Queryable over a generated sequence whose elements are the result + of applying the one-to-many collection_selector to each element of + the source sequence, concatenating the results into an intermediate + sequence, and then mapping each of those elements through the + result_selector into the result sequence. + + :raises: + * ValueError - If this Queryable has been closed. + + * TypeError - If either collection_selector or result_selector are not + callable. + """ + source_lines = source.splitlines() + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment8(self): + source = """A convenience factory for creating Records. + + Args: + **kwargs: Each keyword argument will be used to initialise an + attribute with the same name as the argument and the given + value. + + Returns: + A Record which has a named attribute for each of the keyword arguments. + """ + + expected = """A convenience factory for creating Records. + + :param \*\*kwargs: Each keyword argument will be used to initialise an + attribute with the same name as the argument and the given + value. + + :returns: A Record which has a named attribute for each of the keyword arguments. + +""" + source_lines = source.splitlines() + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment9(self): + source_lines = [u'Parse a single line of a tree to determine depth and node.', + u'', + u'Args:', + u' This line is missing an argument name.', + u' ', + u'Returns:', + u' A 2-tuple containing the tree 0 based tree depth as the first', + u' element and the node description as the second element.', + u'', + u'Raises:', + u' ValueError: If line does not have the expected form.', + u''] + + self.assertRaises(HieroglyphError, lambda: parse_hieroglyph_text(source_lines)) + + def test_comment10(self): + source = """ + Execute the command described by concatenating the string function arguments + with the p4 -s global scripting flag and return the results in a dictionary. + + For example, to run the command:: + + p4 -s fstat -T depotFile foo.h + + call:: + + p4('fstat', '-T', 'depotFile', 'foo.h') + + Args: + args: The arguments to the p4 command as a list of objects which will + be converted to strings. + + Returns: + A dictionary of lists where each key in the dictionary is the field name + from the command output, and each value is a list of output lines in + order. + + Raises: + PerforceError: If the command could not be run or if the command + reported an error. + """ + + expected = """ + Execute the command described by concatenating the string function arguments + with the p4 -s global scripting flag and return the results in a dictionary. + + For example, to run the command:: + + p4 -s fstat -T depotFile foo.h + + call:: + + p4('fstat', '-T', 'depotFile', 'foo.h') + + :param args: The arguments to the p4 command as a list of objects which will + be converted to strings. + + :returns: A dictionary of lists where each key in the dictionary is the field name + from the command output, and each value is a list of output lines in + order. + + :raises: + PerforceError - If the command could not be run or if the command + reported an error. + +""" + + source_lines = source.splitlines() + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment11(self): + source = """Projects each element of a sequence to an intermediate new sequence, + flattens the resulting sequences into one sequence and optionally + transforms the flattened sequence using a selector function. + + Warning: This method may explode at short notice. + + Args: + collection_selector: A unary function mapping each element of the + source iterable into an intermediate sequence. The single + argument of the collection_selector is the value of an element + from the source sequence. The return value should be an + iterable derived from that element value. The default + collection_selector, which is the identity function, assumes + that each element of the source sequence is itself iterable. + + result_selector: An optional unary function mapping the elements in + the flattened intermediate sequence to corresponding elements + of the result sequence. The single argument of the + result_selector is the value of an element from the flattened + intermediate sequence. The return value should be the + corresponding value in the result sequence. The default + result_selector is the identity function. + + Returns: + A Queryable over a generated sequence whose elements are the result + of applying the one-to-many collection_selector to each element of + the source sequence, concatenating the results into an intermediate + sequence, and then mapping each of those elements through the + result_selector into the result sequence. + + Raises: + ValueError: If this Queryable has been closed. + TypeError: If either collection_selector or result_selector are not + callable. + """ + + expected = """ Projects each element of a sequence to an intermediate new sequence, + flattens the resulting sequences into one sequence and optionally + transforms the flattened sequence using a selector function. + + .. warning:: + + This method may explode at short notice. + + :param collection_selector: A unary function mapping each element of the + source iterable into an intermediate sequence. The single + argument of the collection_selector is the value of an element + from the source sequence. The return value should be an + iterable derived from that element value. The default + collection_selector, which is the identity function, assumes + that each element of the source sequence is itself iterable. + + :param result_selector: An optional unary function mapping the elements in + the flattened intermediate sequence to corresponding elements + of the result sequence. The single argument of the + result_selector is the value of an element from the flattened + intermediate sequence. The return value should be the + corresponding value in the result sequence. The default + result_selector is the identity function. + + :returns: A Queryable over a generated sequence whose elements are the result + of applying the one-to-many collection_selector to each element of + the source sequence, concatenating the results into an intermediate + sequence, and then mapping each of those elements through the + result_selector into the result sequence. + + :raises: + * ValueError - If this Queryable has been closed. + + * TypeError - If either collection_selector or result_selector are not + callable. + """ + source_lines = source.splitlines() + actual_lines = parse_hieroglyph_text(source_lines) + expected_lines = expected.splitlines() + self.assertEqual(len(actual_lines), len(expected_lines)) + for actual_line, result_line in zip(actual_lines, expected_lines): + if len(actual_line.strip()) == 0: + self.assertTrue(len(result_line.strip()) == 0) + else: + self.assertEqual(actual_line, result_line) + + def test_comment12(self): + source = """Determine if all elements in the source sequence satisfy a condition. + + All of the source sequence will be consumed. + + Note: This method uses immediate execution. + + Args: + predicate: An optional single argument function used to test each + elements. If omitted, the bool() function is used resulting in + the elements being tested directly. + + Returns: + True if all elements in the sequence meet the predicate condition, + otherwise False. + + Raises: + This is not a proper exception description + """ + + source_lines = source.splitlines() + self.assertRaises(HieroglyphError, lambda: parse_hieroglyph_text(source_lines)) + diff --git a/docs/sphinx/hieroglyph/test/test_hierglyph.py b/docs/sphinx/hieroglyph/test/test_hierglyph.py new file mode 100644 index 000000000..42947cb0c --- /dev/null +++ b/docs/sphinx/hieroglyph/test/test_hierglyph.py @@ -0,0 +1,264 @@ +import unittest
+from hieroglyph.hieroglyph import first_paragraph_indent, gather_lines, unindent
+
+__author__ = 'Robert Smallshire'
+
+class UnindentTests(unittest.TestCase):
+
+ def test_zero_lines(self):
+ source = []
+ expected = []
+ actual = unindent(source)
+ self.assertEqual(actual, expected)
+
+ def test_one_zero_indent_line(self):
+ source = ["First line"]
+ expected = [(0, "First line")]
+ actual = unindent(source)
+ self.assertEqual(actual, expected)
+
+ def test_two_zero_indent_lines(self):
+ source = ["First line",
+ "Second line"]
+ expected = [(0, "First line"),
+ (0, "Second line")]
+ actual = unindent(source)
+ self.assertEqual(actual, expected)
+
+ def test_two_indented_lines(self):
+ source = [" First line",
+ " Second line"]
+ expected = [(4, "First line"),
+ (6, "Second line")]
+ actual = unindent(source)
+ self.assertEqual(actual, expected)
+
+ def test_whitespace_line(self):
+ source = [" "]
+ expected = [(4, "")]
+ actual = unindent(source)
+ self.assertEqual(actual, expected)
+
+ def test_tab_line(self):
+ source = ["\tHello"]
+ expected = [(1, "Hello")]
+ actual = unindent(source)
+ self.assertEqual(actual, expected)
+
+
+class FirstParagraphIndentTests(unittest.TestCase):
+
+ def test_zero_lines(self):
+ source = []
+ expected = []
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_single_line_non_indented_comment(self):
+ source = [(0, "A single line comment")]
+ expected = [(0, "A single line comment")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_single_line_indented_comment(self):
+ source = [(4, "A single line comment")]
+ expected = [(4, "A single line comment")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_double_line_non_indented_comment(self):
+ source = [(0, "The first line"),
+ (0, "The second line")]
+ expected = [(0, "The first line"),
+ (0, "The second line")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_double_line_indented_comment(self):
+ source = [(4, "The first line"),
+ (4, "The second line")]
+ expected = [(4, "The first line"),
+ (4, "The second line")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_first_line_indent(self):
+ source = [(4, "The first line"),
+ (0, "The second line")]
+ expected = [(4, "The first line"),
+ (0, "The second line")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_first_line_non_indent(self):
+ source = [(0, "The first line"),
+ (4, "The second line")]
+ expected = [(4, "The first line"),
+ (4, "The second line")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_increasing_indent(self):
+ source = [(0, "The first line"),
+ (4, "The second line"),
+ (8, "The third line")]
+ expected = [(4, "The first line"),
+ (4, "The second line"),
+ (8, "The third line")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_separate_paragraphs(self):
+ source = [(0, "This is the first paragraph"),
+ (0, ""),
+ (4, "This is the second paragraph")]
+ expected = [(0, "This is the first paragraph"),
+ (0, ""),
+ (4, "This is the second paragraph")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_separate_paragraphs_indented(self):
+ source = [(4, "This is the first paragraph"),
+ (4, ""),
+ (8, "This is the second paragraph")]
+ expected = [(4, "This is the first paragraph"),
+ (4, ""),
+ (8, "This is the second paragraph")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_separated_lines_first_line_non_indented(self):
+ source = [(0, "The first line"),
+ (0, ""),
+ (4, "The third line")]
+ expected = [(0, "The first line"),
+ (0, ""),
+ (4, "The third line")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+ def test_separated_lines_first_line_indented(self):
+ source = [(4, "The first line"),
+ (4, ""),
+ (4, "The third line")]
+ expected = [(4, "The first line"),
+ (4, ""),
+ (4, "The third line")]
+ actual = first_paragraph_indent(source)
+ self.assertEqual(actual, expected)
+
+class GatherLinesTests(unittest.TestCase):
+
+ def test_empty(self):
+ source = []
+ expected = []
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+ def test_one_liner(self):
+ source = [(0, 'One liner')]
+ expected = [(0, ['One liner'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+ def test_two_liner(self):
+ source = [(0, 'First line'),
+ (0, 'Second line')]
+ expected = [(0, ['First line',
+ 'Second line'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+ def test_separated_lines(self):
+ source = [(0, 'First line'),
+ (0, ''),
+ (0, 'Third line')]
+ expected = [(0, ['First line',
+ '']),
+ (0, ['Third line'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+ def test_separated_multi_lines(self):
+ source = [(0, 'First line'),
+ (0, 'Second line'),
+ (0, ''),
+ (0, 'Fourth line'),
+ (0, 'Fifth line')]
+ expected = [(0, ['First line',
+ 'Second line',
+ '']),
+ (0, ['Fourth line',
+ 'Fifth line'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+
+ def test_indented_lines(self):
+ source = [(0, 'First line'),
+ (4, 'Second line')]
+ expected = [(0, ['First line']),
+ (4, ['Second line'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+ def test_dedented_lines(self):
+ source = [(4, 'First line'),
+ (0, 'Second line')]
+ expected = [(4, ['First line']),
+ (0, ['Second line'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+ def test_indented_multi_lines(self):
+ source = [(0, 'First line'),
+ (0, 'Second line'),
+ (4, 'Third line'),
+ (4, 'Fourth line')]
+ expected = [(0, ['First line',
+ 'Second line']),
+ (4, ['Third line',
+ 'Fourth line'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+ def test_dedented_multi_lines(self):
+ source = [(4, 'First line'),
+ (4, 'Second line'),
+ (0, 'Third line'),
+ (0, 'Fourth line')]
+ expected = [(4, ['First line',
+ 'Second line']),
+ (0, ['Third line',
+ 'Fourth line'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+ def test_indented_separated_multi_lines(self):
+ source = [(0, 'First line'),
+ (0, 'Second line'),
+ (0, ''),
+ (4, 'Fourth line'),
+ (4, 'Fifth line')]
+ expected = [(0, ['First line',
+ 'Second line',
+ '']),
+ (4, ['Fourth line',
+ 'Fifth line'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
+
+ def test_dedented_separated_multi_lines(self):
+ source = [(4, 'First line'),
+ (4, 'Second line'),
+ (4, ''),
+ (0, 'Fourth line'),
+ (0, 'Fifth line')]
+ expected = [(4, ['First line',
+ 'Second line',
+ '']),
+ (0, ['Fourth line',
+ 'Fifth line'])]
+ actual = gather_lines(source)
+ self.assertEqual(actual, expected)
diff --git a/docs/sphinx/hieroglyph/test/test_nodes.py b/docs/sphinx/hieroglyph/test/test_nodes.py new file mode 100644 index 000000000..4cc17b477 --- /dev/null +++ b/docs/sphinx/hieroglyph/test/test_nodes.py @@ -0,0 +1,386 @@ +import unittest
+from hieroglyph.nodes import Node, Arg, Raises, Except, Returns, Warning, Note
+
+__author__ = 'Robert Smallshire'
+
+class NodeTests(unittest.TestCase):
+
+ def test_create_default_node(self):
+ node = Node()
+ self.assertEqual(node.indent, 0)
+ self.assertEqual(node.lines, [])
+ self.assertIsNone(node.parent)
+
+ def test_create_with_indent(self):
+ node = Node(indent=4)
+ self.assertEqual(node.indent, 4)
+ self.assertEqual(node.lines, [])
+ self.assertIsNone(node.parent)
+
+ def test_create_with_lines(self):
+ node = Node(lines= ['First', 'Second', 'Third'])
+ self.assertEqual(node.indent, 0)
+ self.assertEqual(node.lines, ['First', 'Second', 'Third'])
+ self.assertIsNone(node.parent)
+
+ def test_repr(self):
+ node = Node(5, ['One', 'Two', 'Three'])
+ actual = repr(node)
+ expected = "Node(5, ['One', 'Two', 'Three'], children=[])"
+ self.assertEqual(expected, actual)
+
+ def test_add_one_child(self):
+ node = Node()
+ child = Node(parent=node)
+ node.add_child(child)
+ self.assertIs(node.children[0], child)
+
+ def test_add_two_children(self):
+ node = Node()
+ child0 = Node(parent=node)
+ child1 = Node(parent=node)
+ node.add_child(child0)
+ node.add_child(child1)
+ self.assertIs(node.children[0], child0)
+ self.assertIs(node.children[1], child1)
+
+ def test_render_rst_empty(self):
+ node = Node()
+ rst = node.render_rst()
+ self.assertEqual(len(rst), 0)
+
+ def test_render_rst_indent(self):
+ node = Node(indent=4)
+ rst = node.render_rst()
+ self.assertEqual(len(rst), 0)
+
+ def test_render_rst_lines(self):
+ node = Node(lines= ['First',
+ 'Second',
+ 'Third'])
+ rst = node.render_rst()
+ self.assertEqual(rst, ['First',
+ 'Second',
+ 'Third'])
+
+ def test_render_rst_indented_lines(self):
+ node = Node(indent=3, lines= ['First',
+ 'Second',
+ 'Third'])
+ rst = node.render_rst()
+ self.assertEqual(rst, [' First',
+ ' Second',
+ ' Third'])
+
+ def test_render_rst_with_child(self):
+ node = Node(indent=4, lines=["Parent"])
+ child = Node(indent=8, lines=["Child"], parent=node)
+ node.add_child(child)
+ rst = node.render_rst()
+ self.assertEqual(rst, [' Parent',
+ ' Child'])
+
+ def test_render_rst_with_children(self):
+ node = Node(indent=4, lines=["Parent"])
+ child_a = Node(indent=8, lines=["ChildA"], parent=node)
+ node.add_child(child_a)
+ child_b = Node(indent=6, lines=["ChildB"], parent=node)
+ node.add_child(child_b)
+ rst = node.render_rst()
+ self.assertEqual(rst, [' Parent',
+ ' ChildA',
+ ' ChildB'])
+
+
+class ArgTests(unittest.TestCase):
+
+ def test_create(self):
+ node = Arg(5, 10, 'foo')
+ self.assertEqual(node.indent, 5)
+ self.assertEqual(node.child_indent, 10)
+ self.assertEqual(node.name, 'foo')
+ self.assertEqual(node.lines, [])
+ self.assertIsNone(node.parent)
+
+ def test_set_type(self):
+ node = Arg(5, 10, 'foo')
+ node.type = 'str'
+ self.assertEqual(node.type, 'str')
+
+ def test_add_one_child(self):
+ node = Arg(5, 10, 'foo')
+ child = Node(parent=node)
+ node.add_child(child)
+ self.assertIs(node.children[0], child)
+
+ def test_add_two_children(self):
+ node = Arg(5, 10, 'foo')
+ child0 = Node(parent=node)
+ child1 = Node(parent=node)
+ node.add_child(child0)
+ node.add_child(child1)
+ self.assertIs(node.children[0], child0)
+ self.assertIs(node.children[1], child1)
+
+ def test_repr(self):
+ node = Arg(5, 10, 'foo')
+ actual = repr(node)
+ expected = "Arg('foo', None, children=[])"
+ self.assertEqual(expected, actual)
+
+ def test_render_rst_empty(self):
+ node = Arg(5, 10, 'bar')
+ rst = node.render_rst()
+ self.assertEqual(rst, [' :param bar: ',
+ ''])
+
+ def test_render_rst_with_child(self):
+ node = Arg(5, 10, 'bar')
+ child = Node(indent=10, lines=["Description"], parent=node)
+ node.add_child(child)
+ rst = node.render_rst()
+ self.assertEqual(rst, [' :param bar: Description',
+ ''])
+
+ def test_render_rst_with_children(self):
+ node = Arg(5, 10, 'bar')
+ child_a = Node(indent=10, lines=["ChildA"], parent=node)
+ node.add_child(child_a)
+ child_b = Node(indent=10, lines=["ChildB"], parent=node)
+ node.add_child(child_b)
+ rst = node.render_rst()
+ self.assertEqual(rst, [' :param bar: ChildA',
+ ' ChildB',
+ ''])
+
+ def test_render_rst_with_type(self):
+ node = Arg(5, 10, 'bar')
+ node.type = 'str'
+ rst = node.render_rst()
+ self.assertEqual(rst, [' :param bar: ',
+ ' :type bar: str',
+ ''])
+
+
+class RaisesTests(unittest.TestCase):
+
+ def test_create_default_node(self):
+ node = Raises()
+ self.assertEqual(node.indent, 0)
+ self.assertEqual(node.lines, [])
+ self.assertIsNone(node.parent)
+
+ def test_create_with_indent(self):
+ node = Raises(indent=4)
+ self.assertEqual(node.indent, 4)
+ self.assertEqual(node.lines, [])
+ self.assertIsNone(node.parent)
+
+ def test_repr(self):
+ node = Raises(5)
+ actual = repr(node)
+ expected = "Raises(5, children=[])"
+ self.assertEqual(expected, actual)
+
+ def test_add_one_child(self):
+ node = Raises()
+ child = Node(parent=node)
+ node.add_child(child)
+ self.assertIs(node.children[0], child)
+
+ def test_add_two_children(self):
+ node = Raises()
+ child0 = Node(parent=node)
+ child1 = Node(parent=node)
+ node.add_child(child0)
+ node.add_child(child1)
+ self.assertIs(node.children[0], child0)
+ self.assertIs(node.children[1], child1)
+
+ def test_render_rst_empty(self):
+ node = Raises()
+ rst = node.render_rst()
+ self.assertEqual(rst, [':raises:',
+ ''])
+
+ def test_render_rst_indent(self):
+ node = Raises(indent=5)
+ rst = node.render_rst()
+ self.assertEqual(rst, [' :raises:',
+ ''])
+
+ def test_render_rst_with_child(self):
+ node = Raises(5)
+ child = Node(indent=10, lines=["Description"], parent=node)
+ node.add_child(child)
+ rst = node.render_rst()
+ self.assertEqual(rst, [' :raises:',
+ ' Description',
+ ''])
+
+ def test_render_rst_with_children(self):
+ node = Raises(5)
+ child_a = Node(indent=10, lines=["ChildA"], parent=node)
+ node.add_child(child_a)
+ child_b = Node(indent=10, lines=["ChildB"], parent=node)
+ node.add_child(child_b)
+ rst = node.render_rst()
+ self.assertEqual(rst, [' :raises:',
+ ' ChildA',
+ ' ChildB',
+ ''])
+
+
+class ExceptTests(unittest.TestCase):
+
+ def test_create(self):
+ node = Except(5, 'FooError')
+ self.assertEqual(node.indent, 5)
+ self.assertEqual(node.type, 'FooError')
+ self.assertEqual(node.lines, [])
+ self.assertIsNone(node.parent)
+
+ def test_add_one_child(self):
+ node = Except(5, 'FooError')
+ child = Node(parent=node)
+ node.add_child(child)
+ self.assertIs(node.children[0], child)
+
+ def test_add_two_children(self):
+ node = Except(5, 'FooError')
+ child0 = Node(parent=node)
+ child1 = Node(parent=node)
+ node.add_child(child0)
+ node.add_child(child1)
+ self.assertIs(node.children[0], child0)
+ self.assertIs(node.children[1], child1)
+
+ def test_repr(self):
+ node = Except(5,'FooError')
+ actual = repr(node)
+ expected = "Except('FooError', children=[])"
+ self.assertEqual(expected, actual)
+
+ def test_render_rst_empty(self):
+ node = Except(5, 'FooError')
+ rst = node.render_rst()
+ self.assertEqual(rst, [' * FooError - ',
+ ''])
+
+ def test_render_rst_indent(self):
+ node = Except(5, 'FooError')
+ rst = node.render_rst()
+ self.assertEqual(rst, [' * FooError - ',
+ ''])
+
+ def test_render_rst_with_child(self):
+ node = Except(5, 'FooError')
+ child = Node(indent=10, lines=["Description"], parent=node)
+ node.add_child(child)
+ rst = node.render_rst()
+ self.assertEqual(rst, [' * FooError - Description',
+ ''])
+
+ def test_render_rst_with_children(self):
+ node = Except(5, 'FooError')
+ child_a = Node(indent=10, lines=["ChildA"], parent=node)
+ node.add_child(child_a)
+ child_b = Node(indent=10, lines=["ChildB"], parent=node)
+ node.add_child(child_b)
+ rst = node.render_rst()
+ self.assertEqual(rst, [' * FooError - ChildA',
+ ' ChildB',
+ ''])
+
+class ReturnsTests(unittest.TestCase):
+
+ def test_create(self):
+ node = Returns(5)
+ self.assertEqual(node.indent, 5)
+ self.assertEqual(node.lines, [])
+ self.assertIsNone(node.parent)
+
+ def test_add_one_child(self):
+ node = Returns(5)
+ child = Node(parent=node)
+ node.add_child(child)
+ self.assertIs(node.children[0], child)
+
+ def test_add_two_children(self):
+ node = Returns(5)
+ child0 = Node(parent=node)
+ child1 = Node(parent=node)
+ node.add_child(child0)
+ node.add_child(child1)
+ self.assertIs(node.children[0], child0)
+ self.assertIs(node.children[1], child1)
+
+ def test_repr(self):
+ node = Returns(5)
+ actual = repr(node)
+ expected = "Returns(5, children=[])"
+ self.assertEqual(expected, actual)
+
+ # TODO test_render_rst
+
+class WarningTests(unittest.TestCase):
+
+ def test_create(self):
+ node = Warning(5)
+ self.assertEqual(node.indent, 5)
+ self.assertEqual(node.lines, [])
+ self.assertIsNone(node.parent)
+
+ def test_add_one_child(self):
+ node = Warning(5)
+ child = Node(parent=node)
+ node.add_child(child)
+ self.assertIs(node.children[0], child)
+
+ def test_add_two_children(self):
+ node = Warning(5)
+ child0 = Node(parent=node)
+ child1 = Node(parent=node)
+ node.add_child(child0)
+ node.add_child(child1)
+ self.assertIs(node.children[0], child0)
+ self.assertIs(node.children[1], child1)
+
+ def test_repr(self):
+ node = Warning(5)
+ actual = repr(node)
+ expected = "Warning(5, children=[])"
+ self.assertEqual(expected, actual)
+
+ # TODO test_render_rst
+
+class NoteTests(unittest.TestCase):
+
+ def test_create(self):
+ node = Note(5)
+ self.assertEqual(node.indent, 5)
+ self.assertEqual(node.lines, [])
+ self.assertIsNone(node.parent)
+
+ def test_add_one_child(self):
+ node = Note(5)
+ child = Node(parent=node)
+ node.add_child(child)
+ self.assertIs(node.children[0], child)
+
+ def test_add_two_children(self):
+ node = Note(5)
+ child0 = Node(parent=node)
+ child1 = Node(parent=node)
+ node.add_child(child0)
+ node.add_child(child1)
+ self.assertIs(node.children[0], child0)
+ self.assertIs(node.children[1], child1)
+
+ def test_repr(self):
+ node = Note(5)
+ actual = repr(node)
+ expected = "Note(5, children=[])"
+ self.assertEqual(expected, actual)
+
+ # TODO test_render_rst
diff --git a/docs/sphinx/hieroglyph/version.py b/docs/sphinx/hieroglyph/version.py new file mode 100644 index 000000000..d060125c0 --- /dev/null +++ b/docs/sphinx/hieroglyph/version.py @@ -0,0 +1,3 @@ +'''Specification of the hieroglyph version'''
+
+__version__ = '0.6'
diff --git a/docs/sphinx/run_sphinx_build.sh.in b/docs/sphinx/run_sphinx_build.sh.in new file mode 100644 index 000000000..bc89f2de7 --- /dev/null +++ b/docs/sphinx/run_sphinx_build.sh.in @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Creating Sphinx documentation in: @CMAKE_CURRENT_BINARY_DIR@/sphinx_out" + +LD_LIBRARY_PATH="@CMAKE_INSTALL_PREFIX@/lib" +@SPHINX_EXECUTABLE@ -b html -c @CMAKE_CURRENT_BINARY_DIR@/ @CMAKE_CURRENT_SOURCE_DIR@/source @CMAKE_CURRENT_BINARY_DIR@/sphinx_out + diff --git a/docs/sphinx/source/atsc/blks.rst b/docs/sphinx/source/atsc/blks.rst new file mode 100644 index 000000000..ce26f095b --- /dev/null +++ b/docs/sphinx/source/atsc/blks.rst @@ -0,0 +1,20 @@ +gnuradio.atsc: Signal Processing Blocks +======================================= + +.. autoblock:: gnuradio.atsc.bit_timing_loop +.. autoblock:: gnuradio.atsc.deinterleaver +.. autoblock:: gnuradio.atsc.depad +.. autoblock:: gnuradio.atsc.derandomizer +.. autoblock:: gnuradio.atsc.ds_to_softds +.. autoblock:: gnuradio.atsc.equalizer +.. autoblock:: gnuradio.atsc.field_sync_demux +.. autoblock:: gnuradio.atsc.field_sync_mux +.. autoblock:: gnuradio.atsc.fpll +.. autoblock:: gnuradio.atsc.fs_checker +.. autoblock:: gnuradio.atsc.interleaver +.. autoblock:: gnuradio.atsc.pad +.. autoblock:: gnuradio.atsc.randomizer +.. autoblock:: gnuradio.atsc.rs_decoder +.. autoblock:: gnuradio.atsc.rs_encoder +.. autoblock:: gnuradio.atsc.trellis_encoder +.. autoblock:: gnuradio.atsc.viterbi_decoder diff --git a/docs/sphinx/source/atsc/index.rst b/docs/sphinx/source/atsc/index.rst new file mode 100644 index 000000000..2371f2456 --- /dev/null +++ b/docs/sphinx/source/atsc/index.rst @@ -0,0 +1,62 @@ +gnuradio.atsc +============= + +.. automodule:: gnuradio.atsc + +Signal Processing Blocks +------------------------ + +.. autosummary:: + :nosignatures: + + gnuradio.atsc.bit_timing_loop + gnuradio.atsc.deinterleaver + gnuradio.atsc.depad + gnuradio.atsc.derandomizer + gnuradio.atsc.ds_to_softds + gnuradio.atsc.equalizer + gnuradio.atsc.field_sync_demux + gnuradio.atsc.field_sync_mux + gnuradio.atsc.fpll + gnuradio.atsc.fs_checker + gnuradio.atsc.interleaver + gnuradio.atsc.pad + gnuradio.atsc.randomizer + gnuradio.atsc.rs_decoder + gnuradio.atsc.rs_encoder + gnuradio.atsc.trellis_encoder + gnuradio.atsc.viterbi_decoder + +Constants +--------- + +.. autosummary:: + :nosignatures: + + gnuradio.atsc.ATSC_DATA_SEGMENT_LENGTH + gnuradio.atsc.ATSC_DATA_SEGMENT_RATE + gnuradio.atsc.ATSC_DSEGS_PER_FIELD + gnuradio.atsc.ATSC_MPEG_DATA_LENGTH + gnuradio.atsc.ATSC_MPEG_PKT_LENGTH + gnuradio.atsc.ATSC_MPEG_RS_ENCODED_LENGTH + gnuradio.atsc.ATSC_SYMBOL_RATE + gnuradio.atsc.MPEG_SYNC_BYTE + gnuradio.atsc.MPEG_TRANSPORT_ERROR_BIT + +Sizes +--------- + +.. autosummary:: + :nosignatures: + + gnuradio.atsc.sizeof_atsc_data_segment + gnuradio.atsc.sizeof_atsc_data_segment_pad + gnuradio.atsc.sizeof_atsc_mpeg_packet + gnuradio.atsc.sizeof_atsc_mpeg_packet_no_sync + gnuradio.atsc.sizeof_atsc_mpeg_packet_no_sync_pad + gnuradio.atsc.sizeof_atsc_mpeg_packet_pad + gnuradio.atsc.sizeof_atsc_mpeg_packet_rs_encoded + gnuradio.atsc.sizeof_atsc_mpeg_packet_rs_encoded_pad + gnuradio.atsc.sizeof_atsc_soft_data_segment + gnuradio.atsc.sizeof_atsc_soft_data_segment_pad + diff --git a/docs/sphinx/source/audio/index.rst b/docs/sphinx/source/audio/index.rst new file mode 100644 index 000000000..31d53567b --- /dev/null +++ b/docs/sphinx/source/audio/index.rst @@ -0,0 +1,7 @@ +gnuradio.audio +============== + +.. automodule:: gnuradio.audio + +.. autoblock:: gnuradio.audio.source +.. autoblock:: gnuradio.audio.sink diff --git a/docs/sphinx/source/blks2/blks.rst b/docs/sphinx/source/blks2/blks.rst new file mode 100644 index 000000000..c28c7af0f --- /dev/null +++ b/docs/sphinx/source/blks2/blks.rst @@ -0,0 +1,31 @@ +gnuradio.blks2: Signal Processing Blocks +======================================== + +.. autopyblock:: gnuradio.blks2.am_demod_cf +.. autopyblock:: gnuradio.blks2.ctcss_gen_f +.. autopyblock:: gnuradio.blks2.demod_10k0a3e_cf +.. autopyblock:: gnuradio.blks2.demod_200kf3e_cf +.. autopyblock:: gnuradio.blks2.demod_20k0f3e_cf +.. autopyblock:: gnuradio.blks2.fm_demod_cf +.. autopyblock:: gnuradio.blks2.logpwrfft_c +.. autopyblock:: gnuradio.blks2.logpwrfft_f +.. autopyblock:: gnuradio.blks2.pfb_arb_resampler_ccf +.. autopyblock:: gnuradio.blks2.pfb_arb_resampler_fff +.. autopyblock:: gnuradio.blks2.pfb_channelizer_ccf +.. autopyblock:: gnuradio.blks2.pfb_decimator_ccf +.. autopyblock:: gnuradio.blks2.pfb_interpolator_ccf +.. autopyblock:: gnuradio.blks2.rational_resampler_ccc +.. autopyblock:: gnuradio.blks2.rational_resampler_ccf +.. autopyblock:: gnuradio.blks2.rational_resampler_fff +.. autopyblock:: gnuradio.blks2.analysis_filterbank +.. autopyblock:: gnuradio.blks2.fm_deemph +.. autopyblock:: gnuradio.blks2.fm_preemph +.. autopyblock:: gnuradio.blks2.nbfm_rx +.. autopyblock:: gnuradio.blks2.nbfm_tx +.. autopyblock:: gnuradio.blks2.stream_to_vector_decimator +.. autopyblock:: gnuradio.blks2.standard_squelch +.. autopyblock:: gnuradio.blks2.synthesis_filterbank +.. autopyblock:: gnuradio.blks2.wfm_rcv +.. autopyblock:: gnuradio.blks2.wfm_rcv_fmdet +.. autopyblock:: gnuradio.blks2.wfm_rcv_pll +.. autopyblock:: gnuradio.blks2.wfm_tx diff --git a/docs/sphinx/source/blks2/index.rst b/docs/sphinx/source/blks2/index.rst new file mode 100644 index 000000000..4df8e5a79 --- /dev/null +++ b/docs/sphinx/source/blks2/index.rst @@ -0,0 +1,47 @@ +gnuradio.blks2 +============== + +.. automodule:: gnuradio.blks2 + +Signal Processing Blocks +------------------------ + +.. autosummary:: + :nosignatures: + + gnuradio.blks2.am_demod_cf + gnuradio.blks2.ctcss_gen_f + gnuradio.blks2.demod_10k0a3e_cf + gnuradio.blks2.demod_200kf3e_cf + gnuradio.blks2.demod_20k0f3e_cf + gnuradio.blks2.fm_demod_cf + gnuradio.blks2.logpwrfft_c + gnuradio.blks2.logpwrfft_f + gnuradio.blks2.pfb_arb_resampler_ccf + gnuradio.blks2.pfb_arb_resampler_fff + gnuradio.blks2.pfb_channelizer_ccf + gnuradio.blks2.pfb_decimator_ccf + gnuradio.blks2.pfb_interpolator_ccf + gnuradio.blks2.rational_resampler_ccc + gnuradio.blks2.rational_resampler_ccf + gnuradio.blks2.rational_resampler_fff + gnuradio.blks2.analysis_filterbank + gnuradio.blks2.fm_deemph + gnuradio.blks2.fm_preemph + gnuradio.blks2.nbfm_rx + gnuradio.blks2.nbfm_tx + gnuradio.blks2.stream_to_vector_decimator + gnuradio.blks2.standard_squelch + gnuradio.blks2.synthesis_filterbank + gnuradio.blks2.wfm_rcv + gnuradio.blks2.wfm_rcv_fmdet + gnuradio.blks2.wfm_rcv_pll + gnuradio.blks2.wfm_tx + +Utility Functions +----------------- + +.. autosummary:: + :nosignatures: + + gnuradio.blks2.design_filter diff --git a/docs/sphinx/source/blks2/utilities.rst b/docs/sphinx/source/blks2/utilities.rst new file mode 100644 index 000000000..3ce068fb4 --- /dev/null +++ b/docs/sphinx/source/blks2/utilities.rst @@ -0,0 +1,4 @@ +gnuradio.blks2: Utility Functions +================================= + +.. autoclass:: gnuradio.blks2.design_filter diff --git a/docs/sphinx/source/conf.py.in b/docs/sphinx/source/conf.py.in new file mode 100644 index 000000000..aa7b122cc --- /dev/null +++ b/docs/sphinx/source/conf.py.in @@ -0,0 +1,217 @@ +# -*- coding: utf-8 -*- +# +# GNU Radio documentation build configuration file, created by +# sphinx-quickstart on Sun Oct 16 22:27:51 2011. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath('@CMAKE_CURRENT_SOURCE_DIR@')) +sys.path.insert(0, '@CMAKE_INSTALL_PREFIX@/@GR_PYTHON_DIR@') + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.autosummary', 'sphinx.ext.mathjax', 'gnuradio_sphinx', 'hieroglyph'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'GNU Radio' +copyright = u'2012, Free Software Foundation' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '@VERSION@' +# The full version, including alpha/beta/rc tags. +release = '@VERSION@' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# "<project> v<release> documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a <link> tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'GNURadiodoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'GNURadio.tex', u'GNU Radio Documentation', + u'Free Software Foundation', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'gnuradio', u'GNU Radio Documentation', + [u'Free Software Foundation'], 1) +] diff --git a/docs/sphinx/source/digital/blocks.rst b/docs/sphinx/source/digital/blocks.rst new file mode 100644 index 000000000..2ac228d4e --- /dev/null +++ b/docs/sphinx/source/digital/blocks.rst @@ -0,0 +1,51 @@ +gnuradio.digital: Signal Processing Blocks +========================================== + +.. autoblock:: gnuradio.digital.fll_band_edge_cc +.. autoblock:: gnuradio.digital.kurtotic_equalizer_cc +.. autoblock:: gnuradio.digital.lms_dd_equalizer_cc +.. autoblock:: gnuradio.digital.mpsk_receiver_cc +.. autoblock:: gnuradio.digital.mpsk_snr_est_cc +.. autoblock:: gnuradio.digital.clock_recovery_mm_cc +.. autoblock:: gnuradio.digital.clock_recovery_mm_ff +.. autoblock:: gnuradio.digital.constellation_decoder_cb +.. autoblock:: gnuradio.digital.constellation_receiver_cb +.. autoblock:: gnuradio.digital.correlate_access_code_bb +.. autoblock:: gnuradio.digital.costas_loop_cc +.. autoblock:: gnuradio.digital.cma_equalizer_cc +.. autoblock:: gnuradio.digital.binary_slicer_fb +.. autoblock:: gnuradio.digital.gmskmod_bc +.. autoblock:: gnuradio.digital.probe_mpsk_snr_est_c +.. autoblock:: gnuradio.digital.cpmmod_bc +.. autopyblock:: gnuradio.digital.generic_demod +.. autopyblock:: gnuradio.digital.generic_mod +.. autopyblock:: gnuradio.digital.bpsk.dbpsk_demod +.. autopyblock:: gnuradio.digital.bpsk.dbpsk_mod +.. autopyblock:: gnuradio.digital.qpsk.dqpsk_demod +.. autopyblock:: gnuradio.digital.qpsk.dqpsk_mod +.. autopyblock:: gnuradio.digital.gmsk.gmsk_demod +.. autopyblock:: gnuradio.digital.gmsk.gmsk_mod +.. autopyblock:: gnuradio.digital.bpsk.bpsk_demod +.. autopyblock:: gnuradio.digital.bpsk.bpsk_mod +.. autopyblock:: gnuradio.digital.psk.psk_demod +.. autopyblock:: gnuradio.digital.psk.psk_mod +.. autopyblock:: gnuradio.digital.qam.qam_demod +.. autopyblock:: gnuradio.digital.qam.qam_mod +.. autopyblock:: gnuradio.digital.qpsk.qpsk_demod +.. autopyblock:: gnuradio.digital.qpsk.qpsk_mod +.. autopyblock:: gnuradio.digital.cpm.cpm_mod +.. autopyblock:: gnuradio.digital.pkt.mod_pkts +.. autopyblock:: gnuradio.digital.pkt.demod_pkts +.. autopyblock:: gnuradio.digital.ofdm_cyclic_prefixer +.. autopyblock:: gnuradio.digital.ofdm_frame_acquisition +.. autopyblock:: gnuradio.digital.ofdm_frame_sink +.. autopyblock:: gnuradio.digital.ofdm_insert_preamble +.. autopyblock:: gnuradio.digital.ofdm_mapper_bcv +.. autopyblock:: gnuradio.digital.ofdm_mod +.. autopyblock:: gnuradio.digital.ofdm_demod +.. autopyblock:: gnuradio.digital.ofdm_receiver +.. autopyblock:: gnuradio.digital.ofdm_sampler +.. autopyblock:: gnuradio.digital.ofdm_sync_fixed +.. autopyblock:: gnuradio.digital.ofdm_sync_ml +.. autopyblock:: gnuradio.digital.ofdm_sync_pn +.. autopyblock:: gnuradio.digital.ofdm_sync_pnac diff --git a/docs/sphinx/source/digital/constellations.rst b/docs/sphinx/source/digital/constellations.rst new file mode 100644 index 000000000..3fa02613a --- /dev/null +++ b/docs/sphinx/source/digital/constellations.rst @@ -0,0 +1,13 @@ +gnuradio.digital: Constellations +================================ + +.. autofunction:: gnuradio.digital.constellation_8psk +.. autofunction:: gnuradio.digital.constellation_bpsk +.. autofunction:: gnuradio.digital.constellation_calcdist +.. autofunction:: gnuradio.digital.constellation_dqpsk +.. autofunction:: gnuradio.digital.constellation_psk +.. autofunction:: gnuradio.digital.constellation_qpsk +.. autofunction:: gnuradio.digital.constellation_rect +.. autofunction:: gnuradio.digital.qpsk.qpsk_constellation +.. autofunction:: gnuradio.digital.psk.psk_constellation +.. autofunction:: gnuradio.digital.qam.qam_constellation diff --git a/docs/sphinx/source/digital/index.rst b/docs/sphinx/source/digital/index.rst new file mode 100644 index 000000000..da5227e45 --- /dev/null +++ b/docs/sphinx/source/digital/index.rst @@ -0,0 +1,133 @@ +gnuradio.digital +================ + +.. automodule:: gnuradio.digital + +Signal Processing Blocks +------------------------ + +.. autosummary:: + :nosignatures: + + gnuradio.digital.fll_band_edge_cc + gnuradio.digital.kurtotic_equalizer_cc + gnuradio.digital.lms_dd_equalizer_cc + gnuradio.digital.mpsk_receiver_cc + gnuradio.digital.mpsk_snr_est_cc + gnuradio.digital.clock_recovery_mm_cc + gnuradio.digital.clock_recovery_mm_ff + gnuradio.digital.constellation_decoder_cb + gnuradio.digital.constellation_receiver_cb + gnuradio.digital.correlate_access_code_bb + gnuradio.digital.costas_loop_cc + gnuradio.digital.cma_equalizer_cc + gnuradio.digital.binary_slicer_fb + gnuradio.digital.gmskmod_bc + gnuradio.digital.probe_mpsk_snr_est_c + gnuradio.digital.cpmmod_bc + gnuradio.digital.generic_demod + gnuradio.digital.generic_mod + gnuradio.digital.bpsk.dbpsk_demod + gnuradio.digital.bpsk.dbpsk_mod + gnuradio.digital.qpsk.dqpsk_demod + gnuradio.digital.qpsk.dqpsk_mod + gnuradio.digital.gmsk.gmsk_demod + gnuradio.digital.gmsk.gmsk_mod + gnuradio.digital.bpsk.bpsk_demod + gnuradio.digital.bpsk.bpsk_mod + gnuradio.digital.psk.psk_demod + gnuradio.digital.psk.psk_mod + gnuradio.digital.qam.qam_demod + gnuradio.digital.qam.qam_mod + gnuradio.digital.qpsk.qpsk_demod + gnuradio.digital.qpsk.qpsk_mod + gnuradio.digital.cpm.cpm_mod + gnuradio.digital.pkt.mod_pkts + gnuradio.digital.pkt.demod_pkts + gnuradio.digital.ofdm_cyclic_prefixer + gnuradio.digital.ofdm_frame_acquisition + gnuradio.digital.ofdm_frame_sink + gnuradio.digital.ofdm_insert_preamble + gnuradio.digital.ofdm_mapper_bcv + gnuradio.digital.ofdm_mod + gnuradio.digital.ofdm_demod + gnuradio.digital.ofdm_receiver + gnuradio.digital.ofdm_sampler + gnuradio.digital.ofdm_sync_fixed + gnuradio.digital.ofdm_sync_ml + gnuradio.digital.ofdm_sync_pn + gnuradio.digital.ofdm_sync_pnac + +Constellations +-------------- + +.. autosummary:: + :nosignatures: + + gnuradio.digital.constellation_8psk + gnuradio.digital.constellation_bpsk + gnuradio.digital.constellation_calcdist + gnuradio.digital.constellation_dqpsk + gnuradio.digital.constellation_psk + gnuradio.digital.constellation_qpsk + gnuradio.digital.constellation_qpsk + gnuradio.digital.constellation_rect + gnuradio.digital.qpsk.qpsk_constellation + gnuradio.digital.psk.psk_constellation + gnuradio.digital.qam.qam_constellation + +Modulation Utilties +------------------- + +.. autosummary:: + :nosignatures: + + gnuradio.digital.utils.gray_code.gray_code + gnuradio.digital.utils.mod_codes.GRAY_CODE + gnuradio.digital.utils.mod_codes.NO_CODE + gnuradio.digital.modulation_utils.add_type_1_constellation + gnuradio.digital.modulation_utils.add_type_1_demod + gnuradio.digital.modulation_utils.add_type_1_mod + gnuradio.digital.modulation_utils.type_1_constellations + gnuradio.digital.modulation_utils.type_1_demods + gnuradio.digital.modulation_utils.type_1_mods + +Packet Utilities +---------------- + +.. autosummary:: + :nosignatures: + + gnuradio.digital.packet_utils.conv_1_0_string_to_packed_binary_string + gnuradio.digital.packet_utils.conv_packed_binary_string_to_1_0_string + gnuradio.digital.packet_utils.default_access_code + gnuradio.digital.packet_utils.dewhiten + gnuradio.digital.packet_utils.is_1_0_string + gnuradio.digital.packet_utils.make_header + gnuradio.digital.packet_utils.make_packet + gnuradio.digital.packet_utils.preamble + gnuradio.digital.packet_utils.random_mask_tuple + gnuradio.digital.packet_utils.random_mask_vec8 + gnuradio.digital.packet_utils.string_to_hex_list + gnuradio.digital.packet_utils.unmake_packet + gnuradio.digital.packet_utils.whiten + gnuradio.digital.crc.check_crc32 + gnuradio.digital.crc.gen_and_append_crc32 + +OFDM Packet Utilities +--------------------- + +.. autosummary:: + :nosignatures: + + gnuradio.digital.ofdm_packet_utils.conv_1_0_string_to_packed_binary_string + gnuradio.digital.ofdm_packet_utils.conv_packed_binary_string_to_1_0_string + gnuradio.digital.ofdm_packet_utils.dewhiten + gnuradio.digital.ofdm_packet_utils.is_1_0_string + gnuradio.digital.ofdm_packet_utils.make_header + gnuradio.digital.ofdm_packet_utils.make_packet + gnuradio.digital.ofdm_packet_utils.random_mask_tuple + gnuradio.digital.ofdm_packet_utils.random_mask_vec8 + gnuradio.digital.ofdm_packet_utils.string_to_hex_list + gnuradio.digital.ofdm_packet_utils.unmake_packet + gnuradio.digital.ofdm_packet_utils.whiten diff --git a/docs/sphinx/source/digital/ofdm.rst b/docs/sphinx/source/digital/ofdm.rst new file mode 100644 index 000000000..8680503f2 --- /dev/null +++ b/docs/sphinx/source/digital/ofdm.rst @@ -0,0 +1,14 @@ +gnuradio.digital: OFDM Packet Utilities +======================================= + +.. autofunction:: gnuradio.digital.ofdm_packet_utils.conv_1_0_string_to_packed_binary_string +.. autofunction:: gnuradio.digital.ofdm_packet_utils.conv_packed_binary_string_to_1_0_string +.. autofunction:: gnuradio.digital.ofdm_packet_utils.dewhiten +.. autofunction:: gnuradio.digital.ofdm_packet_utils.is_1_0_string +.. autofunction:: gnuradio.digital.ofdm_packet_utils.make_header +.. autofunction:: gnuradio.digital.ofdm_packet_utils.make_packet +.. autofunction:: gnuradio.digital.ofdm_packet_utils.random_mask_tuple +.. autofunction:: gnuradio.digital.ofdm_packet_utils.random_mask_vec8 +.. autofunction:: gnuradio.digital.ofdm_packet_utils.string_to_hex_list +.. autofunction:: gnuradio.digital.ofdm_packet_utils.unmake_packet +.. autofunction:: gnuradio.digital.ofdm_packet_utils.whiten diff --git a/docs/sphinx/source/digital/pkt_utils.rst b/docs/sphinx/source/digital/pkt_utils.rst new file mode 100644 index 000000000..112e103a2 --- /dev/null +++ b/docs/sphinx/source/digital/pkt_utils.rst @@ -0,0 +1,18 @@ +gnuradio.digital: Packet Utilities +================================== + +.. autofunction:: gnuradio.digital.packet_utils.conv_1_0_string_to_packed_binary_string +.. autofunction:: gnuradio.digital.packet_utils.conv_packed_binary_string_to_1_0_string +.. data:: gnuradio.digital.packet_utils.default_access_code +.. autofunction:: gnuradio.digital.packet_utils.dewhiten +.. autofunction:: gnuradio.digital.packet_utils.is_1_0_string +.. autofunction:: gnuradio.digital.packet_utils.make_header +.. autofunction:: gnuradio.digital.packet_utils.make_packet +.. data:: gnuradio.digital.packet_utils.preamble +.. autofunction:: gnuradio.digital.packet_utils.random_mask_tuple +.. autofunction:: gnuradio.digital.packet_utils.random_mask_vec8 +.. autofunction:: gnuradio.digital.packet_utils.string_to_hex_list +.. autofunction:: gnuradio.digital.packet_utils.unmake_packet +.. autofunction:: gnuradio.digital.packet_utils.whiten +.. autofunction:: gnuradio.digital.crc.check_crc32 +.. autofunction:: gnuradio.digital.crc.gen_and_append_crc32 diff --git a/docs/sphinx/source/digital/utilities.rst b/docs/sphinx/source/digital/utilities.rst new file mode 100644 index 000000000..7a08725a5 --- /dev/null +++ b/docs/sphinx/source/digital/utilities.rst @@ -0,0 +1,12 @@ +gnuradio.digital: Modulation Utilities +====================================== + +.. autofunction:: gnuradio.digital.utils.gray_code.gray_code +.. data:: gnuradio.digital.utils.mod_codes.GRAY_CODE +.. data:: gnuradio.digital.utils.mod_codes.NO_CODE +.. autofunction:: gnuradio.digital.modulation_utils.add_type_1_constellation +.. autofunction:: gnuradio.digital.modulation_utils.add_type_1_demod +.. autofunction:: gnuradio.digital.modulation_utils.add_type_1_mod +.. data:: gnuradio.digital.modulation_utils.type_1_constellations +.. data:: gnuradio.digital.modulation_utils.type_1_demods +.. data:: gnuradio.digital.modulation_utils.type_1_mods diff --git a/docs/sphinx/source/eng_notation/index.rst b/docs/sphinx/source/eng_notation/index.rst new file mode 100644 index 000000000..f457754ac --- /dev/null +++ b/docs/sphinx/source/eng_notation/index.rst @@ -0,0 +1,8 @@ +gnuradio.eng_notation +===================== + +.. automodule:: gnuradio.eng_notation + +.. autofunction:: gnuradio.eng_notation.num_to_str +.. autofunction:: gnuradio.eng_notation.str_to_num + diff --git a/docs/sphinx/source/eng_option/index.rst b/docs/sphinx/source/eng_option/index.rst new file mode 100644 index 000000000..b9119ee69 --- /dev/null +++ b/docs/sphinx/source/eng_option/index.rst @@ -0,0 +1,6 @@ +gnuradio.eng_option +=================== + +.. automodule:: gnuradio.eng_option + +.. autoclass:: gnuradio.eng_option.eng_option diff --git a/docs/sphinx/source/gr/coding_blk.rst b/docs/sphinx/source/gr/coding_blk.rst new file mode 100644 index 000000000..87196a5ae --- /dev/null +++ b/docs/sphinx/source/gr/coding_blk.rst @@ -0,0 +1,11 @@ +gnuradio.gr: Information Coding and Decoding +============================================ + +.. autoblock:: gnuradio.gr.additive_scrambler_bb +.. autoblock:: gnuradio.gr.descrambler_bb +.. autoblock:: gnuradio.gr.diff_decoder_bb +.. autoblock:: gnuradio.gr.diff_encoder_bb +.. autoblock:: gnuradio.gr.fake_channel_encoder_pp +.. autoblock:: gnuradio.gr.fake_channel_decoder_pp +.. autoblock:: gnuradio.gr.map_bb +.. autoblock:: gnuradio.gr.scrambler_bb diff --git a/docs/sphinx/source/gr/converter_blk.rst b/docs/sphinx/source/gr/converter_blk.rst new file mode 100644 index 000000000..b0ddd1d8a --- /dev/null +++ b/docs/sphinx/source/gr/converter_blk.rst @@ -0,0 +1,32 @@ +gnuradio.gr: Type Conversions +============================= + +.. autoblock:: gnuradio.gr.bytes_to_syms +.. autoblock:: gnuradio.gr.char_to_float +.. autoblock:: gnuradio.gr.complex_to_interleaved_short +.. autoblock:: gnuradio.gr.complex_to_float +.. autoblock:: gnuradio.gr.complex_to_real +.. autoblock:: gnuradio.gr.complex_to_imag +.. autoblock:: gnuradio.gr.complex_to_mag +.. autoblock:: gnuradio.gr.complex_to_mag_squared +.. autoblock:: gnuradio.gr.complex_to_arg +.. autoblock:: gnuradio.gr.float_to_char +.. autoblock:: gnuradio.gr.float_to_complex +.. autoblock:: gnuradio.gr.float_to_short +.. autoblock:: gnuradio.gr.float_to_uchar +.. autoblock:: gnuradio.gr.interleaved_short_to_complex +.. autoblock:: gnuradio.gr.short_to_float +.. autoblock:: gnuradio.gr.uchar_to_float +.. autoblock:: gnuradio.gr.unpack_k_bits_bb +.. autoblock:: gnuradio.gr.chunks_to_symbols_bc +.. autoblock:: gnuradio.gr.chunks_to_symbols_bf +.. autoblock:: gnuradio.gr.chunks_to_symbols_ic +.. autoblock:: gnuradio.gr.chunks_to_symbols_if +.. autoblock:: gnuradio.gr.chunks_to_symbols_sc +.. autoblock:: gnuradio.gr.chunks_to_symbols_sf +.. autoblock:: gnuradio.gr.packed_to_unpacked_bb +.. autoblock:: gnuradio.gr.packed_to_unpacked_ii +.. autoblock:: gnuradio.gr.packed_to_unpacked_ss +.. autoblock:: gnuradio.gr.unpacked_to_packed_bb +.. autoblock:: gnuradio.gr.unpacked_to_packed_ii +.. autoblock:: gnuradio.gr.unpacked_to_packed_ss diff --git a/docs/sphinx/source/gr/demodulation_blk.rst b/docs/sphinx/source/gr/demodulation_blk.rst new file mode 100644 index 000000000..e5a935434 --- /dev/null +++ b/docs/sphinx/source/gr/demodulation_blk.rst @@ -0,0 +1,4 @@ +gnuradio.gr: Demodulation +========================= + +.. autoblock:: gnuradio.gr.quadrature_demod_cf diff --git a/docs/sphinx/source/gr/dft_blk.rst b/docs/sphinx/source/gr/dft_blk.rst new file mode 100644 index 000000000..a93119969 --- /dev/null +++ b/docs/sphinx/source/gr/dft_blk.rst @@ -0,0 +1,6 @@ +gnuradio.gr: Fourier Transform +============================== + +.. autoblock:: gnuradio.gr.goertzel_fc +.. autoblock:: gnuradio.gr.fft_vcc +.. autoblock:: gnuradio.gr.fft_vfc diff --git a/docs/sphinx/source/gr/filter_blk.rst b/docs/sphinx/source/gr/filter_blk.rst new file mode 100644 index 000000000..767ee4b74 --- /dev/null +++ b/docs/sphinx/source/gr/filter_blk.rst @@ -0,0 +1,46 @@ +gnuradio.gr: Filters +==================== + +.. autoblock:: gnuradio.gr.fft_filter_ccc +.. autoblock:: gnuradio.gr.fft_filter_fff +.. autoblock:: gnuradio.gr.filter_delay_fc +.. autoblock:: gnuradio.gr.fir_filter_ccc +.. autoblock:: gnuradio.gr.fir_filter_ccf +.. autoblock:: gnuradio.gr.fir_filter_fcc +.. autoblock:: gnuradio.gr.fir_filter_fff +.. autoblock:: gnuradio.gr.fir_filter_fsf +.. autoblock:: gnuradio.gr.fir_filter_scc +.. autoblock:: gnuradio.gr.fractional_interpolator_cc +.. autoblock:: gnuradio.gr.fractional_interpolator_ff +.. autoblock:: gnuradio.gr.freq_xlating_fir_filter_ccc +.. autoblock:: gnuradio.gr.freq_xlating_fir_filter_ccf +.. autoblock:: gnuradio.gr.freq_xlating_fir_filter_fcc +.. autoblock:: gnuradio.gr.freq_xlating_fir_filter_fcf +.. autoblock:: gnuradio.gr.freq_xlating_fir_filter_scc +.. autoblock:: gnuradio.gr.freq_xlating_fir_filter_scf +.. autoblock:: gnuradio.gr.hilbert_fc +.. autoblock:: gnuradio.gr.iir_filter_ffd +.. autoblock:: gnuradio.gr.interp_fir_filter_ccc +.. autoblock:: gnuradio.gr.interp_fir_filter_ccf +.. autoblock:: gnuradio.gr.interp_fir_filter_fcc +.. autoblock:: gnuradio.gr.interp_fir_filter_fff +.. autoblock:: gnuradio.gr.interp_fir_filter_fsf +.. autoblock:: gnuradio.gr.interp_fir_filter_scc +.. autoblock:: gnuradio.gr.rational_resampler_base_ccc +.. autoblock:: gnuradio.gr.rational_resampler_base_ccf +.. autoblock:: gnuradio.gr.rational_resampler_base_fcc +.. autoblock:: gnuradio.gr.rational_resampler_base_fff +.. autoblock:: gnuradio.gr.rational_resampler_base_fsf +.. autoblock:: gnuradio.gr.rational_resampler_base_scc +.. autoblock:: gnuradio.gr.single_pole_iir_filter_cc +.. autoblock:: gnuradio.gr.single_pole_iir_filter_ff +.. autoblock:: gnuradio.gr.moving_average_cc +.. autoblock:: gnuradio.gr.moving_average_ff +.. autoblock:: gnuradio.gr.moving_average_ii +.. autoblock:: gnuradio.gr.moving_average_ss +.. autoblock:: gnuradio.gr.pfb_arb_resampler_ccf +.. autoblock:: gnuradio.gr.pfb_channelizer_ccf +.. autoblock:: gnuradio.gr.pfb_clock_sync_ccf +.. autoblock:: gnuradio.gr.pfb_clock_sync_fff +.. autoblock:: gnuradio.gr.pfb_decimator_ccf +.. autoblock:: gnuradio.gr.pfb_interpolator_ccf diff --git a/docs/sphinx/source/gr/filter_design.rst b/docs/sphinx/source/gr/filter_design.rst new file mode 100644 index 000000000..6ab23c50b --- /dev/null +++ b/docs/sphinx/source/gr/filter_design.rst @@ -0,0 +1,7 @@ +gnuradio.gr: Digital Filter Design +================================== + +.. autoclass:: gnuradio.gr.firdes + :members: + +.. autofunction:: gnuradio.gr.remez diff --git a/docs/sphinx/source/gr/index.rst b/docs/sphinx/source/gr/index.rst new file mode 100644 index 000000000..3d32599f1 --- /dev/null +++ b/docs/sphinx/source/gr/index.rst @@ -0,0 +1,380 @@ +gnuradio.gr +=========== + +.. automodule:: gnuradio.gr + +Signal Processing Blocks +------------------------ + +Top Block and Hierarchical Block Base Classes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.top_block + gnuradio.gr.hier_block2 + +Signal Sources +^^^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.glfsr_source_b + gnuradio.gr.glfsr_source_f + gnuradio.gr.lfsr_32k_source_s + gnuradio.gr.null_source + gnuradio.gr.noise_source_c + gnuradio.gr.noise_source_f + gnuradio.gr.noise_source_i + gnuradio.gr.noise_source_s + gnuradio.gr.sig_source_c + gnuradio.gr.sig_source_f + gnuradio.gr.sig_source_i + gnuradio.gr.sig_source_s + gnuradio.gr.vector_source_b + gnuradio.gr.vector_source_c + gnuradio.gr.vector_source_f + gnuradio.gr.vector_source_i + gnuradio.gr.vector_source_s + gnuradio.gr.file_descriptor_source + gnuradio.gr.file_source + gnuradio.gr.message_source + gnuradio.gr.udp_source + gnuradio.gr.wavfile_source + +Signal Sinks +^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.bin_statistics_f + gnuradio.gr.check_counting_s + gnuradio.gr.check_lfsr_32k_s + gnuradio.gr.framer_sink_1 + gnuradio.gr.null_sink + gnuradio.gr.packet_sink + gnuradio.gr.probe_avg_mag_sqrd_c + gnuradio.gr.probe_avg_mag_sqrd_cf + gnuradio.gr.probe_avg_mag_sqrd_f + gnuradio.gr.probe_signal_f + gnuradio.gr.vector_sink_b + gnuradio.gr.vector_sink_c + gnuradio.gr.vector_sink_f + gnuradio.gr.vector_sink_i + gnuradio.gr.vector_sink_s + gnuradio.gr.file_descriptor_sink + gnuradio.gr.file_sink + gnuradio.gr.histo_sink_f + gnuradio.gr.message_sink + gnuradio.gr.oscope_sink_f + gnuradio.gr.udp_sink + gnuradio.gr.wavfile_sink + +Filters +^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.fft_filter_ccc + gnuradio.gr.fft_filter_fff + gnuradio.gr.filter_delay_fc + gnuradio.gr.fir_filter_ccc + gnuradio.gr.fir_filter_ccf + gnuradio.gr.fir_filter_fcc + gnuradio.gr.fir_filter_fff + gnuradio.gr.fir_filter_fsf + gnuradio.gr.fir_filter_scc + gnuradio.gr.fractional_interpolator_cc + gnuradio.gr.fractional_interpolator_ff + gnuradio.gr.freq_xlating_fir_filter_ccc + gnuradio.gr.freq_xlating_fir_filter_ccf + gnuradio.gr.freq_xlating_fir_filter_fcc + gnuradio.gr.freq_xlating_fir_filter_fcf + gnuradio.gr.freq_xlating_fir_filter_scc + gnuradio.gr.freq_xlating_fir_filter_scf + gnuradio.gr.hilbert_fc + gnuradio.gr.iir_filter_ffd + gnuradio.gr.interp_fir_filter_ccc + gnuradio.gr.interp_fir_filter_ccf + gnuradio.gr.interp_fir_filter_fcc + gnuradio.gr.interp_fir_filter_fff + gnuradio.gr.interp_fir_filter_fsf + gnuradio.gr.interp_fir_filter_scc + gnuradio.gr.rational_resampler_base_ccc + gnuradio.gr.rational_resampler_base_ccf + gnuradio.gr.rational_resampler_base_fcc + gnuradio.gr.rational_resampler_base_fff + gnuradio.gr.rational_resampler_base_fsf + gnuradio.gr.rational_resampler_base_scc + gnuradio.gr.single_pole_iir_filter_cc + gnuradio.gr.single_pole_iir_filter_ff + gnuradio.gr.moving_average_cc + gnuradio.gr.moving_average_ff + gnuradio.gr.moving_average_ii + gnuradio.gr.moving_average_ss + gnuradio.gr.pfb_arb_resampler_ccf + gnuradio.gr.pfb_channelizer_ccf + gnuradio.gr.pfb_clock_sync_ccf + gnuradio.gr.pfb_clock_sync_fff + gnuradio.gr.pfb_decimator_ccf + gnuradio.gr.pfb_interpolator_ccf + +Mathematics +^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.conjugate_cc + gnuradio.gr.nlog10_ff + gnuradio.gr.rms_cf + gnuradio.gr.rms_ff + gnuradio.gr.add_cc + gnuradio.gr.add_const_cc + gnuradio.gr.add_const_ff + gnuradio.gr.add_const_ii + gnuradio.gr.add_const_sf + gnuradio.gr.add_const_ss + gnuradio.gr.add_const_vcc + gnuradio.gr.add_const_vff + gnuradio.gr.add_const_vii + gnuradio.gr.add_const_vss + gnuradio.gr.add_ff + gnuradio.gr.add_ii + gnuradio.gr.add_ss + gnuradio.gr.and_bb + gnuradio.gr.and_const_bb + gnuradio.gr.and_const_ii + gnuradio.gr.and_const_ss + gnuradio.gr.and_ii + gnuradio.gr.and_ss + gnuradio.gr.divide_cc + gnuradio.gr.divide_ff + gnuradio.gr.divide_ii + gnuradio.gr.divide_ss + gnuradio.gr.integrate_cc + gnuradio.gr.integrate_ff + gnuradio.gr.integrate_ii + gnuradio.gr.integrate_ss + gnuradio.gr.multiply_cc + gnuradio.gr.multiply_const_cc + gnuradio.gr.multiply_const_ff + gnuradio.gr.multiply_const_ii + gnuradio.gr.multiply_const_ss + gnuradio.gr.multiply_const_vcc + gnuradio.gr.multiply_const_vff + gnuradio.gr.multiply_const_vii + gnuradio.gr.multiply_const_vss + gnuradio.gr.multiply_ff + gnuradio.gr.multiply_ii + gnuradio.gr.multiply_ss + gnuradio.gr.not_bb + gnuradio.gr.not_ii + gnuradio.gr.not_ss + gnuradio.gr.or_bb + gnuradio.gr.or_ii + gnuradio.gr.or_ss + gnuradio.gr.sub_cc + gnuradio.gr.sub_ff + gnuradio.gr.sub_ii + gnuradio.gr.sub_ss + gnuradio.gr.xor_bb + gnuradio.gr.xor_ii + gnuradio.gr.xor_ss + +Modulation +^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.cpfsk_bc + gnuradio.gr.frequency_modulator_fc + gnuradio.gr.phase_modulator_fc + +Demodulation +^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.quadrature_demod_cf + +Information Coding and Decoding +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.additive_scrambler_bb + gnuradio.gr.descrambler_bb + gnuradio.gr.diff_decoder_bb + gnuradio.gr.diff_encoder_bb + gnuradio.gr.fake_channel_encoder_pp + gnuradio.gr.fake_channel_decoder_pp + gnuradio.gr.map_bb + gnuradio.gr.scrambler_bb + +Synchronization +^^^^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.pll_carriertracking_cc + gnuradio.gr.pll_freqdet_cf + gnuradio.gr.pll_refout_cc + gnuradio.gr.pn_correlator_cc + gnuradio.gr.simple_correlator + gnuradio.gr.simple_framer + +Type Conversions +^^^^^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.bytes_to_syms + gnuradio.gr.char_to_float + gnuradio.gr.complex_to_interleaved_short + gnuradio.gr.complex_to_float + gnuradio.gr.complex_to_real + gnuradio.gr.complex_to_imag + gnuradio.gr.complex_to_mag + gnuradio.gr.complex_to_mag_squared + gnuradio.gr.complex_to_arg + gnuradio.gr.float_to_char + gnuradio.gr.float_to_complex + gnuradio.gr.float_to_short + gnuradio.gr.float_to_uchar + gnuradio.gr.interleaved_short_to_complex + gnuradio.gr.short_to_float + gnuradio.gr.uchar_to_float + gnuradio.gr.unpack_k_bits_bb + gnuradio.gr.chunks_to_symbols_bc + gnuradio.gr.chunks_to_symbols_bf + gnuradio.gr.chunks_to_symbols_ic + gnuradio.gr.chunks_to_symbols_if + gnuradio.gr.chunks_to_symbols_sc + gnuradio.gr.chunks_to_symbols_sf + gnuradio.gr.packed_to_unpacked_bb + gnuradio.gr.packed_to_unpacked_ii + gnuradio.gr.packed_to_unpacked_ss + gnuradio.gr.unpacked_to_packed_bb + gnuradio.gr.unpacked_to_packed_ii + gnuradio.gr.unpacked_to_packed_ss + +Signal Level Control (AGC) +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.agc2_cc + gnuradio.gr.agc2_ff + gnuradio.gr.agc_cc + gnuradio.gr.agc_ff + gnuradio.gr.ctcss_squelch_ff + gnuradio.gr.dpll_bb + gnuradio.gr.feedforward_agc_cc + gnuradio.gr.peak_detector2_fb + gnuradio.gr.pwr_squelch_cc + gnuradio.gr.pwr_squelch_ff + gnuradio.gr.regenerate_bb + gnuradio.gr.simple_squelch_cc + gnuradio.gr.mute_cc + gnuradio.gr.mute_ff + gnuradio.gr.mute_ii + gnuradio.gr.mute_ss + gnuradio.gr.peak_detector_fb + gnuradio.gr.peak_detector_ib + gnuradio.gr.peak_detector_sb + gnuradio.gr.sample_and_hold_bb + gnuradio.gr.sample_and_hold_ff + gnuradio.gr.sample_and_hold_ii + gnuradio.gr.sample_and_hold_ss + +Fourier Transform +^^^^^^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.goertzel_fc + gnuradio.gr.fft_vcc + gnuradio.gr.fft_vfc + +Miscellaneous Blocks +^^^^^^^^^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.copy + gnuradio.gr.delay + gnuradio.gr.kludge_copy + gnuradio.gr.nop + gnuradio.gr.pa_2x2_phase_combiner + gnuradio.gr.repeat + gnuradio.gr.threshold_ff + gnuradio.gr.throttle + gnuradio.gr.channel_model + +Slicing and Dicing Streams +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. autosummary:: + :nosignatures: + + gnuradio.gr.deinterleave + gnuradio.gr.head + gnuradio.gr.interleave + gnuradio.gr.keep_one_in_n + gnuradio.gr.skiphead + gnuradio.gr.stream_to_streams + gnuradio.gr.stream_to_vector + gnuradio.gr.streams_to_stream + gnuradio.gr.streams_to_vector + gnuradio.gr.vector_to_stream + gnuradio.gr.vector_to_streams + +Digital Filter Design +--------------------- + +.. autosummary:: + :nosignatures: + + gnuradio.gr.firdes + gnuradio.gr.remez + +Miscellaneous +------------- + +.. autosummary:: + :nosignatures: + + gnuradio.gr.feval_dd + gnuradio.gr.feval_cc + gnuradio.gr.feval_ll + gnuradio.gr.feval + gnuradio.gr.prefs + gnuradio.gr.test + gnuradio.gr.message + gnuradio.gr.msg_queue + gnuradio.gr.enable_realtime_scheduling + +Implementation Details +---------------------- + +.. autosummary:: + :nosignatures: + + gnuradio.gr.block_detail + gnuradio.gr.buffer + gnuradio.gr.dispatcher + gnuradio.gr.single_threaded_scheduler + diff --git a/docs/sphinx/source/gr/internal.rst b/docs/sphinx/source/gr/internal.rst new file mode 100644 index 000000000..4948b38d4 --- /dev/null +++ b/docs/sphinx/source/gr/internal.rst @@ -0,0 +1,7 @@ +gnuradio.gr: Implementation Details +=================================== + +.. autofunction:: gnuradio.gr.block_detail +.. autofunction:: gnuradio.gr.buffer +.. autofunction:: gnuradio.gr.dispatcher +.. autofunction:: gnuradio.gr.single_threaded_scheduler diff --git a/docs/sphinx/source/gr/level_blk.rst b/docs/sphinx/source/gr/level_blk.rst new file mode 100644 index 000000000..77ba2270d --- /dev/null +++ b/docs/sphinx/source/gr/level_blk.rst @@ -0,0 +1,26 @@ +gnuradio.gr: Signal Level Control (AGC) +======================================= + +.. autoblock:: gnuradio.gr.agc2_cc +.. autoblock:: gnuradio.gr.agc2_ff +.. autoblock:: gnuradio.gr.agc_cc +.. autoblock:: gnuradio.gr.agc_ff +.. autoblock:: gnuradio.gr.ctcss_squelch_ff +.. autoblock:: gnuradio.gr.dpll_bb +.. autoblock:: gnuradio.gr.feedforward_agc_cc +.. autoblock:: gnuradio.gr.peak_detector2_fb +.. autoblock:: gnuradio.gr.pwr_squelch_cc +.. autoblock:: gnuradio.gr.pwr_squelch_ff +.. autoblock:: gnuradio.gr.regenerate_bb +.. autoblock:: gnuradio.gr.simple_squelch_cc +.. autoblock:: gnuradio.gr.mute_cc +.. autoblock:: gnuradio.gr.mute_ff +.. autoblock:: gnuradio.gr.mute_ii +.. autoblock:: gnuradio.gr.mute_ss +.. autoblock:: gnuradio.gr.peak_detector_fb +.. autoblock:: gnuradio.gr.peak_detector_ib +.. autoblock:: gnuradio.gr.peak_detector_sb +.. autoblock:: gnuradio.gr.sample_and_hold_bb +.. autoblock:: gnuradio.gr.sample_and_hold_ff +.. autoblock:: gnuradio.gr.sample_and_hold_ii +.. autoblock:: gnuradio.gr.sample_and_hold_ss diff --git a/docs/sphinx/source/gr/math_blk.rst b/docs/sphinx/source/gr/math_blk.rst new file mode 100644 index 000000000..a2ef51922 --- /dev/null +++ b/docs/sphinx/source/gr/math_blk.rst @@ -0,0 +1,59 @@ +gnuradio.gr: Mathematics +======================== + +.. autoblock:: gnuradio.gr.conjugate_cc +.. autoblock:: gnuradio.gr.nlog10_ff +.. autoblock:: gnuradio.gr.rms_cf +.. autoblock:: gnuradio.gr.rms_ff +.. autoblock:: gnuradio.gr.add_cc +.. autoblock:: gnuradio.gr.add_const_cc +.. autoblock:: gnuradio.gr.add_const_ff +.. autoblock:: gnuradio.gr.add_const_ii +.. autoblock:: gnuradio.gr.add_const_sf +.. autoblock:: gnuradio.gr.add_const_ss +.. autoblock:: gnuradio.gr.add_const_vcc +.. autoblock:: gnuradio.gr.add_const_vff +.. autoblock:: gnuradio.gr.add_const_vii +.. autoblock:: gnuradio.gr.add_const_vss +.. autoblock:: gnuradio.gr.add_ff +.. autoblock:: gnuradio.gr.add_ii +.. autoblock:: gnuradio.gr.add_ss +.. autoblock:: gnuradio.gr.and_bb +.. autoblock:: gnuradio.gr.and_const_bb +.. autoblock:: gnuradio.gr.and_const_ii +.. autoblock:: gnuradio.gr.and_const_ss +.. autoblock:: gnuradio.gr.and_ii +.. autoblock:: gnuradio.gr.and_ss +.. autoblock:: gnuradio.gr.divide_cc +.. autoblock:: gnuradio.gr.divide_ff +.. autoblock:: gnuradio.gr.divide_ii +.. autoblock:: gnuradio.gr.divide_ss +.. autoblock:: gnuradio.gr.integrate_cc +.. autoblock:: gnuradio.gr.integrate_ff +.. autoblock:: gnuradio.gr.integrate_ii +.. autoblock:: gnuradio.gr.integrate_ss +.. autoblock:: gnuradio.gr.multiply_cc +.. autoblock:: gnuradio.gr.multiply_const_cc +.. autoblock:: gnuradio.gr.multiply_const_ff +.. autoblock:: gnuradio.gr.multiply_const_ii +.. autoblock:: gnuradio.gr.multiply_const_ss +.. autoblock:: gnuradio.gr.multiply_const_vcc +.. autoblock:: gnuradio.gr.multiply_const_vff +.. autoblock:: gnuradio.gr.multiply_const_vii +.. autoblock:: gnuradio.gr.multiply_const_vss +.. autoblock:: gnuradio.gr.multiply_ff +.. autoblock:: gnuradio.gr.multiply_ii +.. autoblock:: gnuradio.gr.multiply_ss +.. autoblock:: gnuradio.gr.not_bb +.. autoblock:: gnuradio.gr.not_ii +.. autoblock:: gnuradio.gr.not_ss +.. autoblock:: gnuradio.gr.or_bb +.. autoblock:: gnuradio.gr.or_ii +.. autoblock:: gnuradio.gr.or_ss +.. autoblock:: gnuradio.gr.sub_cc +.. autoblock:: gnuradio.gr.sub_ff +.. autoblock:: gnuradio.gr.sub_ii +.. autoblock:: gnuradio.gr.sub_ss +.. autoblock:: gnuradio.gr.xor_bb +.. autoblock:: gnuradio.gr.xor_ii +.. autoblock:: gnuradio.gr.xor_ss diff --git a/docs/sphinx/source/gr/misc.rst b/docs/sphinx/source/gr/misc.rst new file mode 100644 index 000000000..b0a3f3ba1 --- /dev/null +++ b/docs/sphinx/source/gr/misc.rst @@ -0,0 +1,12 @@ +gnuradio.gr: Miscellaneous +========================== + +.. autofunction:: gnuradio.gr.feval_dd +.. autofunction:: gnuradio.gr.feval_cc +.. autofunction:: gnuradio.gr.feval_ll +.. autofunction:: gnuradio.gr.feval +.. autofunction:: gnuradio.gr.prefs +.. autofunction:: gnuradio.gr.test +.. autofunction:: gnuradio.gr.message +.. autofunction:: gnuradio.gr.msg_queue +.. autofunction:: gnuradio.gr.enable_realtime_scheduling diff --git a/docs/sphinx/source/gr/misc_blk.rst b/docs/sphinx/source/gr/misc_blk.rst new file mode 100644 index 000000000..f3bd2d943 --- /dev/null +++ b/docs/sphinx/source/gr/misc_blk.rst @@ -0,0 +1,12 @@ +gnuradio.gr: Miscellaneous Blocks +================================= + +.. autoblock:: gnuradio.gr.copy +.. autoblock:: gnuradio.gr.delay +.. autoblock:: gnuradio.gr.kludge_copy +.. autoblock:: gnuradio.gr.nop +.. autoblock:: gnuradio.gr.pa_2x2_phase_combiner +.. autoblock:: gnuradio.gr.repeat +.. autoblock:: gnuradio.gr.threshold_ff +.. autoblock:: gnuradio.gr.throttle +.. autoblock:: gnuradio.gr.channel_model diff --git a/docs/sphinx/source/gr/modulation_blk.rst b/docs/sphinx/source/gr/modulation_blk.rst new file mode 100644 index 000000000..7cc54d9dc --- /dev/null +++ b/docs/sphinx/source/gr/modulation_blk.rst @@ -0,0 +1,6 @@ +gnuradio.gr: Modulation +======================= + +.. autoblock:: gnuradio.gr.cpfsk_bc +.. autoblock:: gnuradio.gr.frequency_modulator_fc +.. autoblock:: gnuradio.gr.phase_modulator_fc diff --git a/docs/sphinx/source/gr/sink_blk.rst b/docs/sphinx/source/gr/sink_blk.rst new file mode 100644 index 000000000..8e5c7a403 --- /dev/null +++ b/docs/sphinx/source/gr/sink_blk.rst @@ -0,0 +1,25 @@ +gnuradio.gr: Signal Sinks +========================= + +.. autoblock:: gnuradio.gr.bin_statistics_f +.. autoblock:: gnuradio.gr.check_counting_s +.. autoblock:: gnuradio.gr.check_lfsr_32k_s +.. autoblock:: gnuradio.gr.framer_sink_1 +.. autoblock:: gnuradio.gr.null_sink +.. autoblock:: gnuradio.gr.packet_sink +.. autoblock:: gnuradio.gr.probe_avg_mag_sqrd_c +.. autoblock:: gnuradio.gr.probe_avg_mag_sqrd_cf +.. autoblock:: gnuradio.gr.probe_avg_mag_sqrd_f +.. autoblock:: gnuradio.gr.probe_signal_f +.. autoblock:: gnuradio.gr.vector_sink_b +.. autoblock:: gnuradio.gr.vector_sink_c +.. autoblock:: gnuradio.gr.vector_sink_f +.. autoblock:: gnuradio.gr.vector_sink_i +.. autoblock:: gnuradio.gr.vector_sink_s +.. autoblock:: gnuradio.gr.file_descriptor_sink +.. autoblock:: gnuradio.gr.file_sink +.. autoblock:: gnuradio.gr.histo_sink_f +.. autoblock:: gnuradio.gr.message_sink +.. autoblock:: gnuradio.gr.oscope_sink_f +.. autoblock:: gnuradio.gr.udp_sink +.. autoblock:: gnuradio.gr.wavfile_sink diff --git a/docs/sphinx/source/gr/slicedice_blk.rst b/docs/sphinx/source/gr/slicedice_blk.rst new file mode 100644 index 000000000..0bb5719ea --- /dev/null +++ b/docs/sphinx/source/gr/slicedice_blk.rst @@ -0,0 +1,14 @@ +gnuradio.gr: Slicing and Dicing Streams +======================================= + +.. autoblock:: gnuradio.gr.deinterleave +.. autoblock:: gnuradio.gr.head +.. autoblock:: gnuradio.gr.interleave +.. autoblock:: gnuradio.gr.keep_one_in_n +.. autoblock:: gnuradio.gr.skiphead +.. autoblock:: gnuradio.gr.stream_to_streams +.. autoblock:: gnuradio.gr.stream_to_vector +.. autoblock:: gnuradio.gr.streams_to_stream +.. autoblock:: gnuradio.gr.streams_to_vector +.. autoblock:: gnuradio.gr.vector_to_stream +.. autoblock:: gnuradio.gr.vector_to_streams diff --git a/docs/sphinx/source/gr/source_blk.rst b/docs/sphinx/source/gr/source_blk.rst new file mode 100644 index 000000000..e6e24e1b5 --- /dev/null +++ b/docs/sphinx/source/gr/source_blk.rst @@ -0,0 +1,26 @@ +gnuradio.gr: Signal Sources +=========================== + +.. autoblock:: gnuradio.gr.glfsr_source_b +.. autoblock:: gnuradio.gr.glfsr_source_f +.. autoblock:: gnuradio.gr.lfsr_32k_source_s +.. autoblock:: gnuradio.gr.null_source +.. autoblock:: gnuradio.gr.noise_source_c +.. autoblock:: gnuradio.gr.noise_source_f +.. autoblock:: gnuradio.gr.noise_source_i +.. autoblock:: gnuradio.gr.noise_source_s +.. autoblock:: gnuradio.gr.sig_source_c +.. autoblock:: gnuradio.gr.sig_source_f +.. autoblock:: gnuradio.gr.sig_source_i +.. autoblock:: gnuradio.gr.sig_source_s +.. autoblock:: gnuradio.gr.vector_source_b +.. autoblock:: gnuradio.gr.vector_source_c +.. autoblock:: gnuradio.gr.vector_source_f +.. autoblock:: gnuradio.gr.vector_source_i +.. autoblock:: gnuradio.gr.vector_source_s +.. autoblock:: gnuradio.gr.file_descriptor_source +.. autoblock:: gnuradio.gr.file_source +.. autoblock:: gnuradio.gr.message_source +.. autoblock:: gnuradio.gr.udp_source +.. autoblock:: gnuradio.gr.wavfile_source + diff --git a/docs/sphinx/source/gr/sync_blk.rst b/docs/sphinx/source/gr/sync_blk.rst new file mode 100644 index 000000000..bb2b83974 --- /dev/null +++ b/docs/sphinx/source/gr/sync_blk.rst @@ -0,0 +1,9 @@ +gnuradio.gr: Synchronization +============================ + +.. autoblock:: gnuradio.gr.pll_carriertracking_cc +.. autoblock:: gnuradio.gr.pll_freqdet_cf +.. autoblock:: gnuradio.gr.pll_refout_cc +.. autoblock:: gnuradio.gr.pn_correlator_cc +.. autoblock:: gnuradio.gr.simple_correlator +.. autoblock:: gnuradio.gr.simple_framer diff --git a/docs/sphinx/source/gr/top_block.rst b/docs/sphinx/source/gr/top_block.rst new file mode 100644 index 000000000..3d4e9ef3d --- /dev/null +++ b/docs/sphinx/source/gr/top_block.rst @@ -0,0 +1,7 @@ +gnuradio.gr: Top Block and Hierarchical Block Base Classes +========================================================== + +.. autoclass:: gnuradio.gr.top_block + +.. autoclass:: gnuradio.gr.hier_block2 + diff --git a/docs/sphinx/source/gr_unittest/index.rst b/docs/sphinx/source/gr_unittest/index.rst new file mode 100644 index 000000000..2169a7da4 --- /dev/null +++ b/docs/sphinx/source/gr_unittest/index.rst @@ -0,0 +1,7 @@ +gnuradio.gr_unittest +==================== + +.. automodule:: gnuradio.gr_unittest + +.. autoclass:: gnuradio.gr_unittest.TestCase +.. autofunction:: gnuradio.gr_unittest.run diff --git a/docs/sphinx/source/index.rst b/docs/sphinx/source/index.rst new file mode 100644 index 000000000..887271ce0 --- /dev/null +++ b/docs/sphinx/source/index.rst @@ -0,0 +1,118 @@ +gnuradio +======== + +.. automodule:: gnuradio + +Core Framework +-------------- + +.. autosummary:: + :nosignatures: + + gnuradio.gr + gnuradio.digital + gnuradio.blks2 + gnuradio.audio + gnuradio.trellis + gnuradio.wavelet + gnuradio.window + gnuradio.optfir + gnuradio.gr_unittest + gnuradio.qtgui + gnuradio.wxgui + +.. toctree:: + :hidden: + + gnuradio.gr <gr/index> + gnuradio.digital <digital/index> + gnuradio.blks2 <blks2/index> + gnuradio.audio <audio/index> + gnuradio.gr_unittest <gr_unittest/index> + gnuradio.optfir <optfir/index> + gnuradio.trellis <trellis/index> + gnuradio.wavelet <wavelet> + gnuradio.window <window/index> + gnuradio.qtgui <qtgui/index> + gnuradio.wxgui <wxgui/index> + +Utilities +--------- + +.. autosummary:: + :nosignatures: + + gnuradio.plot_data + gnuradio.eng_notation + gnuradio.eng_option + +.. toctree:: + :hidden: + + gnuradio.plot_data <plot_data> + gnuradio.eng_notation <eng_notation/index> + gnuradio.eng_option <eng_option/index> + +Framework Extensions +-------------------- + +.. autosummary:: + :nosignatures: + + gnuradio.atsc + gnuradio.noaa + gnuradio.pager + gnuradio.video_sdl + gnuradio.vocoder + +.. toctree:: + :hidden: + + gnuradio.atsc <atsc/index> + gnuradio.noaa <noaa> + gnuradio.pager <pager/index> + gnuradio.video_sdl <video_sdl> + gnuradio.vocoder <vocoder/index> + + +.. Use this to add to the toctree but not displayed +.. It's mostly to get rid of warnings + +.. toctree:: + :hidden: + + coding <gr/coding_blk> + converter <gr/converter_blk> + demodulation <gr/demodulation_blk> + dft <gr/dft_blk> + filter <gr/filter_blk> + filter_design <gr/filter_design> + internal <gr/internal> + level <gr/level_blk> + math <gr/math_blk> + misc <gr/misc> + misc <gr/misc_blk> + modulation <gr/modulation_blk> + sink <gr/sink_blk> + slicedice <gr/slicedice_blk> + source <gr/source_blk> + sync <gr/sync_blk> + top_block <gr/top_block> + + atsc_blks <atsc/blks> + blks <blks2/blks> + blks2_utilities <blks2/utilities> + digital_blocks <digital/blocks> + constellations <digital/constellations> + ofdm <digital/ofdm> + pkt_utils <digital/pkt_utils> + digital_utilities <digital/utilities> + optfir <optfir/detail> + pager_blks <pager/blks> + pyqt_filter <pyqt_filter> + pyqt_plot <pyqt_plot> + trellis_blks <trellis/blks> + trellis_objs <trellis/objs> + vocoder_blks <vocoder/blks> + window_detail <window/detail> + wxgui_blks <wxgui/blks> diff --git a/docs/sphinx/source/noaa.rst b/docs/sphinx/source/noaa.rst new file mode 100644 index 000000000..06c707813 --- /dev/null +++ b/docs/sphinx/source/noaa.rst @@ -0,0 +1,8 @@ +gnuradio.noaa +============== + +.. automodule:: gnuradio.noaa + +.. autoblock:: gnuradio.noaa.hrpt_decoder +.. autoblock:: gnuradio.noaa.hrpt_deframer +.. autoblock:: gnuradio.noaa.hrpt_pll_cf diff --git a/docs/sphinx/source/optfir/detail.rst b/docs/sphinx/source/optfir/detail.rst new file mode 100644 index 000000000..78807bee0 --- /dev/null +++ b/docs/sphinx/source/optfir/detail.rst @@ -0,0 +1,14 @@ +gnuradio.optfir +=============== + +.. autofunction:: gnuradio.optfir.band_pass +.. autofunction:: gnuradio.optfir.band_reject +.. autofunction:: gnuradio.optfir.bporder +.. autofunction:: gnuradio.optfir.complex_band_pass +.. autofunction:: gnuradio.optfir.high_pass +.. autofunction:: gnuradio.optfir.low_pass +.. autofunction:: gnuradio.optfir.lporder +.. autofunction:: gnuradio.optfir.passband_ripple_to_dev +.. autofunction:: gnuradio.optfir.remez +.. autofunction:: gnuradio.optfir.remezord +.. autofunction:: gnuradio.optfir.stopband_atten_to_dev diff --git a/docs/sphinx/source/optfir/index.rst b/docs/sphinx/source/optfir/index.rst new file mode 100644 index 000000000..f49b01a1f --- /dev/null +++ b/docs/sphinx/source/optfir/index.rst @@ -0,0 +1,19 @@ +gnuradio.optfir +=============== + +.. automodule:: gnuradio.optfir + +.. autosummary:: + :nosignatures: + + gnuradio.optfir.band_pass + gnuradio.optfir.band_reject + gnuradio.optfir.bporder + gnuradio.optfir.complex_band_pass + gnuradio.optfir.high_pass + gnuradio.optfir.low_pass + gnuradio.optfir.lporder + gnuradio.optfir.passband_ripple_to_dev + gnuradio.optfir.remez + gnuradio.optfir.remezord + gnuradio.optfir.stopband_atten_to_dev diff --git a/docs/sphinx/source/pager/blks.rst b/docs/sphinx/source/pager/blks.rst new file mode 100644 index 000000000..9b5a2ca70 --- /dev/null +++ b/docs/sphinx/source/pager/blks.rst @@ -0,0 +1,9 @@ +gnuradio.pager: Signal Processing Blocks +======================================== + +.. autoblock:: gnuradio.pager.flex_deinterleave +.. autopyblock:: gnuradio.pager.flex_demod +.. autoblock:: gnuradio.pager.flex_frame +.. autoblock:: gnuradio.pager.flex_parse +.. autoblock:: gnuradio.pager.flex_sync +.. autoblock:: gnuradio.pager.slicer_fb diff --git a/docs/sphinx/source/pager/index.rst b/docs/sphinx/source/pager/index.rst new file mode 100644 index 000000000..36df48451 --- /dev/null +++ b/docs/sphinx/source/pager/index.rst @@ -0,0 +1,23 @@ +gnuradio.pager +============== + +.. automodule:: gnuradio.pager + +Signal Processing Blocks +------------------------ + +.. autosummary:: + :nosignatures: + + gnuradio.pager.flex_deinterleave + gnuradio.pager.flex_demod + gnuradio.pager.flex_frame + gnuradio.pager.flex_parse + gnuradio.pager.flex_sync + gnuradio.pager.pager_flex_frame + gnuradio.pager.slicer_fb + +Utility Functions +----------------- + +.. autofunction:: gnuradio.pager.queue_runner diff --git a/docs/sphinx/source/plot_data.rst b/docs/sphinx/source/plot_data.rst new file mode 100644 index 000000000..1b52a083c --- /dev/null +++ b/docs/sphinx/source/plot_data.rst @@ -0,0 +1,6 @@ +gnuradio.plot_data +================== + +.. automodule:: gnuradio.plot_data + +.. autoclass:: gnuradio.plot_data.plot_data diff --git a/docs/sphinx/source/pyqt_filter.rst b/docs/sphinx/source/pyqt_filter.rst new file mode 100644 index 000000000..cc52abfa7 --- /dev/null +++ b/docs/sphinx/source/pyqt_filter.rst @@ -0,0 +1,6 @@ +gnuradio.pyqt_filter +==================== + +.. automodule:: gnuradio.pyqt_filter + +.. autoclass:: gnuradio.pyqt_filter.Ui_MainWindow diff --git a/docs/sphinx/source/pyqt_plot.rst b/docs/sphinx/source/pyqt_plot.rst new file mode 100644 index 000000000..3537a080b --- /dev/null +++ b/docs/sphinx/source/pyqt_plot.rst @@ -0,0 +1,6 @@ +gnuradio.pyqt_plot +================== + +.. automodule:: gnuradio.pyqt_plot + +.. autoclass:: gnuradio.pyqt_plot.Ui_MainWindow diff --git a/docs/sphinx/source/qtgui/index.rst b/docs/sphinx/source/qtgui/index.rst new file mode 100644 index 000000000..c6311d381 --- /dev/null +++ b/docs/sphinx/source/qtgui/index.rst @@ -0,0 +1,9 @@ +gnuradio.qtgui +============== + +.. automodule:: gnuradio.qtgui + +.. autoblock:: gnuradio.qtgui.sink_c +.. autoblock:: gnuradio.qtgui.sink_f +.. autoblock:: gnuradio.qtgui.time_sink_c +.. autoblock:: gnuradio.qtgui.time_sink_f diff --git a/docs/sphinx/source/trellis/blks.rst b/docs/sphinx/source/trellis/blks.rst new file mode 100644 index 000000000..a2eda07d6 --- /dev/null +++ b/docs/sphinx/source/trellis/blks.rst @@ -0,0 +1,62 @@ +gnuradio.trellis: Signal Processing Blocks +========================================== + +.. autoblock:: gnuradio.trellis.constellation_metrics_cf +.. autoblock:: gnuradio.trellis.encoder_bb +.. autoblock:: gnuradio.trellis.encoder_bi +.. autoblock:: gnuradio.trellis.encoder_bs +.. autoblock:: gnuradio.trellis.encoder_ii +.. autoblock:: gnuradio.trellis.encoder_si +.. autoblock:: gnuradio.trellis.encoder_ss +.. autoblock:: gnuradio.trellis.metrics_c +.. autoblock:: gnuradio.trellis.metrics_f +.. autoblock:: gnuradio.trellis.metrics_i +.. autoblock:: gnuradio.trellis.metrics_s +.. autoblock:: gnuradio.trellis.pccc_decoder_b +.. autoblock:: gnuradio.trellis.pccc_decoder_combined_cb +.. autoblock:: gnuradio.trellis.pccc_decoder_combined_ci +.. autoblock:: gnuradio.trellis.pccc_decoder_combined_cs +.. autoblock:: gnuradio.trellis.pccc_decoder_combined_fb +.. autoblock:: gnuradio.trellis.pccc_decoder_combined_fi +.. autoblock:: gnuradio.trellis.pccc_decoder_combined_fs +.. autoblock:: gnuradio.trellis.pccc_decoder_i +.. autoblock:: gnuradio.trellis.pccc_decoder_s +.. autoblock:: gnuradio.trellis.pccc_encoder_bb +.. autoblock:: gnuradio.trellis.pccc_encoder_bi +.. autoblock:: gnuradio.trellis.pccc_encoder_bs +.. autoblock:: gnuradio.trellis.pccc_encoder_ii +.. autoblock:: gnuradio.trellis.pccc_encoder_si +.. autoblock:: gnuradio.trellis.pccc_encoder_ss +.. autoblock:: gnuradio.trellis.permutation +.. autoblock:: gnuradio.trellis.sccc_decoder_b +.. autoblock:: gnuradio.trellis.sccc_decoder_combined_cb +.. autoblock:: gnuradio.trellis.sccc_decoder_combined_ci +.. autoblock:: gnuradio.trellis.sccc_decoder_combined_cs +.. autoblock:: gnuradio.trellis.sccc_decoder_combined_fb +.. autoblock:: gnuradio.trellis.sccc_decoder_combined_fi +.. autoblock:: gnuradio.trellis.sccc_decoder_combined_fs +.. autoblock:: gnuradio.trellis.sccc_decoder_i +.. autoblock:: gnuradio.trellis.sccc_decoder_s +.. autoblock:: gnuradio.trellis.sccc_encoder_bb +.. autoblock:: gnuradio.trellis.sccc_encoder_bi +.. autoblock:: gnuradio.trellis.sccc_encoder_bs +.. autoblock:: gnuradio.trellis.sccc_encoder_ii +.. autoblock:: gnuradio.trellis.sccc_encoder_si +.. autoblock:: gnuradio.trellis.sccc_encoder_ss +.. autoblock:: gnuradio.trellis.siso_combined_f +.. autoblock:: gnuradio.trellis.siso_f +.. autoblock:: gnuradio.trellis.viterbi_b +.. autoblock:: gnuradio.trellis.viterbi_combined_cb +.. autoblock:: gnuradio.trellis.viterbi_combined_ci +.. autoblock:: gnuradio.trellis.viterbi_combined_cs +.. autoblock:: gnuradio.trellis.viterbi_combined_fb +.. autoblock:: gnuradio.trellis.viterbi_combined_fi +.. autoblock:: gnuradio.trellis.viterbi_combined_fs +.. autoblock:: gnuradio.trellis.viterbi_combined_ib +.. autoblock:: gnuradio.trellis.viterbi_combined_ii +.. autoblock:: gnuradio.trellis.viterbi_combined_is +.. autoblock:: gnuradio.trellis.viterbi_combined_sb +.. autoblock:: gnuradio.trellis.viterbi_combined_si +.. autoblock:: gnuradio.trellis.viterbi_combined_ss +.. autoblock:: gnuradio.trellis.viterbi_i +.. autoblock:: gnuradio.trellis.viterbi_s diff --git a/docs/sphinx/source/trellis/index.rst b/docs/sphinx/source/trellis/index.rst new file mode 100644 index 000000000..8a451a913 --- /dev/null +++ b/docs/sphinx/source/trellis/index.rst @@ -0,0 +1,90 @@ +gnuradio.trellis +================ + +.. automodule:: gnuradio.trellis + +Object Classes +-------------- + +.. autosummary:: + :nosignatures: + + gnuradio.trellis.fsm + gnuradio.trellis.interleaver + +Signal Processing Blocks +------------------------ + +.. autosummary:: + :nosignatures: + + gnuradio.trellis.constellation_metrics_cf + gnuradio.trellis.encoder_bb + gnuradio.trellis.encoder_bi + gnuradio.trellis.encoder_bs + gnuradio.trellis.encoder_ii + gnuradio.trellis.encoder_si + gnuradio.trellis.encoder_ss + gnuradio.trellis.metrics_c + gnuradio.trellis.metrics_f + gnuradio.trellis.metrics_i + gnuradio.trellis.metrics_s + gnuradio.trellis.pccc_decoder_b + gnuradio.trellis.pccc_decoder_combined_cb + gnuradio.trellis.pccc_decoder_combined_ci + gnuradio.trellis.pccc_decoder_combined_cs + gnuradio.trellis.pccc_decoder_combined_fb + gnuradio.trellis.pccc_decoder_combined_fi + gnuradio.trellis.pccc_decoder_combined_fs + gnuradio.trellis.pccc_decoder_i + gnuradio.trellis.pccc_decoder_s + gnuradio.trellis.pccc_encoder_bb + gnuradio.trellis.pccc_encoder_bi + gnuradio.trellis.pccc_encoder_bs + gnuradio.trellis.pccc_encoder_ii + gnuradio.trellis.pccc_encoder_si + gnuradio.trellis.pccc_encoder_ss + gnuradio.trellis.permutation + gnuradio.trellis.sccc_decoder_b + gnuradio.trellis.sccc_decoder_combined_cb + gnuradio.trellis.sccc_decoder_combined_ci + gnuradio.trellis.sccc_decoder_combined_cs + gnuradio.trellis.sccc_decoder_combined_fb + gnuradio.trellis.sccc_decoder_combined_fi + gnuradio.trellis.sccc_decoder_combined_fs + gnuradio.trellis.sccc_decoder_i + gnuradio.trellis.sccc_decoder_s + gnuradio.trellis.sccc_encoder_bb + gnuradio.trellis.sccc_encoder_bi + gnuradio.trellis.sccc_encoder_bs + gnuradio.trellis.sccc_encoder_ii + gnuradio.trellis.sccc_encoder_si + gnuradio.trellis.sccc_encoder_ss + gnuradio.trellis.siso_combined_f + gnuradio.trellis.siso_f + gnuradio.trellis.viterbi_b + gnuradio.trellis.viterbi_combined_cb + gnuradio.trellis.viterbi_combined_ci + gnuradio.trellis.viterbi_combined_cs + gnuradio.trellis.viterbi_combined_fb + gnuradio.trellis.viterbi_combined_fi + gnuradio.trellis.viterbi_combined_fs + gnuradio.trellis.viterbi_combined_ib + gnuradio.trellis.viterbi_combined_ii + gnuradio.trellis.viterbi_combined_is + gnuradio.trellis.viterbi_combined_sb + gnuradio.trellis.viterbi_combined_si + gnuradio.trellis.viterbi_combined_ss + gnuradio.trellis.viterbi_i + gnuradio.trellis.viterbi_s + +Constants +--------- + +.. autosummary:: + :nosignatures: + + gnuradio.trellis.TRELLIS_MIN_SUM + gnuradio.trellis.TRELLIS_SUM_PRODUCT + + diff --git a/docs/sphinx/source/trellis/objs.rst b/docs/sphinx/source/trellis/objs.rst new file mode 100644 index 000000000..b3a4b7a4a --- /dev/null +++ b/docs/sphinx/source/trellis/objs.rst @@ -0,0 +1,5 @@ +gnuradio.trellis: Object Classes +-------------------------------- + +.. autoclass:: gnuradio.trellis.fsm +.. autoclass:: gnuradio.trellis.interleaver diff --git a/docs/sphinx/source/video_sdl.rst b/docs/sphinx/source/video_sdl.rst new file mode 100644 index 000000000..e4fc5acac --- /dev/null +++ b/docs/sphinx/source/video_sdl.rst @@ -0,0 +1,7 @@ +gnuradio.video_sdl +================== + +.. automodule:: gnuradio.video_sdl + +.. autoblock:: gnuradio.video_sdl.sink_s +.. autoblock:: gnuradio.video_sdl.sink_uc diff --git a/docs/sphinx/source/vocoder/blks.rst b/docs/sphinx/source/vocoder/blks.rst new file mode 100644 index 000000000..ea20bc44b --- /dev/null +++ b/docs/sphinx/source/vocoder/blks.rst @@ -0,0 +1,19 @@ +gnuradio.vocoder +================ + +.. autoblock:: gnuradio.vocoder.alaw_decode_bs +.. autoblock:: gnuradio.vocoder.alaw_encode_sb +.. autoblock:: gnuradio.vocoder.codec2_decode_ps +.. autoblock:: gnuradio.vocoder.codec2_encode_sp +.. autoblock:: gnuradio.vocoder.cvsd_decode_bs +.. autoblock:: gnuradio.vocoder.cvsd_encode_sb +.. autoblock:: gnuradio.vocoder.g721_decode_bs +.. autoblock:: gnuradio.vocoder.g721_encode_sb +.. autoblock:: gnuradio.vocoder.g723_24_decode_bs +.. autoblock:: gnuradio.vocoder.g723_24_encode_sb +.. autoblock:: gnuradio.vocoder.g723_40_decode_bs +.. autoblock:: gnuradio.vocoder.g723_40_encode_sb +.. autoblock:: gnuradio.vocoder.gsm_fr_decode_ps +.. autoblock:: gnuradio.vocoder.gsm_fr_encode_sp +.. autoblock:: gnuradio.vocoder.ulaw_decode_bs +.. autoblock:: gnuradio.vocoder.ulaw_encode_sb diff --git a/docs/sphinx/source/vocoder/index.rst b/docs/sphinx/source/vocoder/index.rst new file mode 100644 index 000000000..2e3180995 --- /dev/null +++ b/docs/sphinx/source/vocoder/index.rst @@ -0,0 +1,26 @@ +gnuradio.vocoder +================ + +.. automodule:: gnuradio.vocoder + +.. autosummary:: + :nosignatures: + + gnuradio.vocoder.alaw_decode_bs + gnuradio.vocoder.alaw_encode_sb + gnuradio.vocoder.codec2_decode_ps + gnuradio.vocoder.codec2_encode_sp + gnuradio.vocoder.cvsd_decode_bf + gnuradio.vocoder.cvsd_decode_bs + gnuradio.vocoder.cvsd_encode_fb + gnuradio.vocoder.cvsd_encode_sb + gnuradio.vocoder.g721_decode_bs + gnuradio.vocoder.g721_encode_sb + gnuradio.vocoder.g723_24_decode_bs + gnuradio.vocoder.g723_24_encode_sb + gnuradio.vocoder.g723_40_decode_bs + gnuradio.vocoder.g723_40_encode_sb + gnuradio.vocoder.gsm_fr_decode_ps + gnuradio.vocoder.gsm_fr_encode_sp + gnuradio.vocoder.ulaw_decode_bs + gnuradio.vocoder.ulaw_encode_sb diff --git a/docs/sphinx/source/wavelet.rst b/docs/sphinx/source/wavelet.rst new file mode 100644 index 000000000..679bab70c --- /dev/null +++ b/docs/sphinx/source/wavelet.rst @@ -0,0 +1,8 @@ +gnuradio.wavelet +================ + +.. automodule:: gnuradio.wavelet + +.. autoblock:: gnuradio.wavelet.squash_ff +.. autoblock:: gnuradio.wavelet.wavelet_ff +.. autoblock:: gnuradio.wavelet.wvps_ff diff --git a/docs/sphinx/source/window/detail.rst b/docs/sphinx/source/window/detail.rst new file mode 100644 index 000000000..7222a0cb4 --- /dev/null +++ b/docs/sphinx/source/window/detail.rst @@ -0,0 +1,20 @@ +gnuradio.window +=============== + +.. autofunction:: gnuradio.window.bartlett +.. autofunction:: gnuradio.window.blackman2 +.. autofunction:: gnuradio.window.blackman3 +.. autofunction:: gnuradio.window.blackman4 +.. autofunction:: gnuradio.window.blackmanharris +.. autofunction:: gnuradio.window.coswindow +.. autofunction:: gnuradio.window.exponential +.. autofunction:: gnuradio.window.flattop +.. autofunction:: gnuradio.window.hamming +.. autofunction:: gnuradio.window.hanning +.. autofunction:: gnuradio.window.kaiser +.. autofunction:: gnuradio.window.nuttall +.. autofunction:: gnuradio.window.nuttall_cfd +.. autofunction:: gnuradio.window.parzen +.. autofunction:: gnuradio.window.rectangular +.. autofunction:: gnuradio.window.riemann +.. autofunction:: gnuradio.window.welch diff --git a/docs/sphinx/source/window/index.rst b/docs/sphinx/source/window/index.rst new file mode 100644 index 000000000..6ecfea0e9 --- /dev/null +++ b/docs/sphinx/source/window/index.rst @@ -0,0 +1,25 @@ +gnuradio.window +=============== + +.. automodule:: gnuradio.window + +.. autosummary:: + :nosignatures: + + gnuradio.window.bartlett + gnuradio.window.blackman2 + gnuradio.window.blackman3 + gnuradio.window.blackman4 + gnuradio.window.blackmanharris + gnuradio.window.coswindow + gnuradio.window.exponential + gnuradio.window.flattop + gnuradio.window.hamming + gnuradio.window.hanning + gnuradio.window.kaiser + gnuradio.window.nuttall + gnuradio.window.nuttall_cfd + gnuradio.window.parzen + gnuradio.window.rectangular + gnuradio.window.riemann + gnuradio.window.welch diff --git a/docs/sphinx/source/wxgui/blks.rst b/docs/sphinx/source/wxgui/blks.rst new file mode 100644 index 000000000..c304ea0a8 --- /dev/null +++ b/docs/sphinx/source/wxgui/blks.rst @@ -0,0 +1,13 @@ +gnuradio.wxgui +===================== + +.. autopyblock:: gnuradio.wxgui.constsink_gl.const_sink_c +.. autopyblock:: gnuradio.wxgui.fftsink2.fft_sink_c +.. autopyblock:: gnuradio.wxgui.fftsink2.fft_sink_f +.. autopyblock:: gnuradio.wxgui.histosink_gl.histo_sink_f +.. autopyblock:: gnuradio.wxgui.numbersink2.number_sink_c +.. autopyblock:: gnuradio.wxgui.numbersink2.number_sink_f +.. autopyblock:: gnuradio.wxgui.scopesink2.scope_sink_c +.. autopyblock:: gnuradio.wxgui.scopesink2.scope_sink_f +.. autopyblock:: gnuradio.wxgui.waterfallsink2.waterfall_sink_c +.. autopyblock:: gnuradio.wxgui.waterfallsink2.waterfall_sink_f diff --git a/docs/sphinx/source/wxgui/index.rst b/docs/sphinx/source/wxgui/index.rst new file mode 100644 index 000000000..f3fa4f337 --- /dev/null +++ b/docs/sphinx/source/wxgui/index.rst @@ -0,0 +1,18 @@ +gnuradio.wxgui +============== + +.. automodule:: gnuradio.wxgui + +.. autosummary:: + :nosignatures: + + gnuradio.wxgui.common.const_sink_c + gnuradio.wxgui.fftsink2.fft_sink_c + gnuradio.wxgui.fftsink2.fft_sink_f + gnuradio.wxgui.histosink_gl.histosink_f + gnuradio.wxgui.numbersink2.number_sink_c + gnuradio.wxgui.numbersink2.number_sink_f + gnuradio.wxgui.scopesink2.scope_sink_c + gnuradio.wxgui.scopesink2.scope_sink_f + gnuradio.wxgui.waterfallsink2.waterfall_sink_c + gnuradio.wxgui.waterfallsink2.waterfall_sink_f diff --git a/gr-digital/include/digital_cma_equalizer_cc.h b/gr-digital/include/digital_cma_equalizer_cc.h index 0d703789a..79e84ca4b 100644 --- a/gr-digital/include/digital_cma_equalizer_cc.h +++ b/gr-digital/include/digital_cma_equalizer_cc.h @@ -41,9 +41,9 @@ digital_make_cma_equalizer_cc(int num_taps, float modulus, float mu, int sps); * * The error value and tap update equations (for p=2) can be found in: * - * D. Godard, "Self-Recovering Equalization and Carrier Tracking in + * "D. Godard, "Self-Recovering Equalization and Carrier Tracking in * Two-Dimensional Data Communication Systems," IEEE Transactions on - * Communications, Vol. 28, No. 11, pp. 1867 - 1875, 1980, + * Communications, Vol. 28, No. 11, pp. 1867 - 1875, 1980." */ class DIGITAL_API digital_cma_equalizer_cc : public gr_adaptive_fir_ccc { diff --git a/gr-digital/include/digital_constellation_receiver_cb.h b/gr-digital/include/digital_constellation_receiver_cb.h index 8547bdd68..3a14bb5de 100644 --- a/gr-digital/include/digital_constellation_receiver_cb.h +++ b/gr-digital/include/digital_constellation_receiver_cb.h @@ -60,9 +60,9 @@ digital_make_constellation_receiver_cb (digital_constellation_sptr constellation * The symbol synchronization is done using a modified Mueller and * Muller circuit from the paper: * - * G. R. Danesfahani, T.G. Jeans, "Optimisation of modified Mueller - * and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22 - * June 1995, pp. 1032 - 1033. + * "G. R. Danesfahani, T.G. Jeans, "Optimisation of modified Mueller + * and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22 + * June 1995, pp. 1032 - 1033." * * This circuit interpolates the downconverted sample (using the NCO * developed by the Costas loop) every mu samples, then it finds the diff --git a/gr-digital/include/digital_fll_band_edge_cc.h b/gr-digital/include/digital_fll_band_edge_cc.h index f07d7ba42..c70bfc86d 100644 --- a/gr-digital/include/digital_fll_band_edge_cc.h +++ b/gr-digital/include/digital_fll_band_edge_cc.h @@ -65,8 +65,8 @@ DIGITAL_API digital_fll_band_edge_cc_sptr digital_make_fll_band_edge_cc (float s * abs(x_l(t))^2 - abs(x_u(t))^2 = norm(x_l(t)) - norm(x_u(t)). * * In theory, the band-edge filter is the derivative of the matched - * filter in frequency, (H_be(f) = \\frac{H(f)}{df}. In practice, this - * comes down to a quarter sine wave at the point of the matched + * filter in frequency, (H_be(f) = frac{H(f)}{df}). In practice, + * this comes down to a quarter sine wave at the point of the matched * filter's rolloff (if it's a raised-cosine, the derivative of a * cosine is a sine). Extend this sine by another quarter wave to * make a half wave around the band-edges is equivalent in time to the diff --git a/gr-digital/include/digital_kurtotic_equalizer_cc.h b/gr-digital/include/digital_kurtotic_equalizer_cc.h index 3ac8712d5..fed88c374 100644 --- a/gr-digital/include/digital_kurtotic_equalizer_cc.h +++ b/gr-digital/include/digital_kurtotic_equalizer_cc.h @@ -39,9 +39,9 @@ digital_make_kurtotic_equalizer_cc(int num_taps, float mu); * \ingroup eq_blk * \ingroup digital * - * Y. Guo, J. Zhao, Y. Sun, "Sign kurtosis maximization based blind + * "Y. Guo, J. Zhao, Y. Sun, "Sign kurtosis maximization based blind * equalization algorithm," IEEE Conf. on Control, Automation, - * Robotics and Vision, Vol. 3, Dec. 2004, pp. 2052 - 2057. + * Robotics and Vision, Vol. 3, Dec. 2004, pp. 2052 - 2057." */ class DIGITAL_API digital_kurtotic_equalizer_cc : public gr_adaptive_fir_ccc { diff --git a/gr-digital/include/digital_mpsk_receiver_cc.h b/gr-digital/include/digital_mpsk_receiver_cc.h index 02cea8d25..1f11a26b6 100644 --- a/gr-digital/include/digital_mpsk_receiver_cc.h +++ b/gr-digital/include/digital_mpsk_receiver_cc.h @@ -65,10 +65,10 @@ digital_make_mpsk_receiver_cc (unsigned int M, float theta, * * The symbol synchronization is done using a modified Mueller and * Muller circuit from the paper: - * - * G. R. Danesfahani, T.G. Jeans, "Optimisation of modified Mueller - * and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22 - * June 1995, pp. 1032 - 1033. + * + * "G. R. Danesfahani, T. G. Jeans, "Optimisation of modified Mueller + * and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22 + * June 1995, pp. 1032 - 1033." * * This circuit interpolates the downconverted sample (using the NCO * developed by the Costas loop) every mu samples, then it finds the |