Skip to content
Snippets Groups Projects
Commit b7d2be20 authored by Antti Soininen's avatar Antti Soininen
Browse files

Improve wording in dev-docs. Re #24293

parent 9a8a3bee
No related branches found
No related tags found
No related merge requests found
...@@ -15,37 +15,40 @@ related to the Python exports (``mantid.*`` modules) nor an integral part of ...@@ -15,37 +15,40 @@ related to the Python exports (``mantid.*`` modules) nor an integral part of
``workbench`` should go to either the ``scripts`` directory or ``qt`` ``workbench`` should go to either the ``scripts`` directory or ``qt``
directory. directory.
``scripts`` is a place to put non-GUI modules and scripts such as pure Python ``scripts`` is a place to put non-GUI modules and scripts such as pure Python
reduction frameworks or technique specific plotting modules which are reduction frameworks or technique specific plotting modules which are
desirable to be included in an official release. The code in ``scripts`` can desirable to be included in an official release. The code in ``scripts`` can
be included in the automatic unit testing machinery making it possible to be included in the automatic unit testing machinery making it possible to
avoid breakages due to changes in Mantid's core parts. Although some reduction avoid breakages due to changes in Mantid's core parts. Although some reduction
interface code lives ``scripts``, adding more GUI related code there is interface code lives in ``scripts``, adding more GUI related code there is
discouraged. discouraged.
New Python interfaces should go to the ``qt`` directory. Python interfaces should go to the ``qt`` directory.
The ``scripts`` directory The ``scripts`` directory
######################### #########################
New Python code Python code should be written as proper `modules
--------------- <https://docs.python.org/3/tutorial/modules.html>`_. For example, the code of
a module called ``spam`` should go into ``scripts/spam`` and contain a file
New code should go in ``scripts/modulename`` directory. They can then be named ``__init__.py`` at minimum. Then the module can be imported into Mantid
imported into Mantid simply by ``import modulename``. simply by ``import spam``.
Documentation Documentation
------------- -------------
Currently, there is no official place to put documentation for the code in Documentation can be added to Mantid's Python API docs in ``docs/source/api``
``scripts``. However, *Concepts* and *Techniques* categories should cover most and linked to ``docs/source/api/index.rst``. Note, that it is possible to
use cases of ``scripts``. import Python's docstrings in ``.rst`` files using directives such as ``..
automodule::`` or ``.. autoclass::``, see `here
<http://www.sphinx-doc.org/es/stable/ext/autodoc.html>`_.
Unit testing Unit testing
------------ ------------
Unit tests should be added to ``scripts/test/modulename``. The tests follow the Unit tests for each module should be added to ``scripts/test/modulename``. The
:ref:`standard Mantid unit testing practices <UnitTestGoodPractice>`. tests follow the :ref:`standard Mantid unit testing practices
<UnitTestGoodPractice>`.
The ``qt`` directory The ``qt`` directory
#################### ####################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment