Skip to content

Commit de5dd33

Browse files
authored
Merge branch 'NCAR:main' into update_colors
2 parents 8a77ef8 + 18d74ac commit de5dd33

37 files changed

+629
-77
lines changed

.github/workflows/ci.yml

+18-24
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,35 @@ on:
88
- cron: '0 0 * * *' # Daily “At 00:00”
99
workflow_dispatch:
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
test:
1317
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
1418
runs-on: ${{ matrix.os }}
1519
defaults:
1620
run:
1721
shell: bash -l {0}
18-
1922
strategy:
2023
fail-fast: false
2124
matrix:
22-
os: [ "ubuntu-latest", "macos-latest", "macos-14", "windows-latest"]
23-
python-version: [ "3.9", "3.11", "3.12" ]
25+
os: [ "ubuntu-latest", "macos-latest", "windows-latest"]
26+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
2427
steps:
25-
- name: Cancel previous runs
26-
uses: styfle/[email protected]
27-
with:
28-
access_token: ${{ github.token }}
2928
- name: checkout
3029
uses: actions/checkout@v4
31-
with:
32-
token: ${{ github.token }}
33-
- name: conda_setup
34-
uses: conda-incubator/setup-miniconda@v3
35-
if: matrix.os != 'macos-14'
36-
with:
37-
activate-environment: geocat_viz_build
38-
channel-priority: strict
39-
python-version: ${{ matrix.python-version }}
40-
channels: conda-forge
41-
environment-file: build_envs/environment.yml
42-
- name: conda_setup_m1
30+
31+
- name: environment setup
4332
uses: conda-incubator/setup-miniconda@v3
44-
if: matrix.os == 'macos-14'
4533
with:
46-
installer-url: https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Mambaforge-23.11.0-0-MacOSX-arm64.sh
4734
activate-environment: geocat_viz_build
4835
channel-priority: strict
4936
python-version: ${{ matrix.python-version }}
5037
channels: conda-forge
5138
environment-file: build_envs/environment.yml
39+
5240
- name: Install geocat-viz
5341
run: |
5442
python -m pip install . --no-deps
@@ -57,6 +45,10 @@ jobs:
5745
run: |
5846
conda list
5947
48+
- name: tests
49+
run: |
50+
python -m pytest
51+
6052
link-check:
6153
runs-on: ubuntu-latest
6254
defaults:
@@ -65,22 +57,24 @@ jobs:
6557
steps:
6658
- name: checkout
6759
uses: actions/checkout@v4
68-
with:
69-
token: ${{ github.token }}
70-
- name: conda_setup
60+
61+
- name: environment setup
7162
uses: conda-incubator/setup-miniconda@v3
7263
with:
7364
activate-environment: gv-docs
7465
channel-priority: strict
7566
python-version: 3.9
7667
channels: conda-forge
7768
environment-file: build_envs/docs.yml
69+
7870
- name: Install geocat-viz
7971
run: |
8072
python -m pip install .
73+
8174
- name: check conda list
8275
run: |
8376
conda list
77+
8478
- name: Make docs with linkcheck
8579
run: |
8680
cd docs

.github/workflows/pre-commit.yml

-15
This file was deleted.

.github/workflows/pypi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
python -m twine check dist/*
5050
5151
- name: Publish package to PyPI
52-
uses: pypa/gh-action-pypi-publish@v1.8.11
52+
uses: pypa/gh-action-pypi-publish@v1.10.3
5353
with:
5454
skip-existing: true
5555
verbose: true

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ docs/_build/
1111
dist/
1212
.eggs/
1313
*egg-info
14+
15+
# IDEs
16+
settings.json

.pre-commit-config.yaml

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
repos:
2-
- repo: https://github.com/pre-commit/mirrors-yapf # To format the code to conform YAPF
3-
rev: v0.31.0
2+
- repo: https://github.com/google/yapf # To format the code to conform YAPF
3+
rev: v0.40.2
44
hooks:
55
- id: yapf
66
args: ['--in-place', '--recursive', '--style', 'google']
7+
require_serial: true
78

8-
- repo: https://github.com/myint/docformatter # To format the doc strings to conform PEP257
9-
rev: v1.4
9+
- repo: https://github.com/PyCQA/docformatter # To format the doc strings to conform PEP257
10+
rev: v1.7.5
1011
hooks:
1112
- id: docformatter
1213
args: [--in-place]
1314

1415
- repo: https://github.com/pre-commit/pre-commit-hooks # Some common pre-commit hooks
15-
rev: v3.4.0
16+
rev: v4.6.0
1617
hooks:
1718
- id: check-yaml # Checks the syntax of .yaml files.
1819
args: [--allow-multiple-documents]
1920
exclude: 'meta.yaml' # Exclude this because it gives an error for '%' in Line 1 and couldn't fix yet
2021
- id: end-of-file-fixer # Makes sure files end with a newline.
2122
- id: trailing-whitespace # Checks for any tabs or spaces after the last non-whitespace character on the line.
2223
- id: check-docstring-first # Checks that code comes after the docstrings.
24+
- id: check-yaml # Check valid yml file
25+
26+
ci:
27+
autofix_prs: false
28+
autoupdate_schedule: monthly

MANIFEST.in

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
include LICENSE
2+
include README.md
3+
4+
recursive-include geocat *.py
5+
recursive-exclude * __pycache__
6+
recursive-exclude * *.py[co]
7+
exclude .gitignore
8+
exclude .pre-commit-config.yaml
9+
exclude .readthedocs.yml
10+
11+
include *.md
12+
include *.toml
13+
include *.yaml
14+
include *.txt
15+
prune test*
16+
prune .github*
17+
prune docs*
18+
prune build_envs*

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11

22
# GeoCAT-viz
33

4-
The GeoCAT-viz repo contains tools to help plot data, including convenience and plotting functions that are used
5-
to facilitate plotting geosciences data with Matplotlib, Cartopy, and possibly other Python ecosystem
6-
plotting packages. GeoCAT-viz functionality is used by
7-
[GeoCAT-examples](https://github.com/NCAR/geocat-examples) and is of possible use for other GeoCAT components.
4+
GeoCAT-viz contains tools to help plot geoscience data, including convenience and plotting functions that are
5+
used to facilitate plotting geosciences data with Matplotlib, Cartopy, and other visualization packages.
6+
GeoCAT-viz functionality is used by
7+
[GeoCAT-examples](https://github.com/NCAR/geocat-examples).
88

9-
| **Docs** | [![Documentation Status][rtd-badge]][rtd-link] |
9+
| **CI** | [![GitHub Workflow Status][github-ci-badge]][github-ci-link] |
1010
|:------------------------:|:--------------------------------------------------------------------------------:|
11+
| **Docs** | [![Documentation Status][rtd-badge]][rtd-link] |
1112
| **Package** | [![Conda][conda-badge]][conda-link] [![PyPI][pypi-badge]][pypi-link] |
1213
| **License** | [![License][license-badge]][license-badge-link] |
1314
| **DOI** | [![DOI][doi-badge]][doi-link] |
@@ -31,6 +32,8 @@ https://geocat-viz.readthedocs.io/en/latest/citation.html) page.
3132

3233
[comment]: <> (reference links used for badges.)
3334

35+
[github-ci-badge]: https://img.shields.io/github/actions/workflow/status/NCAR/geocat-viz/ci.yml?branch=main&label=CI&style=for-the-badge
36+
[github-ci-link]: https://github.com/NCAR/geocat-viz/actions/workflows/ci.yml
3437
[rtd-badge]: https://img.shields.io/readthedocs/geocat-viz/latest.svg?style=for-the-badge
3538
[rtd-link]: https://geocat-viz.readthedocs.io/en/latest/?badge=latest
3639
[pypi-badge]: https://img.shields.io/pypi/v/geocat-viz?logo=pypix&style=for-the-badge

build_envs/environment.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ dependencies:
77
- make
88
- matplotlib
99
- sphinx
10-
- pip
1110
- cmaps
1211
- numpy
1312
- xarray
1413
- metpy
1514
- pint
15+
- pytest
16+
- pytest-mpl
1617
- geocat-datafiles
17-
- pip:
18-
- pre-commit
19-
- scikit-learn
18+
- pre-commit
19+
- scikit-learn

docs/conf.py

+3
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ def update_gallery(app: Sphinx):
369369
# generate warning for all invalid links
370370
#nitpicky = True
371371

372+
# add links to ignore during link checking
373+
linkcheck_ignore = [r'https://stackoverflow.com/*']
374+
372375

373376
# Allow for changes to be made to the css in the theme_overrides file
374377
def setup(app):

docs/examples/taylor.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"\n",
5858
"# Draw diagonal dashed lines from origin to correlation values\n",
5959
"# Also enforces proper X-Y ratio\n",
60-
"taylor.add_xgrid(np.array([0.6, 0.9]))\n",
60+
"taylor.add_corr_grid(np.array([0.6, 0.9]))\n",
6161
"\n",
6262
"# Add models to Taylor diagram\n",
6363
"taylor.add_model_set(a_sdev,\n",

docs/release-notes.rst

+36-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,39 @@
55
Release Notes
66
=============
77

8-
v2024.03.0 (Unreleased)
9-
-----------------------
8+
v2024.xx.0 (unreleased)
9+
---------------------------
10+
11+
Internal Changes
12+
^^^^^^^^^^^^^^^^
13+
* Update pre-commit versions and configuration by `Katelyn FitzGerald`_ in (:pr:`247`)
14+
* Remove M1 workaround for CI and tokens that are no longer needed by `Katelyn FitzGerald`_ in (:pr:`232`)
15+
16+
Testing
17+
^^^^^^^
18+
* Add basic testing infrastructure by `Katelyn FitzGerald`_ and `Julia Kent`_ in (:pr:`233`)
19+
* Add tests for `viz.taylor` by `Julia Kent`_ in (:pr:`234`)
20+
* Add tests for `viz.util` by `Julia Kent`_ in (:pr:`239`)
21+
* Remove now duplicative macOS runner from CI and add back in Python 3.10 by `Katelyn FitzGerald`_ in (:pr:`240`)
22+
23+
24+
v2024.03.0 (March 26, 2024)
25+
---------------------------
26+
This release deprecates ``TaylorDiagram`` method names ``add_xgrid()`` and
27+
``add_ygrid()`` in favor of the more descriptive ``add_corr_grid()`` and ``add_std_grid()``.
28+
29+
Documentation
30+
^^^^^^^^^^^^^
31+
* Document known issue with `suptitle` argument of ``set_titles_and_labels`` and Cartopy plots by `Julia Kent`_ in (:pr:`219`)
32+
33+
Deprecations
34+
^^^^^^^^^^
35+
* Pending deprecation warnings added for ``TaylorDiagram`` methods ``add_xgrid`` and ``add_ygrid`` which are changing to the new ``add_corr_grid`` and ``add_std_grid`` by `Julia Kent`_ in (:pr:`219`)
36+
37+
38+
v2024.02.1 (February 28, 2024)
39+
------------------------------
40+
This release changes to implicit namespace packaging and addresses a bug in the Taylor diagram functionality when disabling ``annotate_on``.
1041

1142
Bug Fixes
1243
^^^^^^^^^
@@ -15,6 +46,8 @@ Bug Fixes
1546
Internal Changes
1647
^^^^^^^^^^^^^^^^
1748
* Switch to PyPI Trusted Publishing by `Orhan Eroglu`_ in (:pr:`208`)
49+
* Add ``linkcheck_ignore`` to ``docs/conf.py`` to address erroneous failures and add CI badge to README by `Katelyn FitzGerald`_ in (:pr:`218`)
50+
* Convert to implicit namespace packaging set up by `Anissa Zacharias`_ in (:pr:`220`)
1851

1952
v2024.02.0 (February 6, 2024)
2053
-----------------------------
@@ -122,3 +155,4 @@ Documentation
122155
.. _`Katelyn Fitzgerald`: https://github.com/kafitzgerald
123156
.. _`Simon Rosanka`: https://github.com/srosanka
124157
.. _`Orhan Eroglu`: https://github.com/erogluorhan
158+
.. _`Anissa Zacharias`: https://github.com/anissa111

setup.cfg

+8-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ include_package_data = True
2929
python_requires = >=3.9, <3.13
3030
package_dir =
3131
=src
32-
packages =
33-
geocat
34-
geocat.viz
32+
packages = find_namespace:
3533
setup_requires =
3634
setuptools_scm
3735
setuptools
@@ -45,6 +43,12 @@ install_requires =
4543
setuptools
4644
scikit-learn
4745
metpy
46+
tests_require =
47+
pytest
48+
pytest-mpl
49+
50+
[options.packages.find]
51+
where = src
4852

4953
[options.extras_require]
5054
docs =
@@ -63,7 +67,7 @@ docs =
6367

6468
[tool:pytest]
6569
python_files = test_*.py
66-
testpaths = test
70+
testpaths = tests
6771

6872
[aliases]
6973
test = pytest

src/geocat/__init__.py

-1
This file was deleted.

0 commit comments

Comments
 (0)