Skip to content
Update tutorial authored by sph's avatar sph
......@@ -3,21 +3,21 @@
In the simplest case you inherit the appropriate interface class from ``owscaling/plugins.py`` and override the following properties/methods in your plug-in:
* ``name`` property,
* ``__version__`` property,
* ``__copyright__`` property,
* ``ArgumentParser`` property,
* ``__init__()`` method,
* ``__str__()`` method and
* ``__call__()`` method.
* ``name`` property,
* ``__version__`` property,
* ``__copyright__`` property,
* ``ArgumentParser`` property,
* ``__init__()`` method,
* ``__str__()`` method and
* ``__call__()`` method.
We will explain, how this is done in the following examples:
* [Example 1](./tutorial/example_1): Constant viscosity
* [Example 2](./tutorial/example_2): Specify viscosity at the command line
* [Example 3](./tutorial/example_3): Viscosity as a function of the temperature
* [Example 4](./tutorial/example_4): Viscosity as a function of the temperature, user supplied coefficients
* [Example 1](./tutorial/example_1): Constant viscosity
* [Example 2](./tutorial/example_2): Specify viscosity at the command line
* [Example 3](./tutorial/example_3): Viscosity as a function of the temperature
* [Example 4](./tutorial/example_4): Viscosity as a function of the temperature, user supplied coefficients
We will start with an easy case and get (slightly) more complicating when we implement more features.
......@@ -57,6 +57,6 @@ this program. If not, see <http://www.gnu.org/licenses/>.
#### Notes
1. We start the file with the magic line ``#!/usr/bin/env python3``. (Please keep it there, even if you program in Windows). This is followed by the encoding of the file (in our case UTF-8), which any respectable editor should honour.
2. Following the [Style Guide for Python Code,](https://www.python.org/dev/peps/pep-0008/) we describe what the file does in one line in the docstring and then we add a list of the plug-ins implemented in this file (often this is just one plug-in, but can be more than one).
3. At the bottom add the copyright information. This should be the copyright of the program and not the copyright of the underlying theory (we will come to that). It should include the author who coded the program (and not the author of the theory behind it).
1. We start the file with the magic line ``#!/usr/bin/env python3``. (Please keep it there, even if you program in Windows). This is followed by the encoding of the file (in our case UTF-8), which any respectable editor should honour.
2. Following the [Style Guide for Python Code,](https://www.python.org/dev/peps/pep-0008/) we describe what the file does in one line in the docstring and then we add a list of the plug-ins implemented in this file (often this is just one plug-in, but can be more than one).
3. At the bottom add the copyright information. This should be the copyright of the program and not the copyright of the underlying theory (we will come to that). It should include the author who coded the program (and not the author of the theory behind it).