Skip to content

Commit

Permalink
roll-back autodoc
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Oct 19, 2020
1 parent 29954d4 commit 1b3d522
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion aiida/sphinxext/calcjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def setup_extension(app):
app.add_directive_to_domain('py', AiidaCalcJobDocumenter.directivetype, AiidaCalcJobDirective)
app.add_autodocumenter(AiidaCalcJobDocumenter)
# app.add_autodocumenter(AiidaCalcJobDocumenter)


class AiidaCalcJobDocumenter(AiidaProcessDocumenter):
Expand Down
2 changes: 1 addition & 1 deletion aiida/sphinxext/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

def setup_extension(app):
app.add_directive_to_domain('py', AiidaProcessDocumenter.directivetype, AiidaProcessDirective)
app.add_autodocumenter(AiidaProcessDocumenter)
# app.add_autodocumenter(AiidaProcessDocumenter)


class AiidaProcessDocumenter(ClassDocumenter):
Expand Down
2 changes: 1 addition & 1 deletion aiida/sphinxext/workchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def setup_extension(app):
app.add_directive_to_domain('py', AiidaWorkChainDocumenter.directivetype, AiidaWorkchainDirective)
app.add_autodocumenter(AiidaWorkChainDocumenter)
# app.add_autodocumenter(AiidaWorkChainDocumenter)


class AiidaWorkChainDocumenter(AiidaProcessDocumenter):
Expand Down
2 changes: 1 addition & 1 deletion docs/source/nitpick-exceptions
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ py:meth click.Option.get_default

py:class concurrent.futures._base.TimeoutError

py:class docutils.parsers.rst.Directive
py:class sphinx.util.docutils.SphinxDirective

py:class frozenset

Expand Down
30 changes: 9 additions & 21 deletions tests/sphinxext/reference_results/workchain.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document PUBLIC "+/IDN docutils.sourceforge.net/DTD Docutils Generic/EN/XML" "http:/docutils.sourceforge.net/docs/ref/docutils.dtd">
<!-- Generated by Docutils 0.15.2 -->
<document source="/private/var/folders/t2/xbl15_3n4tsb1vr_ccmmtmbr0000gn/T/pytest-of-chrisjsewell/pytest-89/test_workchain_build0/workchain/index.rst">
<document source="/private/var/folders/t2/xbl15_3n4tsb1vr_ccmmtmbr0000gn/T/pytest-of-chrisjsewell/pytest-91/test_workchain_build0/workchain/index.rst">
<section ids="sphinx-aiida-demo" names="sphinx-aiida\ demo">
<title>sphinx-aiida demo</title>
<paragraph>This is a demo documentation to show off the features of the <literal>sphinx-aiida</literal> extension.</paragraph>
Expand Down Expand Up @@ -72,30 +72,18 @@ finalize</literal_block></paragraph>
<target ids="module-demo_workchain" ismod="True"></target>
<index entries="['pair',\ 'module;\ demo_workchain',\ 'module-demo_workchain',\ '',\ None]"></index>
<paragraph>This module defines an example workchain for the aiida-workchain documentation directive.</paragraph>
<desc desctype="class" domain="py" noindex="False" objtype="class">
<desc_signature first="False" fullname="WorkChain"><desc_annotation xml:space="preserve">workchain</desc_annotation><desc_addname xml:space="preserve">demo_workchain.</desc_addname><desc_name xml:space="preserve">DemoWorkChain</desc_name></desc_signature>
<index entries="['single',\ 'DemoWorkChain\ (class\ in\ demo_workchain)',\ 'demo_workchain.DemoWorkChain',\ '',\ None]"></index>
<desc classes="py" desctype="class" domain="py" noindex="False" objtype="class">
<desc_signature class="" fullname="DemoWorkChain" ids="demo_workchain.DemoWorkChain" module="demo_workchain"><desc_annotation xml:space="preserve">class </desc_annotation><desc_addname xml:space="preserve">demo_workchain.</desc_addname><desc_name xml:space="preserve">DemoWorkChain</desc_name><desc_parameterlist xml:space="preserve"><desc_parameter xml:space="preserve"><desc_sig_operator classes="o o">*</desc_sig_operator><desc_sig_name classes="n n">args</desc_sig_name></desc_parameter><desc_parameter xml:space="preserve"><desc_sig_operator classes="o o">**</desc_sig_operator><desc_sig_name classes="n n">kwargs</desc_sig_name></desc_parameter></desc_parameterlist></desc_signature>
<desc_content>
<paragraph>
A demo workchain to show how the workchain auto-documentation works.
</paragraph>
<paragraph><strong>Inputs:</strong><bullet_list bullet="*"><list_item><literal_strong>metadata</literal_strong>, <emphasis>Namespace</emphasis><details opened="False"><summary>Namespace Ports</summary><bullet_list bullet="*"><list_item><literal_strong>call_link_label</literal_strong>, <emphasis>str</emphasis>, optional, <emphasis>non_db</emphasis> – The label to use for the <title_reference>CALL</title_reference> link if the process is called by another process.</list_item><list_item><literal_strong>description</literal_strong>, <emphasis>str</emphasis>, optional, <emphasis>non_db</emphasis> – Description to set on the process node.</list_item><list_item><literal_strong>label</literal_strong>, <emphasis>str</emphasis>, optional, <emphasis>non_db</emphasis> – Label to set on the process node.</list_item><list_item><literal_strong>store_provenance</literal_strong>, <emphasis>bool</emphasis>, optional, <emphasis>non_db</emphasis> – If set to <title_reference>False</title_reference> provenance will not be stored in the database.</list_item></bullet_list></details></list_item><list_item><literal_strong>nsp</literal_strong>, <emphasis>Namespace</emphasis> – A separate namespace, <literal>nsp</literal>.</list_item><list_item><literal_strong>nsp2</literal_strong>, <emphasis>Namespace</emphasis></list_item><list_item><literal_strong>x</literal_strong>, <emphasis>Float</emphasis>, required – First input argument.</list_item><list_item><literal_strong>y</literal_strong>, <emphasis>Namespace</emphasis><details opened="False"><summary>Namespace Ports</summary><bullet_list bullet="*"><list_item><literal_strong>nested</literal_strong>, <emphasis>Namespace</emphasis> – A nested namespace.<details opened="False"><summary>Namespace Ports</summary><bullet_list bullet="*"><list_item><literal_strong>a</literal_strong>, <emphasis>Int</emphasis>, required – An input in the nested namespace.</list_item></bullet_list></details></list_item><list_item><literal_strong>z</literal_strong>, <emphasis>Int</emphasis>, required – Input in a separate namespace.</list_item></bullet_list></details></list_item></bullet_list></paragraph>
<paragraph><strong>Outputs:</strong><bullet_list bullet="*"><list_item><literal_strong>z</literal_strong>, <emphasis>Bool</emphasis>, required – Output of the demoworkchain.</list_item></bullet_list></paragraph>
<paragraph><strong>Outline:</strong><literal_block force="False" language="default" linenos="False" xml:space="preserve">start
while(some_check)
do_something
if(another_check)
do_something_else
finalize</literal_block></paragraph>
<paragraph>A demo workchain to show how the workchain auto-documentation works.</paragraph>
</desc_content>
</desc>
<desc desctype="class" domain="py" noindex="False" objtype="class">
<desc_signature first="False" fullname="WorkChain"><desc_annotation xml:space="preserve">workchain</desc_annotation><desc_addname xml:space="preserve">demo_workchain.</desc_addname><desc_name xml:space="preserve">EmptyOutlineWorkChain</desc_name></desc_signature>
<index entries="['single',\ 'EmptyOutlineWorkChain\ (class\ in\ demo_workchain)',\ 'demo_workchain.EmptyOutlineWorkChain',\ '',\ None]"></index>
<desc classes="py" desctype="class" domain="py" noindex="False" objtype="class">
<desc_signature class="" fullname="EmptyOutlineWorkChain" ids="demo_workchain.EmptyOutlineWorkChain" module="demo_workchain"><desc_annotation xml:space="preserve">class </desc_annotation><desc_addname xml:space="preserve">demo_workchain.</desc_addname><desc_name xml:space="preserve">EmptyOutlineWorkChain</desc_name><desc_parameterlist xml:space="preserve"><desc_parameter xml:space="preserve"><desc_sig_operator classes="o o">*</desc_sig_operator><desc_sig_name classes="n n">args</desc_sig_name></desc_parameter><desc_parameter xml:space="preserve"><desc_sig_operator classes="o o">**</desc_sig_operator><desc_sig_name classes="n n">kwargs</desc_sig_name></desc_parameter></desc_parameterlist></desc_signature>
<desc_content>
<paragraph>
Here we check that the directive works even if the outline is empty.
</paragraph>
<paragraph><strong>Inputs:</strong><bullet_list bullet="*"><list_item><literal_strong>metadata</literal_strong>, <emphasis>Namespace</emphasis><details opened="False"><summary>Namespace Ports</summary><bullet_list bullet="*"><list_item><literal_strong>call_link_label</literal_strong>, <emphasis>str</emphasis>, optional, <emphasis>non_db</emphasis> – The label to use for the <title_reference>CALL</title_reference> link if the process is called by another process.</list_item><list_item><literal_strong>description</literal_strong>, <emphasis>str</emphasis>, optional, <emphasis>non_db</emphasis> – Description to set on the process node.</list_item><list_item><literal_strong>label</literal_strong>, <emphasis>str</emphasis>, optional, <emphasis>non_db</emphasis> – Label to set on the process node.</list_item><list_item><literal_strong>store_provenance</literal_strong>, <emphasis>bool</emphasis>, optional, <emphasis>non_db</emphasis> – If set to <title_reference>False</title_reference> provenance will not be stored in the database.</list_item></bullet_list></details></list_item><list_item><literal_strong>x</literal_strong>, <emphasis>Float</emphasis>, required – First input argument.</list_item></bullet_list></paragraph>
<paragraph><strong>Outputs:</strong><paragraph>None defined.</paragraph></paragraph>
<paragraph>Here we check that the directive works even if the outline is empty.</paragraph>
</desc_content>
</desc>
<index entries="['single',\ 'NormalClass\ (class\ in\ demo_workchain)',\ 'demo_workchain.NormalClass',\ '',\ None]"></index>
Expand Down

0 comments on commit 1b3d522

Please sign in to comment.