Skip to content

Commit

Permalink
👌 IMPROVE: Workflows - Work chains module (#362)
Browse files Browse the repository at this point in the history
Make several small changes in language and format to the first half of the
work chain module in the "Workflows" section.

Also add some exercises after the participants have run their first work
chain.

The PR also adds some new MyST substitutions for icons used by the margin
information, and fixes the regex for the `sphinx-copybutton`.
  • Loading branch information
mbercx authored Jun 28, 2021
1 parent 6f47cff commit 51b065d
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 75 deletions.
Binary file added docs/_static/aiida_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/python.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@
# "linkify",
# "replacements",
# "smartquotes",
# "substitution",
"substitution",
# "tasklist",
]

myst_substitutions = {
"download": '<img src="../../_static/download.png" height="15">',
"python": '<img src="../../_static/python.png" height="15">',
"aiida": '<img src="../../_static/aiida_logo.png" height="15">',
}

ipython_mplbackend = ""

copybutton_selector = "div:not(.no-copy)>div.highlight pre"
copybutton_prompt_text = ">>> |\\\\$ |In \\\\[\\\\d+\\\\]: |\\\\s+\\.\\.\\.: "
copybutton_prompt_text = ">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
copybutton_prompt_is_regexp = True

todo_include_todos = True
Expand Down
8 changes: 8 additions & 0 deletions docs/prolog.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
.. |time| image:: /_static/time.png
:width: 15px

.. # Define a Python icon
.. |python| image:: /_static/python.png
:width: 15px

.. # Define an AiiDA icon
.. |aiida| image:: /_static/aiida_logo.png
:width: 15px

.. # define level colors
.. role:: aiida-green
.. role:: aiida-blue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class OutputInputWorkChain(WorkChain):
"""WorkChain to output the input."""
"""Toy WorkChain that simply passes the input as an output."""

@classmethod
def define(cls, spec):
Expand All @@ -15,7 +15,7 @@ def define(cls, spec):
spec.output("workchain_result", valid_type=Int)

def result(self):
"""Parse the result."""
"""Pass the input as an output."""

# Declaring the output
self.out("workchain_result", self.inputs.x)
12 changes: 6 additions & 6 deletions docs/sections/workflows/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Workflows
:header-rows: 0

* - |time| 20 min
- :aiida-green:`Basic`
- |aiida| :aiida-green:`Basic`

.. panels::
:header: panel-header-text
Expand All @@ -57,7 +57,7 @@ Workflows
:header-rows: 0

* - |time| 60 min
- :aiida-green:`Basic`
- |aiida| :aiida-green:`Basic`

.. panels::
:header: panel-header-text
Expand All @@ -82,7 +82,7 @@ Workflows
:header-rows: 0

* - |time| 30 min
- :aiida-blue:`Intermediate`
- |aiida| :aiida-blue:`Intermediate`

------
:column: col-lg-6
Expand All @@ -102,7 +102,7 @@ Workflows
:header-rows: 0

* - |time| 30 min
- :aiida-blue:`Intermediate`
- |aiida| :aiida-blue:`Intermediate`

.. panels::
:header: panel-header-text
Expand All @@ -127,7 +127,7 @@ Workflows
:header-rows: 0

* - |time| 20 min
- :aiida-blue:`Intermediate`
- |aiida| :aiida-blue:`Intermediate`

------
:column: col-lg-6
Expand All @@ -147,7 +147,7 @@ Workflows
:header-rows: 0

* - |time| 30 min
- :aiida-orange:`Advanced`
- |aiida| :aiida-orange:`Advanced`

.. toctree::
:hidden:
Expand Down
Loading

0 comments on commit 51b065d

Please sign in to comment.