From 7243b0fe850c5963293652ae3699080fb1cc95fd Mon Sep 17 00:00:00 2001 From: LukasK13 Date: Wed, 9 Sep 2020 17:39:40 +0200 Subject: [PATCH] Add documentation for usage as python module --- .../developer/developer_documentation.rst | 5 ++++ docs/source/developer/scripting.rst | 26 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 docs/source/developer/scripting.rst diff --git a/docs/source/developer/developer_documentation.rst b/docs/source/developer/developer_documentation.rst index 9d41964..d3cc1d1 100644 --- a/docs/source/developer/developer_documentation.rst +++ b/docs/source/developer/developer_documentation.rst @@ -16,6 +16,11 @@ Project Structure .. include:: project_structure.rst +ESBO-ETC Python module +====================== + +.. include:: scripting.rst + Software Architecture ===================== diff --git a/docs/source/developer/scripting.rst b/docs/source/developer/scripting.rst new file mode 100644 index 0000000..0f0d921 --- /dev/null +++ b/docs/source/developer/scripting.rst @@ -0,0 +1,26 @@ +ESBO-ETC is designed to be included as module in other Python scripts. +This is possible by importing the class ``esbo_etc`` from the module ``esbo_etc`` as shown below. + +.. code-block:: python + :linenos: + + from esbo_etc import esbo_etc + +The class ``esbo_etc`` requires a path to the configuration file as initialization argument and some other optional paramaters. +The created object offers the method ``run()`` to trigger the computation. +The result of the computation is returned as Astropy quantity. +A Minimal example looks as follows: + +.. code-block:: python + :linenos: + + from esbo_etc import esbo_etc + + + # Initialize a new ESBO-ETC object + etc = esbo_etc("path_to_configuration_file.xml") + + # Run the calculations + res = etc.run() + + print(res)