Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate .rst documentation page for .yaml default configuration files #436

Merged
merged 17 commits into from
May 30, 2022

Conversation

joaomcteixeira
Copy link
Member

@joaomcteixeira joaomcteixeira commented May 25, 2022

You are about to submit a new Pull Request. Before continuing make sure you read the contributing guidelines and you comply with the following criteria:

  • You have stick to Python. Talk with us before adding other programming languages to HADDOCK3
  • Your PR is about CNS
  • Your code is well documented: proper docstrings and explanatory comments for those tricky parts
  • You structured the code into small functions as much as possible. You can use classes if there's a (state) purpose
  • code follows our coding style
  • You wrote tests for the new code
  • tox tests pass. Run tox command inside the repository folder
  • -test.cfg examples execute without errors. Inside examples/ run python run_tests.py -b
  • PR does not add any install dependencies unless permission granted by the HADDOCK team
  • PR does not break licensing
  • Your PR is about writing documentation for already existing code 馃敟
  • Your PR is about writing tests for already existing code :godmode:

Default parameters for each module, as well as general parameters and mandatory parameters, are defined in yaml files. However, these are not yet documented in the HD3 HTML doc pages.

In this PR I introduce a script in the devtools folder that generate local .rst pages with the documentation for the yaml files.

After you generate the docs locally: tox -e docs, you will find at the bottom of each module's documentation the yaml docs. Therefore, each module doc page will be composed of 3 sections:

  1. a general description of the module, which is written in the __init__.py docstring for each module
  2. the API documentation of the module
  3. the default parameters documentation

In Reference -> Core there are also the mandatory parameters. And in the main module index page also the general module parameters.

Have a look and let me know your feelings. Obviously, it can be improved in the future. But I think the result is good. Btw, parameter names are heading meaning they can be clicked.

relevant note: we have parameters that are dictionaries, like mol1 in topoaa. This is okay. But the machinery here does not allow for more than one nesting level. Which I think is also a good human limit. Nothing to worry on this is just a note for the future.

@joaomcteixeira joaomcteixeira added the documentation Improve docs label May 25, 2022
@joaomcteixeira joaomcteixeira added this to the v3.0.0 stable release milestone May 25, 2022
@joaomcteixeira joaomcteixeira self-assigned this May 25, 2022
@joaomcteixeira joaomcteixeira added this to In Progress in Documentation via automation May 25, 2022
@joaomcteixeira joaomcteixeira changed the title General .rst documentation page for .yaml default configuration files Generate .rst documentation page for .yaml default configuration files May 25, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 25, 2022

Codecov Report

Merging #436 (40fc4ae) into main (088e998) will decrease coverage by 0.08%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #436      +/-   ##
==========================================
- Coverage   71.14%   71.06%   -0.09%     
==========================================
  Files          92       91       -1     
  Lines        5757     5737      -20     
==========================================
- Hits         4096     4077      -19     
+ Misses       1661     1660       -1     
Impacted Files Coverage 螖
src/haddock/modules/analysis/caprieval/capri.py 78.72% <0.00%> (-13.34%) 猬囷笍
src/haddock/libs/libalign.py 65.64% <0.00%> (-4.28%) 猬囷笍
tests/test_module_caprieval.py 96.10% <0.00%> (-3.90%) 猬囷笍
src/haddock/libs/libontology.py 76.33% <0.00%> (-0.77%) 猬囷笍
tests/test_libio.py 100.00% <0.00%> (酶)
tests/test_libalign.py 100.00% <0.00%> (酶)
src/haddock/modules/analysis/caprieval/caprijob.py
src/haddock/modules/analysis/rmsdmatrix/rmsd.py 98.01% <0.00%> (+0.04%) 猬嗭笍
src/haddock/libs/libio.py 84.12% <0.00%> (+11.90%) 猬嗭笍
src/haddock/modules/analysis/caprieval/__init__.py 34.28% <0.00%> (+14.74%) 猬嗭笍

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 088e998...40fc4ae. Read the comment docs.

devtools/build_defaults_rst.py Outdated Show resolved Hide resolved
docs/modules/scoring/mdscoring.rst Outdated Show resolved Hide resolved
devtools/build_defaults_rst.py Outdated Show resolved Hide resolved
devtools/build_defaults_rst.py Outdated Show resolved Hide resolved
@joaomcteixeira
Copy link
Member Author

Thanks. for the comments. You are right, I will address that.

@joaomcteixeira
Copy link
Member Author

thanks @mgiulini for the very nice comments and shape catches. I have improved the script and added docs. Have a look.
Cheers,

@joaomcteixeira joaomcteixeira mentioned this pull request May 30, 2022
7 tasks
docs/conf.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mgiulini mgiulini left a comment

Choose a reason for hiding this comment

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

Cool 馃憤

devtools/build_defaults_rst.py Outdated Show resolved Hide resolved
devtools/build_defaults_rst.py Outdated Show resolved Hide resolved
joaomcteixeira and others added 3 commits May 30, 2022 17:13
Co-authored-by: Marco Giulini <54807167+mgiulini@users.noreply.github.com>
Co-authored-by: Marco Giulini <54807167+mgiulini@users.noreply.github.com>
@joaomcteixeira joaomcteixeira merged commit 418a6dc into haddocking:main May 30, 2022
Documentation automation moved this from In Progress to Done May 30, 2022
@joaomcteixeira joaomcteixeira deleted the yaml_docs branch May 30, 2022 15:53
@joaomcteixeira joaomcteixeira added the yaml default parameters Anything related to the YAML configuration files for default parameters label Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improve docs yaml default parameters Anything related to the YAML configuration files for default parameters
Projects
Documentation
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants