Skip to content

Commit

Permalink
Merge branch 'NCAR:main' into update_colors
Browse files Browse the repository at this point in the history
  • Loading branch information
kafitzgerald authored Oct 16, 2024
2 parents 8a77ef8 + 18d74ac commit de5dd33
Show file tree
Hide file tree
Showing 37 changed files with 629 additions and 77 deletions.
42 changes: 18 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,35 @@ on:
- cron: '0 0 * * *' # Daily “At 00:00”
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest", "macos-14", "windows-latest"]
python-version: [ "3.9", "3.11", "3.12" ]
os: [ "ubuntu-latest", "macos-latest", "windows-latest"]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: checkout
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: conda_setup
uses: conda-incubator/setup-miniconda@v3
if: matrix.os != 'macos-14'
with:
activate-environment: geocat_viz_build
channel-priority: strict
python-version: ${{ matrix.python-version }}
channels: conda-forge
environment-file: build_envs/environment.yml
- name: conda_setup_m1

- name: environment setup
uses: conda-incubator/setup-miniconda@v3
if: matrix.os == 'macos-14'
with:
installer-url: https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Mambaforge-23.11.0-0-MacOSX-arm64.sh
activate-environment: geocat_viz_build
channel-priority: strict
python-version: ${{ matrix.python-version }}
channels: conda-forge
environment-file: build_envs/environment.yml

- name: Install geocat-viz
run: |
python -m pip install . --no-deps
Expand All @@ -57,6 +45,10 @@ jobs:
run: |
conda list
- name: tests
run: |
python -m pytest
link-check:
runs-on: ubuntu-latest
defaults:
Expand All @@ -65,22 +57,24 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: conda_setup

- name: environment setup
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: gv-docs
channel-priority: strict
python-version: 3.9
channels: conda-forge
environment-file: build_envs/docs.yml

- name: Install geocat-viz
run: |
python -m pip install .
- name: check conda list
run: |
conda list
- name: Make docs with linkcheck
run: |
cd docs
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/pre-commit.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
python -m twine check dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.11
uses: pypa/gh-action-pypi-publish@v1.10.3
with:
skip-existing: true
verbose: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ docs/_build/
dist/
.eggs/
*egg-info

# IDEs
settings.json
16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
repos:
- repo: https://github.com/pre-commit/mirrors-yapf # To format the code to conform YAPF
rev: v0.31.0
- repo: https://github.com/google/yapf # To format the code to conform YAPF
rev: v0.40.2
hooks:
- id: yapf
args: ['--in-place', '--recursive', '--style', 'google']
require_serial: true

- repo: https://github.com/myint/docformatter # To format the doc strings to conform PEP257
rev: v1.4
- repo: https://github.com/PyCQA/docformatter # To format the doc strings to conform PEP257
rev: v1.7.5
hooks:
- id: docformatter
args: [--in-place]

- repo: https://github.com/pre-commit/pre-commit-hooks # Some common pre-commit hooks
rev: v3.4.0
rev: v4.6.0
hooks:
- id: check-yaml # Checks the syntax of .yaml files.
args: [--allow-multiple-documents]
exclude: 'meta.yaml' # Exclude this because it gives an error for '%' in Line 1 and couldn't fix yet
- id: end-of-file-fixer # Makes sure files end with a newline.
- id: trailing-whitespace # Checks for any tabs or spaces after the last non-whitespace character on the line.
- id: check-docstring-first # Checks that code comes after the docstrings.
- id: check-yaml # Check valid yml file

ci:
autofix_prs: false
autoupdate_schedule: monthly
18 changes: 18 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include LICENSE
include README.md

recursive-include geocat *.py
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
exclude .gitignore
exclude .pre-commit-config.yaml
exclude .readthedocs.yml

include *.md
include *.toml
include *.yaml
include *.txt
prune test*
prune .github*
prune docs*
prune build_envs*
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

# GeoCAT-viz

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

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

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

[github-ci-badge]: https://img.shields.io/github/actions/workflow/status/NCAR/geocat-viz/ci.yml?branch=main&label=CI&style=for-the-badge
[github-ci-link]: https://github.com/NCAR/geocat-viz/actions/workflows/ci.yml
[rtd-badge]: https://img.shields.io/readthedocs/geocat-viz/latest.svg?style=for-the-badge
[rtd-link]: https://geocat-viz.readthedocs.io/en/latest/?badge=latest
[pypi-badge]: https://img.shields.io/pypi/v/geocat-viz?logo=pypix&style=for-the-badge
Expand Down
8 changes: 4 additions & 4 deletions build_envs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ dependencies:
- make
- matplotlib
- sphinx
- pip
- cmaps
- numpy
- xarray
- metpy
- pint
- pytest
- pytest-mpl
- geocat-datafiles
- pip:
- pre-commit
- scikit-learn
- pre-commit
- scikit-learn
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ def update_gallery(app: Sphinx):
# generate warning for all invalid links
#nitpicky = True

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


# Allow for changes to be made to the css in the theme_overrides file
def setup(app):
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/taylor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"\n",
"# Draw diagonal dashed lines from origin to correlation values\n",
"# Also enforces proper X-Y ratio\n",
"taylor.add_xgrid(np.array([0.6, 0.9]))\n",
"taylor.add_corr_grid(np.array([0.6, 0.9]))\n",
"\n",
"# Add models to Taylor diagram\n",
"taylor.add_model_set(a_sdev,\n",
Expand Down
38 changes: 36 additions & 2 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,39 @@
Release Notes
=============

v2024.03.0 (Unreleased)
-----------------------
v2024.xx.0 (unreleased)
---------------------------

Internal Changes
^^^^^^^^^^^^^^^^
* Update pre-commit versions and configuration by `Katelyn FitzGerald`_ in (:pr:`247`)
* Remove M1 workaround for CI and tokens that are no longer needed by `Katelyn FitzGerald`_ in (:pr:`232`)

Testing
^^^^^^^
* Add basic testing infrastructure by `Katelyn FitzGerald`_ and `Julia Kent`_ in (:pr:`233`)
* Add tests for `viz.taylor` by `Julia Kent`_ in (:pr:`234`)
* Add tests for `viz.util` by `Julia Kent`_ in (:pr:`239`)
* Remove now duplicative macOS runner from CI and add back in Python 3.10 by `Katelyn FitzGerald`_ in (:pr:`240`)


v2024.03.0 (March 26, 2024)
---------------------------
This release deprecates ``TaylorDiagram`` method names ``add_xgrid()`` and
``add_ygrid()`` in favor of the more descriptive ``add_corr_grid()`` and ``add_std_grid()``.

Documentation
^^^^^^^^^^^^^
* Document known issue with `suptitle` argument of ``set_titles_and_labels`` and Cartopy plots by `Julia Kent`_ in (:pr:`219`)

Deprecations
^^^^^^^^^^
* 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`)


v2024.02.1 (February 28, 2024)
------------------------------
This release changes to implicit namespace packaging and addresses a bug in the Taylor diagram functionality when disabling ``annotate_on``.

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

v2024.02.0 (February 6, 2024)
-----------------------------
Expand Down Expand Up @@ -122,3 +155,4 @@ Documentation
.. _`Katelyn Fitzgerald`: https://github.com/kafitzgerald
.. _`Simon Rosanka`: https://github.com/srosanka
.. _`Orhan Eroglu`: https://github.com/erogluorhan
.. _`Anissa Zacharias`: https://github.com/anissa111
12 changes: 8 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ include_package_data = True
python_requires = >=3.9, <3.13
package_dir =
=src
packages =
geocat
geocat.viz
packages = find_namespace:
setup_requires =
setuptools_scm
setuptools
Expand All @@ -45,6 +43,12 @@ install_requires =
setuptools
scikit-learn
metpy
tests_require =
pytest
pytest-mpl

[options.packages.find]
where = src

[options.extras_require]
docs =
Expand All @@ -63,7 +67,7 @@ docs =

[tool:pytest]
python_files = test_*.py
testpaths = test
testpaths = tests

[aliases]
test = pytest
1 change: 0 additions & 1 deletion src/geocat/__init__.py

This file was deleted.

Loading

0 comments on commit de5dd33

Please sign in to comment.