diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml new file mode 100644 index 000000000..6df2e0719 --- /dev/null +++ b/.github/workflows/documentation.yaml @@ -0,0 +1,24 @@ +name: Docs +on: [push, pull_request, workflow_dispatch] +permissions: + contents: write +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - name: Install dependencies + run: | + pip install sphinx sphinx_rtd_theme sphinx_book_theme + - name: Sphinx build + run: | + sphinx-build docs _build + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _build/ + force_orphan: true diff --git a/.gitignore b/.gitignore index a91967f83..f33a818cf 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,7 @@ instance/ # Sphinx documentation docs/_build/ +_build/ # PyBuilder target/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dd8e8b451..4f98bfd8e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,13 @@ +# Configuration file for `pre-commit` tool. +# Source: https://pre-commit.com/#pre-commit-configyaml---top-level exclude: "docs|node_modules|migrations|.git|.tox|.md|sample_setups/(external-setups|jsons)|tests/deprecated" default_stages: [commit] fail_fast: true repos: + # ======================= + # General file formatters + # ======================= - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: @@ -11,6 +16,9 @@ repos: - id: end-of-file-fixer - id: check-yaml + # ======================= + # Python code formatters + # ======================= - repo: https://github.com/psf/black rev: 23.1.0 hooks: @@ -21,8 +29,10 @@ repos: hooks: - id: isort - # Need to use flake8 GitHub mirror due to CentOS git issue with GitLab - # https://github.com/pre-commit/pre-commit/issues/1206 + + # ======================= + # Python linting + # ======================= - repo: https://github.com/pycqa/flake8 rev: 6.0.0 hooks: diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..b0d3b9a1c --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,36 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "mambaforge-4.10" + #python: "3.11" + # You can also specify other tool versions: + # nodejs: "19" + # rust: "1.64" + # golang: "1.19" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +formats: + - pdf +# - epub + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +# python: +# install: +# - requirements: docs/requirements.txt + +conda: + environment: conda-env/readthedocs.yml diff --git a/README.md b/README.md index 46b7aef58..ca36bd97b 100755 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ Release Notes and History |
<xarray.Dataset>\n", + "Dimensions: (time: 1272, bound: 2, lat: 145, lon: 192)\n", + "Coordinates:\n", + " * time (time) object 1900-01-16 12:00:00 ... 2005-12-16 12:00:00\n", + " * lat (lat) float64 -90.0 -88.75 -87.5 -86.25 ... 87.5 88.75 90.0\n", + " * lon (lon) float64 0.0 1.875 3.75 5.625 ... 352.5 354.4 356.2 358.1\n", + "Dimensions without coordinates: bound\n", + "Data variables:\n", + " bounds_time (time, bound) object ...\n", + " pc (time) float64 ...\n", + " lat_bnds (lat, bound) float64 ...\n", + " lon_bnds (lon, bound) float64 ...\n", + " eof (lat, lon) float64 ...\n", + " slope (lat, lon) float64 ...\n", + " intercept (lat, lon) float64 ...\n", + " frac float64 ...\n", + "Attributes:\n", + " Conventions: CF-1.0