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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs #803

Merged
merged 16 commits into from
Feb 23, 2024
Merged

Improve docs #803

merged 16 commits into from
Feb 23, 2024

Conversation

mgiulini
Copy link
Contributor

@mgiulini mgiulini commented Feb 15, 2024

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

  • You have sticked to Python. Please talk to 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 is a (state) purpose
  • Your 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 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:

Closes #802 . This PR is supposed to substantially improve the autogenerated documentation created when running tox -e docs. More specifically:

  • the documentation is now searchable (thanks @rvhonorato )
  • the bugs that were stopping the build of the documentation have been corrected
  • python code docs are now properly rendered
  • sphinx-apidoc runs before sphinx-build to create the rst files
  • the rst files are almost completely removed from the repo. The old rst files were outdated and basically their presence forced the developer to change them at every commit. Not exactly desirable for an autogenerated documentation
  • the devtools script buiild_defaults_rsts is adapted to move and prettify the rst files in the docs folder

@mgiulini mgiulini self-assigned this Feb 15, 2024
@mgiulini mgiulini added enhancement Enhancing an existing feature of adding a new one documentation Improve docs labels Feb 15, 2024
@mgiulini mgiulini marked this pull request as ready for review February 16, 2024 16:26
Copy link
Member

@rvhonorato rvhonorato left a comment

Choose a reason for hiding this comment

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

Nice!

When you run the sphinx commands it generates a lot of these .rst files that are not in the .gitignore, so I'm guessing you edit it or should they be in the repository?

On branch improve_docs
Your branch is up to date with 'origin/improve_docs'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	docs/haddock.clis.cli.rst
	docs/haddock.clis.cli_analyse.rst
	docs/haddock.clis.cli_bm.rst
	docs/haddock.clis.cli_cfg.rst
	docs/haddock.clis.cli_clean.rst
	docs/haddock.clis.cli_cp.rst
	docs/haddock.clis.cli_dmn.rst
	docs/haddock.clis.cli_mpi.rst
	docs/haddock.clis.cli_pp.rst
	docs/haddock.clis.cli_re.rst
	docs/haddock.clis.cli_restraints.rst
	docs/haddock.clis.cli_score.rst
	docs/haddock.clis.cli_traceback.rst
	docs/haddock.clis.cli_unpack.rst
	docs/haddock.clis.re.clustfcc.rst
	docs/haddock.clis.re.clustrmsd.rst
	docs/haddock.clis.re.rst
	docs/haddock.clis.re.score.rst
	docs/haddock.clis.restraints.active_passive_to_ambig.rst
	docs/haddock.clis.restraints.passive_from_active.rst
	docs/haddock.clis.restraints.restrain_bodies.rst
	docs/haddock.clis.restraints.rst
	docs/haddock.clis.restraints.validate_tbl.rst
	docs/haddock.clis.rst
	docs/haddock.core.cns_paths.rst
	docs/haddock.core.defaults.rst
	docs/haddock.core.exceptions.rst
	docs/haddock.core.rst
	docs/haddock.core.supported_molecules.rst
	docs/haddock.core.typing.rst
	docs/haddock.gear.clean_steps.rst
	docs/haddock.gear.config.rst
	docs/haddock.gear.expandable_parameters.rst
	docs/haddock.gear.extend_run.rst
	docs/haddock.gear.greetings.rst
	docs/haddock.gear.haddockmodel.rst
	docs/haddock.gear.parameters.rst
	docs/haddock.gear.prepare_run.rst
	docs/haddock.gear.preprocessing.rst
	docs/haddock.gear.restart_run.rst
	docs/haddock.gear.rst
	docs/haddock.gear.validations.rst
	docs/haddock.gear.yaml2cfg.rst
	docs/haddock.gear.zerofill.rst
	docs/haddock.libs.libalign.rst
	docs/haddock.libs.libcli.rst
	docs/haddock.libs.libclust.rst
	docs/haddock.libs.libcns.rst
	docs/haddock.libs.libfunc.rst
	docs/haddock.libs.libhpc.rst
	docs/haddock.libs.libinteractive.rst
	docs/haddock.libs.libio.rst
	docs/haddock.libs.liblog.rst
	docs/haddock.libs.libmath.rst
	docs/haddock.libs.libmpi.rst
	docs/haddock.libs.libontology.rst
	docs/haddock.libs.libparallel.rst
	docs/haddock.libs.libpdb.rst
	docs/haddock.libs.libplots.rst
	docs/haddock.libs.librestraints.rst
	docs/haddock.libs.libstructure.rst
	docs/haddock.libs.libsubprocess.rst
	docs/haddock.libs.libtimer.rst
	docs/haddock.libs.libutil.rst
	docs/haddock.libs.libworkflow.rst
	docs/haddock.libs.rst
	docs/haddock.modules.analysis.alascan.rst
	docs/haddock.modules.analysis.alascan.scan.rst
	docs/haddock.modules.analysis.caprieval.capri.rst
	docs/haddock.modules.analysis.caprieval.rst
	docs/haddock.modules.analysis.clustfcc.clustfcc.rst
	docs/haddock.modules.analysis.clustfcc.rst
	docs/haddock.modules.analysis.clustrmsd.clustrmsd.rst
	docs/haddock.modules.analysis.clustrmsd.rst
	docs/haddock.modules.analysis.contactmap.contmap.rst
	docs/haddock.modules.analysis.contactmap.rst
	docs/haddock.modules.analysis.ilrmsdmatrix.ilrmsd.rst
	docs/haddock.modules.analysis.ilrmsdmatrix.rst
	docs/haddock.modules.analysis.rmsdmatrix.rmsd.rst
	docs/haddock.modules.analysis.rmsdmatrix.rst
	docs/haddock.modules.analysis.rst
	docs/haddock.modules.analysis.seletop.rst
	docs/haddock.modules.analysis.seletopclusts.rst
	docs/haddock.modules.extras.exit.rst
	docs/haddock.modules.extras.rst
	docs/haddock.modules.refinement.emref.rst
	docs/haddock.modules.refinement.flexref.rst
	docs/haddock.modules.refinement.mdref.rst
	docs/haddock.modules.refinement.rst
	docs/haddock.modules.sampling.gdock.rst
	docs/haddock.modules.sampling.lightdock.rst
	docs/haddock.modules.sampling.rigidbody.rst
	docs/haddock.modules.sampling.rst
	docs/haddock.modules.scoring.emscoring.rst
	docs/haddock.modules.scoring.mdscoring.rst
	docs/haddock.modules.scoring.rst
	docs/haddock.modules.topology.rst
	docs/haddock.modules.topology.topoaa.rst
	docs/haddock.modules.topology.topocg.rst

nothing added to commit but untracked files present (use "git add" to track)

Other than that it looks functional to me.

@mgiulini
Copy link
Contributor Author

Nice!

When you run the sphinx commands it generates a lot of these .rst files that are not in the .gitignore, so I'm guessing you edit it or should they be in the repository?

On branch improve_docs
Your branch is up to date with 'origin/improve_docs'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	docs/haddock.clis.cli.rst
	docs/haddock.clis.cli_analyse.rst
	docs/haddock.clis.cli_bm.rst
	docs/haddock.clis.cli_cfg.rst
	docs/haddock.clis.cli_clean.rst
	docs/haddock.clis.cli_cp.rst
	docs/haddock.clis.cli_dmn.rst
	docs/haddock.clis.cli_mpi.rst
	docs/haddock.clis.cli_pp.rst
	docs/haddock.clis.cli_re.rst
	docs/haddock.clis.cli_restraints.rst
	docs/haddock.clis.cli_score.rst
	docs/haddock.clis.cli_traceback.rst
	docs/haddock.clis.cli_unpack.rst
	docs/haddock.clis.re.clustfcc.rst
	docs/haddock.clis.re.clustrmsd.rst
	docs/haddock.clis.re.rst
	docs/haddock.clis.re.score.rst
	docs/haddock.clis.restraints.active_passive_to_ambig.rst
	docs/haddock.clis.restraints.passive_from_active.rst
	docs/haddock.clis.restraints.restrain_bodies.rst
	docs/haddock.clis.restraints.rst
	docs/haddock.clis.restraints.validate_tbl.rst
	docs/haddock.clis.rst
	docs/haddock.core.cns_paths.rst
	docs/haddock.core.defaults.rst
	docs/haddock.core.exceptions.rst
	docs/haddock.core.rst
	docs/haddock.core.supported_molecules.rst
	docs/haddock.core.typing.rst
	docs/haddock.gear.clean_steps.rst
	docs/haddock.gear.config.rst
	docs/haddock.gear.expandable_parameters.rst
	docs/haddock.gear.extend_run.rst
	docs/haddock.gear.greetings.rst
	docs/haddock.gear.haddockmodel.rst
	docs/haddock.gear.parameters.rst
	docs/haddock.gear.prepare_run.rst
	docs/haddock.gear.preprocessing.rst
	docs/haddock.gear.restart_run.rst
	docs/haddock.gear.rst
	docs/haddock.gear.validations.rst
	docs/haddock.gear.yaml2cfg.rst
	docs/haddock.gear.zerofill.rst
	docs/haddock.libs.libalign.rst
	docs/haddock.libs.libcli.rst
	docs/haddock.libs.libclust.rst
	docs/haddock.libs.libcns.rst
	docs/haddock.libs.libfunc.rst
	docs/haddock.libs.libhpc.rst
	docs/haddock.libs.libinteractive.rst
	docs/haddock.libs.libio.rst
	docs/haddock.libs.liblog.rst
	docs/haddock.libs.libmath.rst
	docs/haddock.libs.libmpi.rst
	docs/haddock.libs.libontology.rst
	docs/haddock.libs.libparallel.rst
	docs/haddock.libs.libpdb.rst
	docs/haddock.libs.libplots.rst
	docs/haddock.libs.librestraints.rst
	docs/haddock.libs.libstructure.rst
	docs/haddock.libs.libsubprocess.rst
	docs/haddock.libs.libtimer.rst
	docs/haddock.libs.libutil.rst
	docs/haddock.libs.libworkflow.rst
	docs/haddock.libs.rst
	docs/haddock.modules.analysis.alascan.rst
	docs/haddock.modules.analysis.alascan.scan.rst
	docs/haddock.modules.analysis.caprieval.capri.rst
	docs/haddock.modules.analysis.caprieval.rst
	docs/haddock.modules.analysis.clustfcc.clustfcc.rst
	docs/haddock.modules.analysis.clustfcc.rst
	docs/haddock.modules.analysis.clustrmsd.clustrmsd.rst
	docs/haddock.modules.analysis.clustrmsd.rst
	docs/haddock.modules.analysis.contactmap.contmap.rst
	docs/haddock.modules.analysis.contactmap.rst
	docs/haddock.modules.analysis.ilrmsdmatrix.ilrmsd.rst
	docs/haddock.modules.analysis.ilrmsdmatrix.rst
	docs/haddock.modules.analysis.rmsdmatrix.rmsd.rst
	docs/haddock.modules.analysis.rmsdmatrix.rst
	docs/haddock.modules.analysis.rst
	docs/haddock.modules.analysis.seletop.rst
	docs/haddock.modules.analysis.seletopclusts.rst
	docs/haddock.modules.extras.exit.rst
	docs/haddock.modules.extras.rst
	docs/haddock.modules.refinement.emref.rst
	docs/haddock.modules.refinement.flexref.rst
	docs/haddock.modules.refinement.mdref.rst
	docs/haddock.modules.refinement.rst
	docs/haddock.modules.sampling.gdock.rst
	docs/haddock.modules.sampling.lightdock.rst
	docs/haddock.modules.sampling.rigidbody.rst
	docs/haddock.modules.sampling.rst
	docs/haddock.modules.scoring.emscoring.rst
	docs/haddock.modules.scoring.mdscoring.rst
	docs/haddock.modules.scoring.rst
	docs/haddock.modules.topology.rst
	docs/haddock.modules.topology.topoaa.rst
	docs/haddock.modules.topology.topocg.rst

nothing added to commit but untracked files present (use "git add" to track)

Other than that it looks functional to me.

basically the configuration file calls this build_default_rst script that manages these rst files..I guess you just ran the sphinx commands, correct? try to run tox -e docs and these untracked files should disappear

@rvhonorato
Copy link
Member

those are generated after tox -e docs shouldn't they be in .gitignore?

@mgiulini
Copy link
Contributor Author

those are generated after tox -e docs shouldn't they be in .gitignore?

no, as they should not belong to the docs folder but rather moved to the subdirectories (which are gitignored). I added an mkdir statement for the case in which you do not have such subdirectories, can you remove the files and try again?

@mgiulini mgiulini merged commit 7c1d16a into main Feb 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improve docs enhancement Enhancing an existing feature of adding a new one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve autogenerated documentation
2 participants