Skip to content

Commit

Permalink
Merge pull request #1525: Sync outdated developer API docs, add check…
Browse files Browse the repository at this point in the history
… in CI
  • Loading branch information
victorlin authored Jul 9, 2024
2 parents e11163d + 3e7c3d8 commit 25be480
Show file tree
Hide file tree
Showing 81 changed files with 330 additions and 140 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,23 @@ jobs:
with:
docs-directory: docs/
pip-install-target: .[dev]

check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5

- uses: actions/checkout@v4

- run: pip install .[dev]

- run: ./devel/generate-developer-api-docs

- name: Check for changes
run: |
if [[ -n $(git status --porcelain) ]]; then
git add .
git diff --staged >&2
echo "There are changes to the developer API docs. Please regenerate, commit, and push the changes." >&2
exit 1
fi
2 changes: 1 addition & 1 deletion augur/argparse_.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def add_command_subparsers(subparsers, commands, command_attribute='__command__'
The special subparsers action object created by the parent parser
via `parser.add_subparsers()`.
commands: list[ModuleType]
commands: list[types.ModuleType]
A list of modules that are commands that require their own subparser.
Each module is required to have a `register_parser` function to add its own
subparser and arguments.
Expand Down
2 changes: 1 addition & 1 deletion augur/curate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def create_shared_parser():
that are intended to be shared across the subcommands.
Note that any options strings used here cannot be used in individual subcommand
subparsers unless the subparser specifically sets `conflict_handler='resolve'`²,
subparsers unless the subparser specifically sets `conflict_handler='resolve'` ²,
then the subparser option will override the option defined here.
Based on https://stackoverflow.com/questions/23296695/permit-argparse-global-flags-after-subcommand/23296874#23296874
Expand Down
3 changes: 3 additions & 0 deletions augur/curate/apply_geolocation_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def load_geolocation_rules(geolocation_rules_file):
"""
Loads the geolocation rules from the provided *geolocation_rules_file*.
Returns the rules as a dict:
.. code-block:: text
{
regions: {
countries: {
Expand Down
9 changes: 9 additions & 0 deletions devel/generate-developer-api-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

sphinx-apidoc \
--force \
--module-first \
--separate \
--no-toc \
--output-dir docs/api/developer \
augur
4 changes: 2 additions & 2 deletions docs/api/developer/augur.align.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.align
===========
augur.align module
==================

.. automodule:: augur.align
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.ancestral.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.ancestral
===============
augur.ancestral module
======================

.. automodule:: augur.ancestral
:members:
Expand Down
7 changes: 7 additions & 0 deletions docs/api/developer/augur.argparse_.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.argparse\_ module
=======================

.. automodule:: augur.argparse_
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/api/developer/augur.clades.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.clades
============
augur.clades module
===================

.. automodule:: augur.clades
:members:
Expand Down
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.abbreviate_authors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.abbreviate\_authors module
=======================================

.. automodule:: augur.curate.abbreviate_authors
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.apply_geolocation_rules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.apply\_geolocation\_rules module
=============================================

.. automodule:: augur.curate.apply_geolocation_rules
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.apply_record_annotations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.apply\_record\_annotations module
==============================================

.. automodule:: augur.curate.apply_record_annotations
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.format_dates.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.format\_dates module
=================================

.. automodule:: augur.curate.format_dates
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.format_dates_directives.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.format\_dates\_directives module
=============================================

.. automodule:: augur.curate.format_dates_directives
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.normalize_strings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.normalize\_strings module
======================================

.. automodule:: augur.curate.normalize_strings
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.parse_genbank_location.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.parse\_genbank\_location module
============================================

.. automodule:: augur.curate.parse_genbank_location
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.passthru.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.passthru module
============================

.. automodule:: augur.curate.passthru
:members:
:undoc-members:
:show-inheritance:
24 changes: 24 additions & 0 deletions docs/api/developer/augur.curate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
augur.curate package
====================

.. automodule:: augur.curate
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 4

augur.curate.abbreviate_authors
augur.curate.apply_geolocation_rules
augur.curate.apply_record_annotations
augur.curate.format_dates
augur.curate.format_dates_directives
augur.curate.normalize_strings
augur.curate.parse_genbank_location
augur.curate.passthru
augur.curate.titlecase
augur.curate.transform_strain_name
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.titlecase.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.titlecase module
=============================

.. automodule:: augur.curate.titlecase
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/developer/augur.curate.transform_strain_name.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.curate.transform\_strain\_name module
===========================================

.. automodule:: augur.curate.transform_strain_name
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/developer/augur.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.data package
==================

.. automodule:: augur.data
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/api/developer/augur.dates.ambiguous_date.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.dates.ambiguous\_date
=======================================
augur.dates.ambiguous\_date module
==================================

.. automodule:: augur.dates.ambiguous_date
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.dates.errors.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.dates.errors
==================
augur.dates.errors module
=========================

.. automodule:: augur.dates.errors
:members:
Expand Down
8 changes: 6 additions & 2 deletions docs/api/developer/augur.dates.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
augur.dates
===========
augur.dates package
===================

.. automodule:: augur.dates
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 4

augur.dates.ambiguous_date
augur.dates.errors
4 changes: 2 additions & 2 deletions docs/api/developer/augur.distance.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.distance
==============
augur.distance module
=====================

.. automodule:: augur.distance
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.errors.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.errors
============
augur.errors module
===================

.. automodule:: augur.errors
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.export.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.export
============
augur.export module
===================

.. automodule:: augur.export
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.export_v1.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.export\_v1
================
augur.export\_v1 module
=======================

.. automodule:: augur.export_v1
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.export_v2.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.export\_v2
================
augur.export\_v2 module
=======================

.. automodule:: augur.export_v2
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.filenames.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.filenames
===============
augur.filenames module
======================

.. automodule:: augur.filenames
:members:
Expand Down
7 changes: 0 additions & 7 deletions docs/api/developer/augur.filter._run.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/api/developer/augur.filter.constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
augur.filter.constants module
=============================

.. automodule:: augur.filter.constants
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/api/developer/augur.filter.include_exclude_rules.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.filter.include_exclude_rules
==================================
augur.filter.include\_exclude\_rules module
===========================================

.. automodule:: augur.filter.include_exclude_rules
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.filter.io.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.filter.io
===============
augur.filter.io module
======================

.. automodule:: augur.filter.io
:members:
Expand Down
10 changes: 7 additions & 3 deletions docs/api/developer/augur.filter.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
augur.filter
============
augur.filter package
====================

.. automodule:: augur.filter
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 4

augur.filter._run
augur.filter.constants
augur.filter.include_exclude_rules
augur.filter.io
augur.filter.subsample
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.filter.subsample.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.filter.subsample
======================
augur.filter.subsample module
=============================

.. automodule:: augur.filter.subsample
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.filter.validate_arguments.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.filter.validate_arguments
===============================
augur.filter.validate\_arguments module
=======================================

.. automodule:: augur.filter.validate_arguments
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.frequencies.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.frequencies
=================
augur.frequencies module
========================

.. automodule:: augur.frequencies
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/developer/augur.frequency_estimators.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.frequency\_estimators
===========================
augur.frequency\_estimators module
==================================

.. automodule:: augur.frequency_estimators
:members:
Expand Down
11 changes: 0 additions & 11 deletions docs/api/developer/augur.import.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
augur.import.beast
==================
augur.import\_.beast module
===========================

.. automodule:: augur.import_.beast
:members:
Expand Down
Loading

0 comments on commit 25be480

Please sign in to comment.