diff options
Diffstat (limited to 'openEMS/python/doc')
33 files changed, 732 insertions, 0 deletions
diff --git a/openEMS/python/doc/Tutorials/Antenna_Tutorials.rst b/openEMS/python/doc/Tutorials/Antenna_Tutorials.rst new file mode 100644 index 0000000..4a5927a --- /dev/null +++ b/openEMS/python/doc/Tutorials/Antenna_Tutorials.rst @@ -0,0 +1,9 @@ +Antennas +-------- + +.. toctree:: + :maxdepth: 1 + + Simple_Patch_Antenna + Helical_Antenna + Bent_Patch_Antenna diff --git a/openEMS/python/doc/Tutorials/Bent_Patch_Antenna.rst b/openEMS/python/doc/Tutorials/Bent_Patch_Antenna.rst new file mode 100644 index 0000000..9582563 --- /dev/null +++ b/openEMS/python/doc/Tutorials/Bent_Patch_Antenna.rst @@ -0,0 +1,35 @@ +Bent Patch Antenna +================== + +* Setup & Simulate a bent patch antenna using a cylindrical mesh + +Introduction +------------- +**This tutorial covers:** + +* Setup of a Bent Patch Antenna (see for comparison: :ref:`simple_patch_antenna`) +* setup of a *cylindrical FDTD mesh*. +* Calculate the S-Parameter and input impedance +* Calculate far-field pattern 2D/3D + + +Python Script +------------- +Get the latest version `from git <http://www.openems.de/gitweb/?p=openEMS.git;a=blob_plain;f=matlab/Tutorials/Bent_Patch_Antenna.m;hb=refs/heads/master>`_. + +.. include:: ./__Bent_Patch_Antenna.txt + +Images +------------- +.. figure:: images/Bent_Patch.png + :width: 49% + :alt: alternate text + + 3D view of the Bent Patch Antenna (AppCSXCAD) + +.. figure:: images/Bent_Patch_Pattern.png + :width: 80% + :alt: Farfield pattern + + Farfield pattern on an xy- and xz-plane + diff --git a/openEMS/python/doc/Tutorials/CRLH_Extraction.rst b/openEMS/python/doc/Tutorials/CRLH_Extraction.rst new file mode 100644 index 0000000..156cf73 --- /dev/null +++ b/openEMS/python/doc/Tutorials/CRLH_Extraction.rst @@ -0,0 +1,40 @@ +CRLH Parameter Extraction +========================= + +* Setup a composite-right/left-handed (CRLH) unit cell and extract the equivalent circuit parameter. + +Introduction +------------- +**This tutorial covers:** + +* Setup a feeding mircostrip line & port +* Apply an inhomogeneous mesh used for improved accuracy and simulation speed +* Use an internal clss to setup a CRLH unit cell +* Use the port voltages and currents to extract the unit cell equivalent circuit parameter + +.. figure:: images/CRLH_cell.png + :width: 80% + :alt: CRLH unit cell with feeding MSL. + + CRLH unit cell with feeding MSL. + +Python Script +------------- +Get the latest version `from git <http://www.openems.de/gitweb/?p=openEMS.git;a=blob_plain;f=matlab/Tutorials/Bent_Patch_Antenna.m;hb=refs/heads/master>`_. + +.. include:: ./__CRLH_Extraction.txt + +Images +------------- + +.. figure:: images/CRLH_Spara.png + :width: 80% + :alt: CRLH cell S-parameter + + CRLH cell S-parameter + +.. figure:: images/CRLH_dispersion.png + :width: 80% + :alt: CRLH unit cell dispersion diagram + + CRLH unit cell dispersion diagram diff --git a/openEMS/python/doc/Tutorials/Helical_Antenna.rst b/openEMS/python/doc/Tutorials/Helical_Antenna.rst new file mode 100644 index 0000000..6a94081 --- /dev/null +++ b/openEMS/python/doc/Tutorials/Helical_Antenna.rst @@ -0,0 +1,32 @@ +Helical Antenna +=============== + +Introduction +------------- +**This tutorial covers:** + +* setup of a helix using the wire primitive +* setup a lumped feeding port (R_in = 120 Ohms) +* adding a near-field to far-field (nf2ff) box using an efficient subsampling +* calculate the S-Parameter of the antenna +* calculate and plot the far-field pattern + +Python Script +------------- +Get the latest version `from git <http://www.openems.de/gitweb/?p=openEMS.git;a=blob_plain;f=matlab/Tutorials/Helical_Antenna.m;hb=refs/heads/master>`_. + +.. include:: ./__Helical_Antenna.txt + +Images +------------- +.. figure:: images/Helix_Ant.png + :width: 49% + :alt: alternate text + + 3D view of the Helical Antenna (AppCSXCAD) + +.. figure:: images/Helix_Ant_Pattern.png + :width: 49% + :alt: alternate text + + Far-Field pattern showing a right-handed circular polarization. diff --git a/openEMS/python/doc/Tutorials/Intro_Tutorials.rst b/openEMS/python/doc/Tutorials/Intro_Tutorials.rst new file mode 100644 index 0000000..8126f33 --- /dev/null +++ b/openEMS/python/doc/Tutorials/Intro_Tutorials.rst @@ -0,0 +1,10 @@ +.. _intro_tutorials: + +Introductional Tutorials +------------------------ + + +.. toctree:: + + Rect_Waveguide + RCS_Sphere diff --git a/openEMS/python/doc/Tutorials/MSL_NotchFilter.rst b/openEMS/python/doc/Tutorials/MSL_NotchFilter.rst new file mode 100644 index 0000000..c84883e --- /dev/null +++ b/openEMS/python/doc/Tutorials/MSL_NotchFilter.rst @@ -0,0 +1,27 @@ +Microstrip Notch Filter +======================= + + * A straight MSL line with a open-ended stub to create a simple microwave filter. + +Introduction +------------- +**This tutorial covers:** + + +* Setup a mircostrip line (MSL) and MSL port +* Apply an inhomogeneous mesh used for improved accuracy and simulation speed +* Calculate the S-Parameter of the filter + +Python Script +------------- +Get the latest version `from git <http://openems.de/gitweb/?p=openEMS.git;a=blob_plain;f=matlab/Tutorials/MSL_NotchFilter.m;hb=HEAD>`_. + +.. include:: ./__MSL_NotchFilter.txt + +Images +------------- +.. figure:: images/Notch_Filter_SPara.png + :width: 49% + :alt: S-Parameter over Frequency + + S-Parameter over Frequency diff --git a/openEMS/python/doc/Tutorials/MicroWave_Tutorials.rst b/openEMS/python/doc/Tutorials/MicroWave_Tutorials.rst new file mode 100644 index 0000000..92fc0ce --- /dev/null +++ b/openEMS/python/doc/Tutorials/MicroWave_Tutorials.rst @@ -0,0 +1,10 @@ +.. _microwave_tutorials: + +Micro Wave Tutorials +-------------------- + + +.. toctree:: + + MSL_NotchFilter + CRLH_Extraction diff --git a/openEMS/python/doc/Tutorials/RCS_Sphere.rst b/openEMS/python/doc/Tutorials/RCS_Sphere.rst new file mode 100644 index 0000000..1cbced8 --- /dev/null +++ b/openEMS/python/doc/Tutorials/RCS_Sphere.rst @@ -0,0 +1,32 @@ +Metal Sphere Radar Cross Section +================================ + + * A 3D simulation demonstrating a the total-field/scattered-field approach on a metallic sphere with a RCS (radar cross section) calculation. + +Introduction +------------- +**This tutorial covers:** + + +* The total-field/scattered-field approach +* Calculation of a radar cross section (RCS) + +Python Script +------------- +Get the latest version `from git <https://raw.githubusercontent.com/thliebig/openEMS/master/python/Tutorials/RCS_Sphere.py>`_. + +.. include:: ./__RCS_Sphere.txt + +Images +------------- +.. figure:: images/RCS_pattern.png + :width: 49% + :alt: Radar cross section pattern + + Radar cross section pattern + +.. figure:: images/RCS_norm.png + :width: 49% + :alt: normalized radar cross section + + Normalized radar cross Section over normalized wavelength diff --git a/openEMS/python/doc/Tutorials/Rect_Waveguide.rst b/openEMS/python/doc/Tutorials/Rect_Waveguide.rst new file mode 100644 index 0000000..8b955ac --- /dev/null +++ b/openEMS/python/doc/Tutorials/Rect_Waveguide.rst @@ -0,0 +1,27 @@ +Rectangular Waveguide +===================== + + * A simple rectangular waveguide, showing the openEMS mode profile capabilities. + +Introduction +------------- +**This tutorial covers:** + +* Setup a mode profile excitation +* Create voltage and current probes using the mode profile +* Calculate the waveguide impedance and S-Parameter + + +Python Script +------------- +Get the latest version `from git <http://openems.de/gitweb/?p=openEMS.git;a=blob_plain;f=matlab/Tutorials/Rect_Waveguide.m;hb=HEAD>`_. + +.. include:: ./__Rect_Waveguide.txt + +Images +------------- +.. figure:: images/Rect_WG_SPara.png + :width: 49% + :alt: S-Parameter over Frequency + + S-Parameter over Frequency diff --git a/openEMS/python/doc/Tutorials/Simple_Patch_Antenna.rst b/openEMS/python/doc/Tutorials/Simple_Patch_Antenna.rst new file mode 100644 index 0000000..4345c56 --- /dev/null +++ b/openEMS/python/doc/Tutorials/Simple_Patch_Antenna.rst @@ -0,0 +1,42 @@ +.. _simple_patch_antenna: + +Simple Patch Antenna +==================== + +Introduction +------------ +A simple patch antenna for 2.4 GHz. + +**This tutorial covers:** + +* Setup a patch, substrate and ground. +* Setup of a lumped feeding port. +* Adding a near-field to far-field (nf2ff) recording box. +* Calculate the S-Parameter of the antenna. +* Calculate and plot the far-field pattern + +Python Script +------------- +Get the latest version `from git <http://www.openems.de/gitweb/?p=openEMS.git;a=blob_plain;f=matlab/Tutorials/Simple_Patch_Antenna.m;hb=refs/heads/master>`_. + +.. include:: ./__Simple_Patch_Antenna.txt + +Images +------ +.. figure:: images/Simp_Patch_S11.png + :width: 49% + :alt: S11 over Frequency + + S-Parameter over Frequency + +.. figure:: images/Simp_Patch_Zin.png + :width: 49% + :alt: Input Impedance + + Antenna Input Impedance + +.. figure:: images/Simp_Patch_Pattern.png + :width: 49% + :alt: Farfield pattern + + Farfield pattern for the xy- and yz-plane. diff --git a/openEMS/python/doc/Tutorials/images/Bent_Patch.png b/openEMS/python/doc/Tutorials/images/Bent_Patch.png Binary files differnew file mode 100644 index 0000000..0beddf9 --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Bent_Patch.png diff --git a/openEMS/python/doc/Tutorials/images/Bent_Patch_Pattern.png b/openEMS/python/doc/Tutorials/images/Bent_Patch_Pattern.png Binary files differnew file mode 100644 index 0000000..4fc3211 --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Bent_Patch_Pattern.png diff --git a/openEMS/python/doc/Tutorials/images/Bent_Patch_SPara.png b/openEMS/python/doc/Tutorials/images/Bent_Patch_SPara.png Binary files differnew file mode 100644 index 0000000..d3970fb --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Bent_Patch_SPara.png diff --git a/openEMS/python/doc/Tutorials/images/CRLH_Spara.png b/openEMS/python/doc/Tutorials/images/CRLH_Spara.png Binary files differnew file mode 100644 index 0000000..d0f4a3b --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/CRLH_Spara.png diff --git a/openEMS/python/doc/Tutorials/images/CRLH_cell.png b/openEMS/python/doc/Tutorials/images/CRLH_cell.png Binary files differnew file mode 100644 index 0000000..85ae9b7 --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/CRLH_cell.png diff --git a/openEMS/python/doc/Tutorials/images/CRLH_dispersion.png b/openEMS/python/doc/Tutorials/images/CRLH_dispersion.png Binary files differnew file mode 100644 index 0000000..65fc163 --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/CRLH_dispersion.png diff --git a/openEMS/python/doc/Tutorials/images/Helix_Ant.png b/openEMS/python/doc/Tutorials/images/Helix_Ant.png Binary files differnew file mode 100644 index 0000000..16c532c --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Helix_Ant.png diff --git a/openEMS/python/doc/Tutorials/images/Helix_Ant_Pattern.png b/openEMS/python/doc/Tutorials/images/Helix_Ant_Pattern.png Binary files differnew file mode 100644 index 0000000..020aae1 --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Helix_Ant_Pattern.png diff --git a/openEMS/python/doc/Tutorials/images/Notch_Filter_SPara.png b/openEMS/python/doc/Tutorials/images/Notch_Filter_SPara.png Binary files differnew file mode 100644 index 0000000..9d1d7be --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Notch_Filter_SPara.png diff --git a/openEMS/python/doc/Tutorials/images/RCS_norm.png b/openEMS/python/doc/Tutorials/images/RCS_norm.png Binary files differnew file mode 100644 index 0000000..57712ba --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/RCS_norm.png diff --git a/openEMS/python/doc/Tutorials/images/RCS_pattern.png b/openEMS/python/doc/Tutorials/images/RCS_pattern.png Binary files differnew file mode 100644 index 0000000..b3d9d23 --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/RCS_pattern.png diff --git a/openEMS/python/doc/Tutorials/images/Rect_WG_SPara.png b/openEMS/python/doc/Tutorials/images/Rect_WG_SPara.png Binary files differnew file mode 100644 index 0000000..0c0ff27 --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Rect_WG_SPara.png diff --git a/openEMS/python/doc/Tutorials/images/Simp_Patch_Pattern.png b/openEMS/python/doc/Tutorials/images/Simp_Patch_Pattern.png Binary files differnew file mode 100644 index 0000000..2cd90d4 --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Simp_Patch_Pattern.png diff --git a/openEMS/python/doc/Tutorials/images/Simp_Patch_S11.png b/openEMS/python/doc/Tutorials/images/Simp_Patch_S11.png Binary files differnew file mode 100644 index 0000000..381bb3c --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Simp_Patch_S11.png diff --git a/openEMS/python/doc/Tutorials/images/Simp_Patch_Zin.png b/openEMS/python/doc/Tutorials/images/Simp_Patch_Zin.png Binary files differnew file mode 100644 index 0000000..bbabe54 --- /dev/null +++ b/openEMS/python/doc/Tutorials/images/Simp_Patch_Zin.png diff --git a/openEMS/python/doc/Tutorials/index.rst b/openEMS/python/doc/Tutorials/index.rst new file mode 100644 index 0000000..fd5c5dc --- /dev/null +++ b/openEMS/python/doc/Tutorials/index.rst @@ -0,0 +1,12 @@ +.. _tutorials: + +######### +Tutorials +######### + +.. toctree:: + :maxdepth: 2 + + Intro_Tutorials + MicroWave_Tutorials + Antenna_Tutorials diff --git a/openEMS/python/doc/conf.py b/openEMS/python/doc/conf.py new file mode 100644 index 0000000..b5c7b76 --- /dev/null +++ b/openEMS/python/doc/conf.py @@ -0,0 +1,297 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# openEMS documentation build configuration file, created by +# sphinx-quickstart on Thu Sep 8 20:42:18 2016. +# +# 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 +import os +import sphinx_rtd_theme + +# 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('.')) + +# -- 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.intersphinx', + 'sphinx.ext.todo', + 'sphinx.ext.mathjax', + 'numpydoc', + 'sphinx.ext.autosummary', +] + +# 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 encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'openEMS' +copyright = '2016, Thorsten Liebig' +author = 'Thorsten Liebig' + +# 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 = '0.0.34' +# The full version, including alpha/beta/rc tags. +release = '0.0.34' + +# 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 = 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 = ['_build'] + +# 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 = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + +# 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 = 'sphinx_rtd_theme' + +# 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 (relative to this directory) to use as a 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'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# 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 + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' +#html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +#html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +#html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'openEMSdoc' + +# -- 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, 'openEMS.tex', 'openEMS Documentation', + 'Thorsten Liebig', '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 + +# 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 = [ + (master_doc, 'openems', 'openEMS Documentation', + [author], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- 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, 'openEMS', 'openEMS Documentation', + author, 'openEMS', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False + +numpydoc_show_class_members = False + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'CSXCAD': ('http://openems.de/doc/CSXCAD/', None)} diff --git a/openEMS/python/doc/convert_tutorials.py b/openEMS/python/doc/convert_tutorials.py new file mode 100755 index 0000000..009937b --- /dev/null +++ b/openEMS/python/doc/convert_tutorials.py @@ -0,0 +1,63 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +""" +Created on Sat Sep 10 17:12:53 2016 + +@author: thorsten +""" + +import os +import glob + +DOC_DIR = os.path.dirname(__file__) +ROOT_DIR = os.path.join(DOC_DIR, '..') + +def main(): + in_path = os.path.join(ROOT_DIR, 'Tutorials') + + fns = glob.glob(os.path.join(in_path, '*.py')) + + for fn in fns: + bn = os.path.basename(fn) + out_fn = os.path.join(DOC_DIR, 'Tutorials', '__' + bn.replace('.py', '.txt')) + + in_code_block = False + in_ignore_block = False + out_fh = open(out_fn, 'w') + for line in open(fn, 'r'): + if in_ignore_block==False and line.startswith('"""'): + in_ignore_block = True + in_code_block = False + continue + elif in_ignore_block==True and line.startswith('"""'): + in_ignore_block = False + in_code_block = False + continue + elif in_ignore_block==True: + in_code_block = False + continue + elif line.startswith('# -*-'): + continue + elif not line.startswith('##'): + if not in_code_block: + if len(line.strip())==0: + continue + out_fh.write('\n.. code-block:: python\n\n') + in_code_block = True + out_fh.write(' ' + line) + elif line.startswith('###'): + if in_code_block: + out_fh.write('\n') + in_code_block = False + line = line.replace('#','').strip() + out_fh.write('**' + line + '**\n\n') +# out_fh.write('"'*len(line) + '\n') + elif line.startswith('##'): + if in_code_block: + out_fh.write('\n') + in_code_block = False + out_fh.write(line.replace('#','').strip() + '\n') + out_fh.close() + +if __name__ == '__main__': + main() diff --git a/openEMS/python/doc/index.rst b/openEMS/python/doc/index.rst new file mode 100644 index 0000000..f4cb9ea --- /dev/null +++ b/openEMS/python/doc/index.rst @@ -0,0 +1,24 @@ +.. openEMS documentation master file, created by + sphinx-quickstart on Thu Sep 8 20:42:18 2016. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to openEMS's documentation! +=================================== + +Contents: + +.. toctree:: + :maxdepth: 3 + + Tutorials/index + openEMS_API + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/openEMS/python/doc/nf2ff.rst b/openEMS/python/doc/nf2ff.rst new file mode 100644 index 0000000..c4fbb01 --- /dev/null +++ b/openEMS/python/doc/nf2ff.rst @@ -0,0 +1,16 @@ +.. _nf2ff: + +NF2FF +----- + +.. automodule:: openEMS.nf2ff + + NF2FF + ----- + .. autoclass:: nf2ff + :members: + + NF2FF Results + ----------------- + .. autoclass:: nf2ff_results + :members: diff --git a/openEMS/python/doc/openEMS.rst b/openEMS/python/doc/openEMS.rst new file mode 100644 index 0000000..c73dece --- /dev/null +++ b/openEMS/python/doc/openEMS.rst @@ -0,0 +1,8 @@ +.. _openems: + +openEMS +------- + +.. automodule:: openEMS + :members: openEMS + :undoc-members: diff --git a/openEMS/python/doc/openEMS_API.rst b/openEMS/python/doc/openEMS_API.rst new file mode 100644 index 0000000..ae7e381 --- /dev/null +++ b/openEMS/python/doc/openEMS_API.rst @@ -0,0 +1,11 @@ +.. _openems_api: + +openEMS Python Interface +======================== + +.. toctree:: + + openEMS + ports + nf2ff + diff --git a/openEMS/python/doc/ports.rst b/openEMS/python/doc/ports.rst new file mode 100644 index 0000000..79971e6 --- /dev/null +++ b/openEMS/python/doc/ports.rst @@ -0,0 +1,37 @@ +.. _ports: + +Ports +----- + +.. automodule:: openEMS.ports + + Port (Base Class) + ----------------- + .. autoclass:: Port + :members: + :show-inheritance: + + Lumped Port + ----------- + .. autoclass:: LumpedPort + :members: + :show-inheritance: + + MSL Port + -------- + .. autoclass:: MSLPort + :members: + :show-inheritance: + + Waveguide Port + -------------- + .. autoclass:: WaveguidePort + :members: + :show-inheritance: + + Rect Waveguide Port + ------------------- + .. autoclass:: RectWGPort + :members: + :show-inheritance: + |