diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml new file mode 100644 index 0000000..b217ef7 --- /dev/null +++ b/.github/workflows/docs-deploy.yml @@ -0,0 +1,61 @@ +name: Deploy Documentation + +on: + push: + branches: + - main + workflow_dispatch: # Allow manual triggering + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r docs/requirements.txt + pip install -e . + + - name: Build documentation + run: | + cd docs + make html + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/_build/html/ + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..3546ecc --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,48 @@ +name: Documentation + +on: + pull_request: + branches: + - main + schedule: + # Run nightly at 2:00 AM UTC + - cron: '0 2 * * *' + workflow_dispatch: # Allow manual triggering + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r docs/requirements.txt + pip install -e . + + - name: Build documentation + run: | + cd docs + make html + + - name: Upload documentation artifact + uses: actions/upload-artifact@v4 + with: + name: documentation + path: docs/_build/html/ + retention-days: 7 + + - name: Check for warnings + run: | + cd docs + # Rebuild with warnings as errors to catch issues + make clean + sphinx-build -W -b html . _build/html diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/.gitkeep b/docs/_static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/_templates/.gitkeep b/docs/_templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/api/config.rst b/docs/api/config.rst new file mode 100644 index 0000000..5dadb29 --- /dev/null +++ b/docs/api/config.rst @@ -0,0 +1,23 @@ +Config Module +============= + +.. automodule:: radclss.config + :members: + :undoc-members: + :show-inheritance: + +radclss.config.default_config +----------------------------- + +.. automodule:: radclss.config.default_config + :members: + :undoc-members: + :show-inheritance: + +radclss.config.output_config +---------------------------- + +.. automodule:: radclss.config.output_config + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/core.rst b/docs/api/core.rst new file mode 100644 index 0000000..d9a846c --- /dev/null +++ b/docs/api/core.rst @@ -0,0 +1,15 @@ +Core Module +=========== + +.. automodule:: radclss.core + :members: + :undoc-members: + :show-inheritance: + +radclss.core.radclss_core +------------------------- + +.. automodule:: radclss.core.radclss_core + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/index.rst b/docs/api/index.rst new file mode 100644 index 0000000..f3cffd5 --- /dev/null +++ b/docs/api/index.rst @@ -0,0 +1,15 @@ +API Reference +============= + +This section contains the complete API documentation for radclss, automatically +generated from the source code docstrings. + +.. toctree:: + :maxdepth: 2 + :caption: Modules: + + core + config + io + util + vis diff --git a/docs/api/io.rst b/docs/api/io.rst new file mode 100644 index 0000000..3c75b9c --- /dev/null +++ b/docs/api/io.rst @@ -0,0 +1,15 @@ +IO Module +========= + +.. automodule:: radclss.io + :members: + :undoc-members: + :show-inheritance: + +radclss.io.write +---------------- + +.. automodule:: radclss.io.write + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/util.rst b/docs/api/util.rst new file mode 100644 index 0000000..a18af7a --- /dev/null +++ b/docs/api/util.rst @@ -0,0 +1,15 @@ +Util Module +=========== + +.. automodule:: radclss.util + :members: + :undoc-members: + :show-inheritance: + +radclss.util.column_utils +------------------------- + +.. automodule:: radclss.util.column_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/vis.rst b/docs/api/vis.rst new file mode 100644 index 0000000..0f62845 --- /dev/null +++ b/docs/api/vis.rst @@ -0,0 +1,15 @@ +Visualization Module +==================== + +.. automodule:: radclss.vis + :members: + :undoc-members: + :show-inheritance: + +radclss.vis.quicklooks +---------------------- + +.. automodule:: radclss.vis.quicklooks + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..a30f782 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,70 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +import os +import sys + +# Add the source directory to the path so autodoc can find the modules +sys.path.insert(0, os.path.abspath("../src")) + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "radclss" +copyright = "2025, radclss contributors" +author = "radclss contributors" +release = "0.1.0" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", + "sphinx.ext.intersphinx", +] + +# Autodoc settings +autodoc_default_options = { + "members": True, + "undoc-members": True, + "show-inheritance": True, + "member-order": "bysource", +} + +# Generate autosummary pages automatically +autosummary_generate = True + +# Napoleon settings for Google/NumPy style docstrings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_init_with_doc = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True + +# Intersphinx mapping +intersphinx_mapping = { + "python": ("https://docs.python.org/3", None), + "numpy": ("https://numpy.org/doc/stable/", None), + "pandas": ("https://pandas.pydata.org/docs/", None), +} + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_rtd_theme" +html_static_path = ["_static"] + +# Theme options +html_theme_options = { + "navigation_depth": 4, + "collapse_navigation": False, + "sticky_navigation": True, +} diff --git a/docs/getting_started.rst b/docs/getting_started.rst new file mode 100644 index 0000000..f946e27 --- /dev/null +++ b/docs/getting_started.rst @@ -0,0 +1,33 @@ +Getting Started +=============== + +Installation +------------ + +You can install radclss using pip: + +.. code-block:: bash + + pip install radclss + +Or install from source: + +.. code-block:: bash + + git clone https://github.com/your-org/radclss.git + cd radclss + pip install -e . + +Quick Start +----------- + +Here's a simple example to get you started: + +.. code-block:: python + + import radclss + + # Your example code here + pass + +For more detailed examples, see the :doc:`api/index` documentation. diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..6767ebc --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,18 @@ +radclss Documentation +===================== + +Welcome to the radclss documentation! + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + getting_started + api/index + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..954237b --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..120ae98 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,12 @@ +sphinx>=7.0 +sphinx-rtd-theme>=2.0 +arm_pyart +pip +act-atmos +xradar +matplotlib +dask +distributed +xarray==2025.6.1 +sphinx +sphinx-rtd-theme diff --git a/src/radclss/core/__init__.py b/src/radclss/core/__init__.py index 782e7d9..37c88ac 100644 --- a/src/radclss/core/__init__.py +++ b/src/radclss/core/__init__.py @@ -9,6 +9,7 @@ :toctree: generated/ radclss_core + """ from .radclss_core import radclss # noqa: F401 diff --git a/src/radclss/core/radclss_core.py b/src/radclss/core/radclss_core.py index 22a41a9..bbf04a5 100644 --- a/src/radclss/core/radclss_core.py +++ b/src/radclss/core/radclss_core.py @@ -38,8 +38,8 @@ def radclss( volumes : Dictionary Dictionary contianing files for each of the instruments, including all CMAC processed radar files per day. Each key is formatted as follows: - 'date': 'YYYYMMDD' - 'instrument_site': file/list of files + 'date': 'YYYYMMDD' + 'instrument_site': file/list of files where instrument is one of the supported instruments (radar, met, sonde, pluvio, ld, vd, wxt) and site is the site name (e.g., M1, SGP, TWP, etc). input_site_dict : Dictionary diff --git a/src/radclss/util/column_utils.py b/src/radclss/util/column_utils.py index 986b939..62f7663 100644 --- a/src/radclss/util/column_utils.py +++ b/src/radclss/util/column_utils.py @@ -22,9 +22,9 @@ def subset_points( input_site_dict : dict Dictionary containing the site names as keys and their lat/lon coordinates as values in a list format: - {'site1': [lat1, lon1, alt1], - 'site2': [lat2, lon2, alt2], - ...} + {'site1': [lat1, lon1, alt1], + 'site2': [lat2, lon2, alt2], + ...} sonde : list, optional List of radiosonde file paths to be merged into the radar prior to column extraction. The nearest sonde file to the