-
Notifications
You must be signed in to change notification settings - Fork 128
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
docs: add CI, fix existing warnings, add other improvements #1095
Commits on Mar 21, 2023
-
Use sphinx variables from the environment if present
This is required for docs-ci to work properly. It is already done in docs.nextstrain.org and ncov: https://github.com/nextstrain/docs.nextstrain.org/blob/5b82daa7d6f9f784e93bdef967af101f91fd2c75/Makefile#L4-L7 https://github.com/nextstrain/ncov/blob/822a77ba070d1d37483d45c22a00b5f83d16e974/docs/Makefile#L4-L7
Configuration menu - View commit details
-
Copy full SHA for dd5e66d - Browse repository at this point
Copy the full SHA dd5e66dView commit details -
Update CI workflow to catch warnings in docs
This uses a reusable workflow in the nextstrain/.github repo.
Configuration menu - View commit details
-
Copy full SHA for b62ecb5 - Browse repository at this point
Copy the full SHA b62ecb5View commit details -
docs/faq/metadata: Convert page to rST
rST is our standard doc format; Markdown is the legacy format. Initial conversion performed with: pandoc -f markdown-smart -t rst-smart docs/faq/metadata.md > docs/faq/metadata.rst and then I hand reviewed and made additional edits. This fixes a broken link to https://docs.nextstrain.org/en/latest/guides/bioinformatics/lat_longs.html.
Configuration menu - View commit details
-
Copy full SHA for 9227345 - Browse repository at this point
Copy the full SHA 9227345View commit details -
Update references to zika tutorial
The page was renamed in nextstrain/docs.nextstrain.org@a3b3856.
Configuration menu - View commit details
-
Copy full SHA for ce920ad - Browse repository at this point
Copy the full SHA ce920adView commit details -
Remove "Tests" section heading in docstring
This was causing a warning when building the docs: Tests ----- None:8: CRITICAL: Unexpected section title. Removing since docstrings in other files do not have this heading.
Configuration menu - View commit details
-
Copy full SHA for 2c8fdaa - Browse repository at this point
Copy the full SHA 2c8fdaaView commit details -
Use consistent table of contents
In CLI pages with multiple headings.
Configuration menu - View commit details
-
Copy full SHA for 3aa9665 - Browse repository at this point
Copy the full SHA 3aa9665View commit details -
distance: Use JSON syntax highlighting
Replace the literal blocks (introduced by the :: markers) with code-block directives for nice syntax highlighting.
Configuration menu - View commit details
-
Copy full SHA for f331415 - Browse repository at this point
Copy the full SHA f331415View commit details -
Fixes this warning: augur/io/__init__.py:docstring of augur.io:1: WARNING: duplicate object description of augur.io, other instance in api/developer/augur.io, use :noindex: for one of them While :noindex: for Sphinx in general disables cross-referencing¹ and it is briefly mentioned in the "Options and advanced usage" section of automodule², there aren't any references anyways (as demonstrated by a lack of related warnings/errors). However, it's still unclear to me exactly why this shows on augur.io only. I assume it has something to do with the re-exporting of public API functions, which is currently specifi to augur.io. ¹ https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#basic-markup ² https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directives
Configuration menu - View commit details
-
Copy full SHA for cbed8ef - Browse repository at this point
Copy the full SHA cbed8efView commit details -
Replace section heading in docstring with bold text
The section headings resulted in warnings: None:8: CRITICAL: Unexpected section title. Comparison methods ================== None:36: CRITICAL: Unexpected section title. Distance maps ============= They rendered fine in the Development API page¹ but did not render on the CLI page². This seems like a bug with sphinx-argparse³. For now, use bold text to avoid the warnings and allow the text to render on the CLI page. ¹ https://docs.nextstrain.org/projects/augur/en/stable/api/developer/augur.distance.html ² https://docs.nextstrain.org/projects/augur/en/stable/usage/cli/distance.html ³ sphinx-doc/sphinx-argparse#31
Configuration menu - View commit details
-
Copy full SHA for 844c10c - Browse repository at this point
Copy the full SHA 844c10cView commit details -
docs: Build locally with nitpicky mode
This makes local builds show the same warnings in CI without erroring.
Configuration menu - View commit details
-
Copy full SHA for a310587 - Browse repository at this point
Copy the full SHA a310587View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14bf620 - Browse repository at this point
Copy the full SHA 14bf620View commit details -
fix: Add augur.types prefix for proper linking
Without this prefix, a warning appears: WARNING: py:attr reference target not found: ValidationMode.SKIP
Configuration menu - View commit details
-
Copy full SHA for 97e082d - Browse repository at this point
Copy the full SHA 97e082dView commit details -
fix: Use Python type hints in doc generation
The majority of the codebase uses numpydoc for type annotations. However, there are some usages of the newer PEP 484 type hints. For example, augur.dates.get_numerical_dates has `metadata:pd.DataFrame` in the function signature. Without sphinx-autodoc-typehints, this caused a warning: augur/augur/dates.py:docstring of augur.dates.get_numerical_dates:1: WARNING: py:class reference target not found: pandas.core.frame.DataFrame This commit fixes that warning.
Configuration menu - View commit details
-
Copy full SHA for eb65cbb - Browse repository at this point
Copy the full SHA eb65cbbView commit details -
fix: Add external intersphinx mappings
This enables proper reference resolution during the docs build, and provides useful links on the generated doc pages.
Configuration menu - View commit details
-
Copy full SHA for bf2d133 - Browse repository at this point
Copy the full SHA bf2d133View commit details -
fix: Add doc pages to resolve references
Without these pages, there would be warnings such as: WARNING: py:class reference target not found: AugurError WARNING: py:class reference target not found: DataErrorMethod It's a good idea to have these doc pages regardless.
Configuration menu - View commit details
-
Copy full SHA for 862f749 - Browse repository at this point
Copy the full SHA 862f749View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b896c2 - Browse repository at this point
Copy the full SHA 9b896c2View commit details -
np.isscalar will return true for a float, but that is not valid input for np.linspace(num). Instead, allow native or numpy integers.
Configuration menu - View commit details
-
Copy full SHA for 445d73f - Browse repository at this point
Copy the full SHA 445d73fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ee58907 - Browse repository at this point
Copy the full SHA ee58907View commit details -
fix numpydoc: Add an extra line between numpydoc and doctest
Otherwise the doctest gets parsed as numpydoc.
Configuration menu - View commit details
-
Copy full SHA for 3071e37 - Browse repository at this point
Copy the full SHA 3071e37View commit details -
fix numpydoc: Add Examples section for doctests
Better than the previous commit since this section is made for doctest examples¹. ¹ https://numpydoc.readthedocs.io/en/v1.5.0/format.html#examples
Configuration menu - View commit details
-
Copy full SHA for cc77b51 - Browse repository at this point
Copy the full SHA cc77b51View commit details -
fix numpydoc: Use numpydoc type hints
The bracket notation is suggested by PyCharm¹ but is not standard numpydoc. ¹ https://www.jetbrains.com/help/pycharm/type-syntax-for-docstrings.html
Configuration menu - View commit details
-
Copy full SHA for cc52176 - Browse repository at this point
Copy the full SHA cc52176View commit details -
fix numpydoc: Correct type of label
"label" is not a valid type; it should be "str".
Configuration menu - View commit details
-
Copy full SHA for 9ac2386 - Browse repository at this point
Copy the full SHA 9ac2386View commit details -
fix numpydoc: Remove trailing colon from exception classes
These resulted in nitpick "reference target not found" warnings.
Configuration menu - View commit details
-
Copy full SHA for 3a9c6ff - Browse repository at this point
Copy the full SHA 3a9c6ffView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f87db7 - Browse repository at this point
Copy the full SHA 2f87db7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ad5369 - Browse repository at this point
Copy the full SHA 3ad5369View commit details -
fix numpydoc: Remove docstring from traits.register_parser
Other register_parser functions don't have a docstring, and this one is out of date.
Configuration menu - View commit details
-
Copy full SHA for 5b37985 - Browse repository at this point
Copy the full SHA 5b37985View commit details -
fix numpydoc: Remove "TYPE" placeholders
These were causing nitpick warnings: WARNING: py:class reference target not found: TYPE
Configuration menu - View commit details
-
Copy full SHA for 8865478 - Browse repository at this point
Copy the full SHA 8865478View commit details -
Configuration menu - View commit details
-
Copy full SHA for a8b1c5f - Browse repository at this point
Copy the full SHA a8b1c5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf1d935 - Browse repository at this point
Copy the full SHA cf1d935View commit details -
fix numpydoc: Properly reference Bio.Phylo.BaseTree.Tree
Bio.Phylo is the module, not the tree class. This could instead be something more specific like Bio.Phylo.Newick.Tree, but I opted for the more generic type.
Configuration menu - View commit details
-
Copy full SHA for f6435c6 - Browse repository at this point
Copy the full SHA f6435c6View commit details -
fix numpydoc: Properly reference Bio.Phylo.BaseTree.Clade
`Phylo.Node` is not a valid class. I believe the intention is `Bio.Phylo.BaseTree.Clade`, since that is the type of `Bio.Phylo.BaseTree.Tree.root`
Configuration menu - View commit details
-
Copy full SHA for 64d8bc5 - Browse repository at this point
Copy the full SHA 64d8bc5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2c7c6ed - Browse repository at this point
Copy the full SHA 2c7c6edView commit details -
Configuration menu - View commit details
-
Copy full SHA for 30781e1 - Browse repository at this point
Copy the full SHA 30781e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for ef70f10 - Browse repository at this point
Copy the full SHA ef70f10View commit details -
fix numpydoc: Update reference of pandas TextFileReader
This class lives at pandas.io.parsers.TextFileReader, however, there are no public docs for it and it isn't linked on pandas doc pages either¹. Use single backticks to disable linking while denoting that it is a class². ¹ https://pandas.pydata.org/pandas-docs/version/1.4/reference/api/pandas.read_csv.html ² https://numpydoc.readthedocs.io/en/latest/format.html#common-rest-concepts
Configuration menu - View commit details
-
Copy full SHA for 2ba5428 - Browse repository at this point
Copy the full SHA 2ba5428View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e3705d - Browse repository at this point
Copy the full SHA 8e3705dView commit details