Skip to content

Commit

Permalink
enable doctests (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathause authored Feb 22, 2024
1 parent 2a4ddb1 commit b6241a5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,24 @@ jobs:
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false

doctest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest -e .
- name: Test with pytest
run: |
python -m pytest --doctest-modules mplotutils --ignore mplotutils/tests
6 changes: 3 additions & 3 deletions mplotutils/cartopy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ def cyclic_dataarray(obj, coord="lon"):
... )
>>> data_cyclic = cyclic_dataarray(data, 'y')
>>> data_cyclic
<xarray.DataArray (x: 2, y: 4)>
<xarray.DataArray (x: 2, y: 4)> Size: 64B
array([[1, 2, 3, 1],
[4, 5, 6, 4]])
Coordinates:
* x (x) int64 1 2
* y (y) int64 0 1 2 3
* x (x) int64 16B 1 2
* y (y) int64 32B 0 1 2 3
"""

Expand Down

0 comments on commit b6241a5

Please sign in to comment.