Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
b7d2be20
"CMakeLists.txt" did not exist on "0456f5deeaa43fd4f6a315a8892b07f296975ca5"
Commit
b7d2be20
authored
6 years ago
by
Antti Soininen
Browse files
Options
Downloads
Patches
Plain Diff
Improve wording in dev-docs. Re #24293
parent
9a8a3bee
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dev-docs/source/Standards/AdditionalPythonCode.rst
+19
-16
19 additions, 16 deletions
dev-docs/source/Standards/AdditionalPythonCode.rst
with
19 additions
and
16 deletions
dev-docs/source/Standards/AdditionalPythonCode.rst
+
19
−
16
View file @
b7d2be20
...
@@ -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
modulen
am
e
``.
simply by ``import
sp
am``.
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
####################
####################
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment