Skip to content

Conversation

@dwhswenson
Copy link
Member

This creates automatic documentation generation tools for the input file format used by the compile command. The code to do this will not be considered part of the API, because there may be significant changes in it over time. However, documenting the functionality available in the compile command is essential before the v0.3 release where we announce the availability of this command.

One of the major goals here is to keep documentation and source together, in order to ensure that new functionality is automatically documented online. This is done by keeping a description string in plugins, which can then be used in the docs.

This PR will mainly provide the infrastructure for building docs. Many plugins still need descriptions to be filled in; this will occur in a future PR.

@dwhswenson dwhswenson added the enhancement New feature or request label Oct 30, 2021
@codecov
Copy link

codecov bot commented Oct 30, 2021

Codecov Report

Merging #64 (d1f430a) into main (34cf3a0) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              main       #64    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           51        57     +6     
  Lines         2143      2279   +136     
==========================================
+ Hits          2143      2279   +136     
Impacted Files Coverage Δ
paths_cli/compiling/engines.py 100.00% <ø> (ø)
paths_cli/compiling/shooting.py 100.00% <ø> (ø)
paths_cli/commands/compile.py 100.00% <100.00%> (ø)
paths_cli/compiling/_gendocs/__init__.py 100.00% <100.00%> (ø)
paths_cli/compiling/_gendocs/config_handler.py 100.00% <100.00%> (ø)
paths_cli/compiling/_gendocs/docs_generator.py 100.00% <100.00%> (ø)
paths_cli/compiling/_gendocs/json_type_handlers.py 100.00% <100.00%> (ø)
paths_cli/compiling/core.py 100.00% <100.00%> (ø)
paths_cli/compiling/gendocs.py 100.00% <100.00%> (ø)
paths_cli/compiling/json_type.py 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34cf3a0...d1f430a. Read the comment docs.

@dwhswenson
Copy link
Member Author

This is ready for review and comment. I will leave it open for at least 30 hours, merging no earlier than Tue 02 Nov 22:00 GMT (18:00 my local).

CodeClimate has a complaint about paths_cli.compiling.core breaking 250 lines of code; I'm confirming the issue on CodeClimate, but approving the PR (we may address that at another time, but not here).

This code in this PR is mainly intended to get the infrastructure ready so that future PRs can fill in additional details needed to create the detailed documentation. Just as an example, using the following as part of a config file:

volume:
  header: Volumes
  description: |
    State and interface definitions in OpenPathSampling are (hyper)volumes
    in phase space. Use these tools to define states and the substituent
    volumes that comprise them.

The current code generates the following RST (from the command python -m paths_cli.compiling.gendocs categories.yml):

.. _compiling--volume:

Volumes
=======

State and interface definitions in OpenPathSampling are (hyper)volumes
in phase space. Use these tools to define states and the substituent
volumes that comprise them.


.. contents:: :local:

.. _volume--cv-volume:

cv-volume
---------

* **type** - type identifier; must exactly match the string ``cv-volume`` (required)
* **name** (*string*) - name this object in order to reuse it
* **cv** (:ref:`cv <compiling--cv>`) - CV that defines this volume (required)
* **lambda_min** (None) - Lower bound for this volume (required)
* **lambda_max** (None) - Upper bound for this volume (required)


.. _volume--intersection:

intersection
------------

* **type** - type identifier; must exactly match the string ``intersection`` (required)
* **name** (*string*) - name this object in order to reuse it
* **subvolumes** (list of :ref:`volume <compiling--volume>`) - List of the volumes to intersect (required)


.. _volume--union:

union
-----

* **type** - type identifier; must exactly match the string ``union`` (required)
* **name** (*string*) - name this object in order to reuse it
* **subvolumes** (list of :ref:`volume <compiling--volume>`) - List of the volumes to join into a union (required)


I'm very much open to changing the details of the RST in the future if that improves presentation; my main priority here is to get something that can be useful for users and will be easy for us to maintain.

@dwhswenson dwhswenson marked this pull request as ready for review November 1, 2021 15:20
@dwhswenson dwhswenson changed the title [WIP] Automatic build of docs for compile command Automatic build of docs for compile command Nov 1, 2021
Copy link
Member

@sroet sroet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one pylint complaint and leftover TODO; LGTM otherwise

Co-authored-by: Sander Roet <sanderroet@hotmail.com>
@dwhswenson dwhswenson merged commit 59bc1b9 into openpathsampling:main Nov 2, 2021
@dwhswenson dwhswenson deleted the compile-docs branch November 2, 2021 22:56
@dwhswenson dwhswenson mentioned this pull request Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants