From c20750224181fd4fbc410fb29d2b4c8156ae23d8 Mon Sep 17 00:00:00 2001 From: fdiblen Date: Thu, 16 Nov 2017 11:49:41 +0100 Subject: [PATCH] added docstrings to functions. This should really be reviewed by developers to add proper text. Some funstions are still missing docstrings. added docs folder moved the tutorial to tutorial folder changed tutorial link in README.md and added link to the docs --- README.md | 6 +- docs/Makefile | 241 +++++++++++++++ docs/build_doc.sh | 7 + docs/conf.py | 195 ++++++++++++ docs/index.rst | 21 ++ docs/make.bat | 284 ++++++++++++++++++ docs/pymicmac.logsparser.get_campari_nums.rst | 7 + ...ymicmac.logsparser.get_gcpbascule_nums.rst | 7 + docs/pymicmac.logsparser.get_homol_diffs.rst | 7 + docs/pymicmac.logsparser.get_redtiep_nums.rst | 7 + docs/pymicmac.logsparser.get_tapas_nums.rst | 7 + docs/pymicmac.logsparser.rst | 19 ++ ...pymicmac.logsplotter.plot_campari_nums.rst | 7 + ...icmac.logsplotter.plot_gcpbascule_nums.rst | 7 + docs/pymicmac.logsplotter.plot_gcps.rst | 7 + docs/pymicmac.logsplotter.plot_tiep.rst | 7 + docs/pymicmac.logsplotter.rst | 18 ++ .../pymicmac.noodles.noodles_exe_parallel.rst | 7 + docs/pymicmac.noodles.rst | 15 + ...arcommands_config_file_convert_ply_laz.rst | 7 + docs/pymicmac.pointcloud.rst | 15 + docs/pymicmac.rst | 26 ++ docs/pymicmac.utils_execution.rst | 7 + ...atching.create_parcommands_config_file.rst | 7 + ...pymicmac.workflow.distributed_matching.rst | 15 + ...oca.combine_distributed_tapioca_output.rst | 7 + ...ed_tapioca.create_all_image_pairs_file.rst | 7 + ...tapioca.create_parcommands_config_file.rst | 7 + .../pymicmac.workflow.distributed_tapioca.rst | 17 ++ docs/pymicmac.workflow.rst | 23 ++ docs/pymicmac.workflow.run_workflow.rst | 7 + pymicmac/noodles/noodles_exe_parallel.py | 16 + ...parcommands_config_file_convert_ply_laz.py | 26 +- pymicmac/utils_execution.py | 15 +- .../create_parcommands_config_file.py | 40 ++- .../combine_distributed_tapioca_output.py | 18 +- .../create_all_image_pairs_file.py | 17 +- .../create_parcommands_config_file.py | 21 +- pymicmac/workflow/run_workflow.py | 10 +- {docs => tutorial}/TUTORIAL.md | 0 {docs => tutorial}/distmatching_example.png | Bin 41 files changed, 1171 insertions(+), 13 deletions(-) create mode 100644 docs/Makefile create mode 100755 docs/build_doc.sh create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat create mode 100644 docs/pymicmac.logsparser.get_campari_nums.rst create mode 100644 docs/pymicmac.logsparser.get_gcpbascule_nums.rst create mode 100644 docs/pymicmac.logsparser.get_homol_diffs.rst create mode 100644 docs/pymicmac.logsparser.get_redtiep_nums.rst create mode 100644 docs/pymicmac.logsparser.get_tapas_nums.rst create mode 100644 docs/pymicmac.logsparser.rst create mode 100644 docs/pymicmac.logsplotter.plot_campari_nums.rst create mode 100644 docs/pymicmac.logsplotter.plot_gcpbascule_nums.rst create mode 100644 docs/pymicmac.logsplotter.plot_gcps.rst create mode 100644 docs/pymicmac.logsplotter.plot_tiep.rst create mode 100644 docs/pymicmac.logsplotter.rst create mode 100644 docs/pymicmac.noodles.noodles_exe_parallel.rst create mode 100644 docs/pymicmac.noodles.rst create mode 100644 docs/pymicmac.pointcloud.create_parcommands_config_file_convert_ply_laz.rst create mode 100644 docs/pymicmac.pointcloud.rst create mode 100644 docs/pymicmac.rst create mode 100644 docs/pymicmac.utils_execution.rst create mode 100644 docs/pymicmac.workflow.distributed_matching.create_parcommands_config_file.rst create mode 100644 docs/pymicmac.workflow.distributed_matching.rst create mode 100644 docs/pymicmac.workflow.distributed_tapioca.combine_distributed_tapioca_output.rst create mode 100644 docs/pymicmac.workflow.distributed_tapioca.create_all_image_pairs_file.rst create mode 100644 docs/pymicmac.workflow.distributed_tapioca.create_parcommands_config_file.rst create mode 100644 docs/pymicmac.workflow.distributed_tapioca.rst create mode 100644 docs/pymicmac.workflow.rst create mode 100644 docs/pymicmac.workflow.run_workflow.rst rename {docs => tutorial}/TUTORIAL.md (100%) rename {docs => tutorial}/distmatching_example.png (100%) diff --git a/README.md b/README.md index 17548cf..3ad6486 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The `micmac-run-workflow` tool uses the sequential commands execution tool of [` In section [Large image sets](#large-image-sets) we provide some tips on how to use `MicMac` and `pymicmac` for processing large image sets using distributed computing for the tie-points extraction and the dense image matching, and tie-points reduction for the bundle block adjustment. -A step-by-step tutorial is also available in [Tutorial](https://github.com/ImproPhoto/pymicmac/tree/master/docs/TUTORIAL.md). +A step-by-step tutorial is also available in [Tutorial](https://github.com/ImproPhoto/pymicmac/tree/master/tutorial/TUTORIAL.md). ## Installation @@ -59,6 +59,10 @@ Other Python dependencies (numpy, tabulate, matplotlib, lxml) are automatically For now `pymicmac` works only in Linux systems. Requires Python 3.5. +## API Documentation + +Autogenerated API documentation is available. [API Docs](https://github.com/ImproPhoto/pymicmac/tree/master/docs/_build/html/index.html). + ## Instructions The tool `micmac-run-workflow` is used to execute entire photogrammetric workflows with MicMac or portions of it. We recommend splitting the workflow in three pieces: (1) tie-points extraction, (2) bundle block adjustment and (3) dense image matching. Each time the tool is executed, it creates an independent execution folder to isolate the processing from the input data. The tool can be executed as a python script (see example in `tests/run_workflow_test.sh`) or can be imported as a python module. Which MicMac commands are executed is specified with a XML configuration file. diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..75a38a6 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,241 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +PAPER ?= +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_elements.papersize=a4 +PAPEROPT_letter = -D latex_elements.papersize=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and an HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " epub3 to make an epub3" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " lualatexpdf to make LaTeX files and run them through lualatex" + @echo " xelatexpdf to make LaTeX files and run them through xelatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" + @echo " dummy to check syntax errors of document sources" + +.PHONY: clean +clean: + rm -rf $(BUILDDIR)/* + +.PHONY: html +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +.PHONY: dirhtml +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +.PHONY: singlehtml +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +.PHONY: pickle +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +.PHONY: json +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +.PHONY: htmlhelp +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +.PHONY: qthelp +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pymicmac.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pymicmac.qhc" + +.PHONY: applehelp +applehelp: + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in" \ + "~/Library/Documentation/Help or install it in your application" \ + "bundle." + +.PHONY: devhelp +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/pymicmac" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pymicmac" + @echo "# devhelp" + +.PHONY: epub +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +.PHONY: epub3 +epub3: + $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 + @echo + @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." + +.PHONY: latex +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +.PHONY: latexpdf +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: latexpdfja +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: lualatexpdf +lualatexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through lualatex..." + $(MAKE) PDFLATEX=lualatex -C $(BUILDDIR)/latex all-pdf + @echo "lualatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: xelatexpdf +xelatexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through xelatex..." + $(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex all-pdf + @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: text +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +.PHONY: man +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +.PHONY: texinfo +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +.PHONY: info +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +.PHONY: gettext +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +.PHONY: changes +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +.PHONY: linkcheck +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +.PHONY: doctest +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +.PHONY: coverage +coverage: + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the " \ + "results in $(BUILDDIR)/coverage/python.txt." + +.PHONY: xml +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +.PHONY: pseudoxml +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." + +.PHONY: dummy +dummy: + $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy + @echo + @echo "Build finished. Dummy builder generates no files." diff --git a/docs/build_doc.sh b/docs/build_doc.sh new file mode 100755 index 0000000..57e1030 --- /dev/null +++ b/docs/build_doc.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +sphinx-apidoc --ext-githubpages --ext-viewcode --ext-coverage --ext-doctest --ext-autodoc \ + -R "1.0.1" -A "NLeSC" -F -M -e -d 8 \ + -o . \ + ../pymicmac + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..202b9ae --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,195 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# pymicmac documentation build configuration file, created by +# sphinx-quickstart on Thu Nov 16 11:39:24 2017. +# +# 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. + +# 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. +# +# import os +# import sys +# sys.path.insert(0, '/home/fdiblen/code/nlesc/teamproject/teamproject_2/pymicmac/pymicmac') + + +# -- 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.todo', + 'sphinx.ext.coverage', + 'sphinx.ext.viewcode', + 'sphinx.ext.githubpages'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'pymicmac' +copyright = '2017, NLeSC' +author = 'NLeSC' + +# 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 = '' +# The full version, including alpha/beta/rc tags. +release = '1.0.1' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- 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 = 'alabaster' + +# 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 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'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# This is required for the alabaster theme +# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars +html_sidebars = { + '**': [ + 'relations.html', # needs 'show_related': True theme option to display + 'searchbox.html', + ] +} + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'pymicmacdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'pymicmac.tex', 'pymicmac Documentation', + 'NLeSC', 'manual'), +] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'pymicmac', 'pymicmac Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'pymicmac', 'pymicmac Documentation', + author, 'pymicmac', 'One line description of project.', + 'Miscellaneous'), +] + + + +# -- Options for Epub output ---------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project +epub_author = author +epub_publisher = author +epub_copyright = copyright + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + + diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..946dcea --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,21 @@ +.. pymicmac documentation master file, created by + sphinx-quickstart on Thu Nov 16 11:39:24 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to pymicmac's documentation! +==================================== + +.. toctree:: + :maxdepth: 8 + :caption: Contents: + + pymicmac + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..1b37852 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,284 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +pushd %~dp0 + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_elements.papersize=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_elements.papersize=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and an HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. epub3 to make an epub3 + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. xml to make Docutils-native XML files + echo. pseudoxml to make pseudoxml-XML files for display purposes + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + echo. coverage to run coverage check of the documentation if enabled + echo. dummy to check syntax errors of document sources + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +REM Check if sphinx-build is available and fallback to Python version if any +%SPHINXBUILD% 1>NUL 2>NUL +if errorlevel 9009 goto sphinx_python +goto sphinx_ok + +:sphinx_python + +set SPHINXBUILD=python -m sphinx.__init__ +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +:sphinx_ok + + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\pymicmac.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\pymicmac.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "epub3" ( + %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3 + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub3 file is in %BUILDDIR%/epub3. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "coverage" ( + %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage + if errorlevel 1 exit /b 1 + echo. + echo.Testing of coverage in the sources finished, look at the ^ +results in %BUILDDIR%/coverage/python.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +if "%1" == "dummy" ( + %SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. Dummy builder generates no files. + goto end +) + +:end +popd diff --git a/docs/pymicmac.logsparser.get_campari_nums.rst b/docs/pymicmac.logsparser.get_campari_nums.rst new file mode 100644 index 0000000..67a9a6c --- /dev/null +++ b/docs/pymicmac.logsparser.get_campari_nums.rst @@ -0,0 +1,7 @@ +pymicmac\.logsparser\.get\_campari\_nums module +=============================================== + +.. automodule:: pymicmac.logsparser.get_campari_nums + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.logsparser.get_gcpbascule_nums.rst b/docs/pymicmac.logsparser.get_gcpbascule_nums.rst new file mode 100644 index 0000000..0abce9f --- /dev/null +++ b/docs/pymicmac.logsparser.get_gcpbascule_nums.rst @@ -0,0 +1,7 @@ +pymicmac\.logsparser\.get\_gcpbascule\_nums module +================================================== + +.. automodule:: pymicmac.logsparser.get_gcpbascule_nums + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.logsparser.get_homol_diffs.rst b/docs/pymicmac.logsparser.get_homol_diffs.rst new file mode 100644 index 0000000..561c8af --- /dev/null +++ b/docs/pymicmac.logsparser.get_homol_diffs.rst @@ -0,0 +1,7 @@ +pymicmac\.logsparser\.get\_homol\_diffs module +============================================== + +.. automodule:: pymicmac.logsparser.get_homol_diffs + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.logsparser.get_redtiep_nums.rst b/docs/pymicmac.logsparser.get_redtiep_nums.rst new file mode 100644 index 0000000..432c1c7 --- /dev/null +++ b/docs/pymicmac.logsparser.get_redtiep_nums.rst @@ -0,0 +1,7 @@ +pymicmac\.logsparser\.get\_redtiep\_nums module +=============================================== + +.. automodule:: pymicmac.logsparser.get_redtiep_nums + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.logsparser.get_tapas_nums.rst b/docs/pymicmac.logsparser.get_tapas_nums.rst new file mode 100644 index 0000000..6bb5fc0 --- /dev/null +++ b/docs/pymicmac.logsparser.get_tapas_nums.rst @@ -0,0 +1,7 @@ +pymicmac\.logsparser\.get\_tapas\_nums module +============================================= + +.. automodule:: pymicmac.logsparser.get_tapas_nums + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.logsparser.rst b/docs/pymicmac.logsparser.rst new file mode 100644 index 0000000..7bb773e --- /dev/null +++ b/docs/pymicmac.logsparser.rst @@ -0,0 +1,19 @@ +pymicmac\.logsparser package +============================ + +.. automodule:: pymicmac.logsparser + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + pymicmac.logsparser.get_campari_nums + pymicmac.logsparser.get_gcpbascule_nums + pymicmac.logsparser.get_homol_diffs + pymicmac.logsparser.get_redtiep_nums + pymicmac.logsparser.get_tapas_nums + diff --git a/docs/pymicmac.logsplotter.plot_campari_nums.rst b/docs/pymicmac.logsplotter.plot_campari_nums.rst new file mode 100644 index 0000000..3025b5e --- /dev/null +++ b/docs/pymicmac.logsplotter.plot_campari_nums.rst @@ -0,0 +1,7 @@ +pymicmac\.logsplotter\.plot\_campari\_nums module +================================================= + +.. automodule:: pymicmac.logsplotter.plot_campari_nums + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.logsplotter.plot_gcpbascule_nums.rst b/docs/pymicmac.logsplotter.plot_gcpbascule_nums.rst new file mode 100644 index 0000000..1a8f2ec --- /dev/null +++ b/docs/pymicmac.logsplotter.plot_gcpbascule_nums.rst @@ -0,0 +1,7 @@ +pymicmac\.logsplotter\.plot\_gcpbascule\_nums module +==================================================== + +.. automodule:: pymicmac.logsplotter.plot_gcpbascule_nums + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.logsplotter.plot_gcps.rst b/docs/pymicmac.logsplotter.plot_gcps.rst new file mode 100644 index 0000000..7f4c1c2 --- /dev/null +++ b/docs/pymicmac.logsplotter.plot_gcps.rst @@ -0,0 +1,7 @@ +pymicmac\.logsplotter\.plot\_gcps module +======================================== + +.. automodule:: pymicmac.logsplotter.plot_gcps + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.logsplotter.plot_tiep.rst b/docs/pymicmac.logsplotter.plot_tiep.rst new file mode 100644 index 0000000..262f46f --- /dev/null +++ b/docs/pymicmac.logsplotter.plot_tiep.rst @@ -0,0 +1,7 @@ +pymicmac\.logsplotter\.plot\_tiep module +======================================== + +.. automodule:: pymicmac.logsplotter.plot_tiep + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.logsplotter.rst b/docs/pymicmac.logsplotter.rst new file mode 100644 index 0000000..cd19a27 --- /dev/null +++ b/docs/pymicmac.logsplotter.rst @@ -0,0 +1,18 @@ +pymicmac\.logsplotter package +============================= + +.. automodule:: pymicmac.logsplotter + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + pymicmac.logsplotter.plot_campari_nums + pymicmac.logsplotter.plot_gcpbascule_nums + pymicmac.logsplotter.plot_gcps + pymicmac.logsplotter.plot_tiep + diff --git a/docs/pymicmac.noodles.noodles_exe_parallel.rst b/docs/pymicmac.noodles.noodles_exe_parallel.rst new file mode 100644 index 0000000..03324f2 --- /dev/null +++ b/docs/pymicmac.noodles.noodles_exe_parallel.rst @@ -0,0 +1,7 @@ +pymicmac\.noodles\.noodles\_exe\_parallel module +================================================ + +.. automodule:: pymicmac.noodles.noodles_exe_parallel + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.noodles.rst b/docs/pymicmac.noodles.rst new file mode 100644 index 0000000..7dac96d --- /dev/null +++ b/docs/pymicmac.noodles.rst @@ -0,0 +1,15 @@ +pymicmac\.noodles package +========================= + +.. automodule:: pymicmac.noodles + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + pymicmac.noodles.noodles_exe_parallel + diff --git a/docs/pymicmac.pointcloud.create_parcommands_config_file_convert_ply_laz.rst b/docs/pymicmac.pointcloud.create_parcommands_config_file_convert_ply_laz.rst new file mode 100644 index 0000000..8e2b11c --- /dev/null +++ b/docs/pymicmac.pointcloud.create_parcommands_config_file_convert_ply_laz.rst @@ -0,0 +1,7 @@ +pymicmac\.pointcloud\.create\_parcommands\_config\_file\_convert\_ply\_laz module +================================================================================= + +.. automodule:: pymicmac.pointcloud.create_parcommands_config_file_convert_ply_laz + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.pointcloud.rst b/docs/pymicmac.pointcloud.rst new file mode 100644 index 0000000..4faa25b --- /dev/null +++ b/docs/pymicmac.pointcloud.rst @@ -0,0 +1,15 @@ +pymicmac\.pointcloud package +============================ + +.. automodule:: pymicmac.pointcloud + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + pymicmac.pointcloud.create_parcommands_config_file_convert_ply_laz + diff --git a/docs/pymicmac.rst b/docs/pymicmac.rst new file mode 100644 index 0000000..9e97c6c --- /dev/null +++ b/docs/pymicmac.rst @@ -0,0 +1,26 @@ +pymicmac package +================ + +.. automodule:: pymicmac + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + pymicmac.logsparser + pymicmac.logsplotter + pymicmac.noodles + pymicmac.pointcloud + pymicmac.workflow + +Submodules +---------- + +.. toctree:: + + pymicmac.utils_execution + diff --git a/docs/pymicmac.utils_execution.rst b/docs/pymicmac.utils_execution.rst new file mode 100644 index 0000000..94ef02c --- /dev/null +++ b/docs/pymicmac.utils_execution.rst @@ -0,0 +1,7 @@ +pymicmac\.utils\_execution module +================================= + +.. automodule:: pymicmac.utils_execution + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.workflow.distributed_matching.create_parcommands_config_file.rst b/docs/pymicmac.workflow.distributed_matching.create_parcommands_config_file.rst new file mode 100644 index 0000000..18bd702 --- /dev/null +++ b/docs/pymicmac.workflow.distributed_matching.create_parcommands_config_file.rst @@ -0,0 +1,7 @@ +pymicmac\.workflow\.distributed\_matching\.create\_parcommands\_config\_file module +=================================================================================== + +.. automodule:: pymicmac.workflow.distributed_matching.create_parcommands_config_file + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.workflow.distributed_matching.rst b/docs/pymicmac.workflow.distributed_matching.rst new file mode 100644 index 0000000..f66865e --- /dev/null +++ b/docs/pymicmac.workflow.distributed_matching.rst @@ -0,0 +1,15 @@ +pymicmac\.workflow\.distributed\_matching package +================================================= + +.. automodule:: pymicmac.workflow.distributed_matching + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + pymicmac.workflow.distributed_matching.create_parcommands_config_file + diff --git a/docs/pymicmac.workflow.distributed_tapioca.combine_distributed_tapioca_output.rst b/docs/pymicmac.workflow.distributed_tapioca.combine_distributed_tapioca_output.rst new file mode 100644 index 0000000..8649542 --- /dev/null +++ b/docs/pymicmac.workflow.distributed_tapioca.combine_distributed_tapioca_output.rst @@ -0,0 +1,7 @@ +pymicmac\.workflow\.distributed\_tapioca\.combine\_distributed\_tapioca\_output module +====================================================================================== + +.. automodule:: pymicmac.workflow.distributed_tapioca.combine_distributed_tapioca_output + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.workflow.distributed_tapioca.create_all_image_pairs_file.rst b/docs/pymicmac.workflow.distributed_tapioca.create_all_image_pairs_file.rst new file mode 100644 index 0000000..f3ff448 --- /dev/null +++ b/docs/pymicmac.workflow.distributed_tapioca.create_all_image_pairs_file.rst @@ -0,0 +1,7 @@ +pymicmac\.workflow\.distributed\_tapioca\.create\_all\_image\_pairs\_file module +================================================================================ + +.. automodule:: pymicmac.workflow.distributed_tapioca.create_all_image_pairs_file + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.workflow.distributed_tapioca.create_parcommands_config_file.rst b/docs/pymicmac.workflow.distributed_tapioca.create_parcommands_config_file.rst new file mode 100644 index 0000000..68450a7 --- /dev/null +++ b/docs/pymicmac.workflow.distributed_tapioca.create_parcommands_config_file.rst @@ -0,0 +1,7 @@ +pymicmac\.workflow\.distributed\_tapioca\.create\_parcommands\_config\_file module +================================================================================== + +.. automodule:: pymicmac.workflow.distributed_tapioca.create_parcommands_config_file + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/pymicmac.workflow.distributed_tapioca.rst b/docs/pymicmac.workflow.distributed_tapioca.rst new file mode 100644 index 0000000..cebff9d --- /dev/null +++ b/docs/pymicmac.workflow.distributed_tapioca.rst @@ -0,0 +1,17 @@ +pymicmac\.workflow\.distributed\_tapioca package +================================================ + +.. automodule:: pymicmac.workflow.distributed_tapioca + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + pymicmac.workflow.distributed_tapioca.combine_distributed_tapioca_output + pymicmac.workflow.distributed_tapioca.create_all_image_pairs_file + pymicmac.workflow.distributed_tapioca.create_parcommands_config_file + diff --git a/docs/pymicmac.workflow.rst b/docs/pymicmac.workflow.rst new file mode 100644 index 0000000..0653e11 --- /dev/null +++ b/docs/pymicmac.workflow.rst @@ -0,0 +1,23 @@ +pymicmac\.workflow package +========================== + +.. automodule:: pymicmac.workflow + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + pymicmac.workflow.distributed_matching + pymicmac.workflow.distributed_tapioca + +Submodules +---------- + +.. toctree:: + + pymicmac.workflow.run_workflow + diff --git a/docs/pymicmac.workflow.run_workflow.rst b/docs/pymicmac.workflow.run_workflow.rst new file mode 100644 index 0000000..2feb67d --- /dev/null +++ b/docs/pymicmac.workflow.run_workflow.rst @@ -0,0 +1,7 @@ +pymicmac\.workflow\.run\_workflow module +======================================== + +.. automodule:: pymicmac.workflow.run_workflow + :members: + :undoc-members: + :show-inheritance: diff --git a/pymicmac/noodles/noodles_exe_parallel.py b/pymicmac/noodles/noodles_exe_parallel.py index 64d08cf..c20a4b3 100755 --- a/pymicmac/noodles/noodles_exe_parallel.py +++ b/pymicmac/noodles/noodles_exe_parallel.py @@ -36,7 +36,18 @@ def log_job_schedule(key, job): class Job: + def __init__(self, task, exclude, state, job, key): + """ + Noodles Job class. + + :param param1: task + :param param2: exclude + :param param3: state + :param param3: job + :param param3: key + :returns: None + """ self.task = task self.exclude = exclude self.state = state @@ -182,6 +193,11 @@ def runNoodles(jsonFile, logFolder, numThreads): def main(): + """ + Main function to run the Noodles job. + + :returns: None + """ parser = argparse.ArgumentParser( description="SOBA: Run a non-directional exclusion graph job.") parser.add_argument( diff --git a/pymicmac/pointcloud/create_parcommands_config_file_convert_ply_laz.py b/pymicmac/pointcloud/create_parcommands_config_file_convert_ply_laz.py index 13bfdb6..418be2e 100644 --- a/pymicmac/pointcloud/create_parcommands_config_file_convert_ply_laz.py +++ b/pymicmac/pointcloud/create_parcommands_config_file_convert_ply_laz.py @@ -9,13 +9,25 @@ def chunks(l, n): - """Yield successive n-sized chunks from l.""" + """ + Yield successive n-sized chunks from l. + """ for i in range(0, len(l), n): yield l[i:i + n] def run(inputFolder, outputFile, outputFormat, outputFolder, num): - # Check user parameters + """ + Check user parameters. + + :param param1: inputFolder + :param param2: outputFile + :param param3: outputFormat + :param param4: outputFolder + :param param5: num + + :returns: None + """ if not os.path.isdir(inputFolder): raise Exception(inputFolder + ' does not exist') # Check output file and folder @@ -120,7 +132,11 @@ def run(inputFolder, outputFile, outputFormat, outputFolder, num): def argument_parser(): - # define argument menu + """ + Define argument menu. + + :returns: parser + """ description = "Creates a 2-level pycoeman XML parallel commands configuration file to convert a bunch of ply files into laz/laz using PDAL. The second level is executed with coeman-par-local." parser = argparse.ArgumentParser(description=description) # fill argument groups @@ -163,6 +179,10 @@ def argument_parser(): def main(): + """ + The main workflow function. Uses the parsed arguments. + + """ try: a = utils_execution.apply_argument_parser(argument_parser()) run(a.input, a.output, a.format, a.folder, a.num) diff --git a/pymicmac/utils_execution.py b/pymicmac/utils_execution.py index 7be0a37..046dcb6 100755 --- a/pymicmac/utils_execution.py +++ b/pymicmac/utils_execution.py @@ -28,6 +28,13 @@ def readGCPXMLFile(xmlFile): def getSize(absPath): + """ + Get file size. + + :param param1: absPath + :returns: file size + :raises BaseException: raises an exception + """ (out, err) = subprocess.Popen('du -sb ' + absPath, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() try: @@ -37,7 +44,13 @@ def getSize(absPath): def apply_argument_parser(argumentsParser, options=None): - """ Apply the argument parser. """ + """ + Apply the argument parser. + + :param param1: argumentsParser + :param param2: options + """ + if options is not None: args = argumentsParser.parse_args(options) else: diff --git a/pymicmac/workflow/distributed_matching/create_parcommands_config_file.py b/pymicmac/workflow/distributed_matching/create_parcommands_config_file.py index c45164f..3e50b06 100644 --- a/pymicmac/workflow/distributed_matching/create_parcommands_config_file.py +++ b/pymicmac/workflow/distributed_matching/create_parcommands_config_file.py @@ -9,6 +9,20 @@ def getTileIndex(pX, pY, minX, minY, maxX, maxY, nX, nY): + """ + Calculates the position of tile. + + :param param1: pX + :param param2: pY + :param param3: minX + :param param4: minY + :param param5: maxX + :param param6: maxY + :param param7: nX + :param param8: nY + :returns: xpos, ypos + """ + xpos = int((pX - minX) * nX / (maxX - minX)) ypos = int((pY - minY) * nY / (maxY - minY)) # If it is in the edge of the box (in the maximum side) we need to put in @@ -22,7 +36,20 @@ def getTileIndex(pX, pY, minX, minY, maxX, maxY, nX, nY): def run(orientationFolder, homolFolder, imagesFormat, numNeighbours, outputFile, outputFolder, num, maltOptions): - # Check user parameters + """ + Check user parameters. + + :param param1: orientationFolder + :param param2: homolFolder + :param param3: imagesFormat + :param param4: numNeighbours + :param param5: outputFile + :param param6: outputFolder + :param param7: num + :param param8: maltOptions + + :returns: None + """ if not os.path.isdir(orientationFolder): raise Exception(orientationFolder + ' does not exist') includeHomol = homolFolder != '' @@ -186,7 +213,11 @@ def run(orientationFolder, homolFolder, imagesFormat, def argument_parser(): - # define argument menu + """ + Define argument menu. + + :returns: parser + """ description = "Distributed solution for matching, i.e. point cloud generation from images and orientation. Splits the matching of a large area in the matching of many tiles. IMPORTANT: only use for images oriented in cartographic reference systems (tiling is done assuming Z is zenith), ideally for aerial images." parser = argparse.ArgumentParser(description=description) # fill argument groups @@ -248,6 +279,11 @@ def argument_parser(): def main(): + """ + The main workflow function. Uses the parsed arguments. + + """ + try: a = utils_execution.apply_argument_parser(argument_parser()) run(a.inputOrientation, a.inputHomol, a.format, diff --git a/pymicmac/workflow/distributed_tapioca/combine_distributed_tapioca_output.py b/pymicmac/workflow/distributed_tapioca/combine_distributed_tapioca_output.py index 981fb79..1ffda2d 100755 --- a/pymicmac/workflow/distributed_tapioca/combine_distributed_tapioca_output.py +++ b/pymicmac/workflow/distributed_tapioca/combine_distributed_tapioca_output.py @@ -5,7 +5,13 @@ def run(inputFolder, outputFolder): - # Run Tapioca command + """ + Runs Tapioca command. + + :param param1: inputFolder + :param param2: outputFolder + :returns: None + """ if os.path.isdir(outputFolder): raise Exception(outputFolder + ' already exists!') os.makedirs(outputFolder) @@ -27,7 +33,12 @@ def run(inputFolder, outputFolder): def argument_parser(): - # define argument menu + """ + Defines argument menu. + + :returns: parser + """ + description = "Combine Homol folders into single one. To be run after a distributed Tapioca" parser = argparse.ArgumentParser(description=description) # fill argument groups @@ -49,6 +60,9 @@ def argument_parser(): def main(): + """ + The main workflow function. Uses the parsed arguments. + """ try: a = utils_execution.apply_argument_parser(argument_parser()) run(a.inputFolder, a.outputFolder) diff --git a/pymicmac/workflow/distributed_tapioca/create_all_image_pairs_file.py b/pymicmac/workflow/distributed_tapioca/create_all_image_pairs_file.py index 4d29e94..9d2199c 100644 --- a/pymicmac/workflow/distributed_tapioca/create_all_image_pairs_file.py +++ b/pymicmac/workflow/distributed_tapioca/create_all_image_pairs_file.py @@ -5,6 +5,14 @@ def run(inputFolder, imageFormat, outputFile): + """ + Generates a XML file for the images in given folder. + + :param param1: inputFolder + :param param2: imageFormat + :param param2: outputFile + :returns: None + """ # Check user parameters if not os.path.isdir(inputFolder): raise Exception(inputFolder + " does not exist! (or is not a folder)") @@ -40,7 +48,11 @@ def run(inputFolder, imageFormat, outputFile): def argument_parser(): - # define argument menu + """ + Defines argument menu. + + :returns: parser + """ description = "Creates a valid image pairs file suitable for Tapioca (to run with option File). Every possible image pair is added" parser = argparse.ArgumentParser(description=description) # fill argument groups @@ -69,6 +81,9 @@ def argument_parser(): def main(): + """ + The main workflow function. Uses the parsed arguments. + """ try: a = utils_execution.apply_argument_parser(argument_parser()) run(a.input, a.format, a.output) diff --git a/pymicmac/workflow/distributed_tapioca/create_parcommands_config_file.py b/pymicmac/workflow/distributed_tapioca/create_parcommands_config_file.py index 0d9cc8c..225925a 100644 --- a/pymicmac/workflow/distributed_tapioca/create_parcommands_config_file.py +++ b/pymicmac/workflow/distributed_tapioca/create_parcommands_config_file.py @@ -7,7 +7,15 @@ def run(inputFile, outputFile, outputFolder, num): - # Check user parameters + """ + Checks the user parameters for distributed tapioca. + + :param param1: inputFile + :param param2: outputFile + :param param3: outputFolder + :param param4: num + :returns: None + """ if not os.path.isfile(inputFile): raise Exception(inputFile + ' does not exist') if os.path.isfile(outputFile): @@ -143,7 +151,11 @@ def run(inputFile, outputFile, outputFolder, num): def argument_parser(): - # define argument menu + """ + Defines the argument menu + + :returns: parser + """ description = "Splits a valid image pairs file suitable for Tapioca into chunks. For each chunk, it adds a component in a pycomean parallel commands XML configuration file, and it stores in a parallel configuration folder the information of the chunk " parser = argparse.ArgumentParser(description=description) # fill argument groups @@ -179,6 +191,11 @@ def argument_parser(): def main(): + """ + The main function. Uses the parsed arguments. + + :returns: None + """ try: a = utils_execution.apply_argument_parser(argument_parser()) run(a.input, a.output, a.folder, a.num) diff --git a/pymicmac/workflow/run_workflow.py b/pymicmac/workflow/run_workflow.py index 2d7d9b2..e79b381 100644 --- a/pymicmac/workflow/run_workflow.py +++ b/pymicmac/workflow/run_workflow.py @@ -5,7 +5,11 @@ def argument_parser(): - # define argument menu + """ + Define argument menu. + + :returns: parser + """ description = "Run a set of MicMac commands sequentially (one after the other). The commands are specified by a Worflow XML configuration file. During the execution of each command there is monitoring of the used CPU/MEM/disk by the system." parser = argparse.ArgumentParser(description=description) parser.add_argument( @@ -43,6 +47,10 @@ def argument_parser(): def main(): + """ + The main workflow function. Uses the parsed arguments. + + """ try: a = utils_execution.apply_argument_parser(argument_parser()) run_seqcommands_local.run( diff --git a/docs/TUTORIAL.md b/tutorial/TUTORIAL.md similarity index 100% rename from docs/TUTORIAL.md rename to tutorial/TUTORIAL.md diff --git a/docs/distmatching_example.png b/tutorial/distmatching_example.png similarity index 100% rename from docs/distmatching_example.png rename to tutorial/distmatching_example.png