Skip to content

Commit

Permalink
mirror API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Aug 13, 2024
1 parent 84df2ee commit 576c022
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 42 deletions.
2 changes: 1 addition & 1 deletion docs/api/nwbinspector.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Core Library
============

.. automodule:: nwbinspector.nwbinspector
.. automodule:: nwbinspector._nwbinspector
4 changes: 3 additions & 1 deletion docs/api/register_check.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ Data Classes and Check Registration

All common data class used across the package, as well as the decorator for adding a check function to the registry.

.. automodule:: nwbinspector.register_checks
.. automodule:: nwbinspector._types

.. automodule:: nwbinspector._registration
9 changes: 6 additions & 3 deletions docs/api/tools.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Tools for Organizating and Displaying Reports
=============================================
Tools for Organizing and Displaying Reports
===========================================

.. automodule:: nwbinspector
:members:
Expand All @@ -9,5 +9,8 @@ Tools for Organizating and Displaying Reports
.. toctree::
:maxdepth: 4

.. automodule:: nwbinspector.inspector_tools
.. automodule:: nwbinspector._organization
:noindex:

.. automodule:: nwbinspector._formatting
:noindex:
38 changes: 36 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import os
import sys
from pathlib import Path

from nwbinspector import available_checks
from collections import defaultdict

sys.path.append(str(Path(__file__).parent))
from conf_extlinks import extlinks, intersphinx_mapping
from gen_checks_by_importance import gen_checks_by_importance

sys.path.insert(0, Path(__file__).resolve().parents[1])

Expand Down Expand Up @@ -73,4 +76,35 @@ def setup(app):
app.connect("autodoc-process-docstring", add_refs_to_docstrings)


gen_checks_by_importance()
def _gen_checks_by_importance():
dd = defaultdict(list)

for x in available_checks:
dd[x.importance.name.replace("_", " ")].append(x)

generate_checks_rst_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "checks_by_importance.rst")
with open(generate_checks_rst_file, "w") as f:
f.write(
"""Checks by Importance
======================
This section lists the available checks organized by their importance level.
"""
)

for importance_level, checks in dd.items():
f.write(
f"""{importance_level}
{'-' * (len(f'{importance_level}') + 1)}
"""
)

for check in checks:
f.write(f"* :py:func:`~{check.__module__}.{check.__name__}`\n")

f.write("\n")


_gen_checks_by_importance()
35 changes: 0 additions & 35 deletions docs/gen_checks_by_importance.py

This file was deleted.

0 comments on commit 576c022

Please sign in to comment.