Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "bot"
50 changes: 50 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

name: Documentation

on:
pull_request:
push:
branches:
- main
release:
types:
- published

jobs:
build-docs:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: TEST
init-shell: bash
create-args: >-
python=3 pip pyspharm iris xarray sphinx sphinx-issues --channel conda-forge

- name: Install windspharm
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps --force-reinstall

- name: Build documentation
shell: bash -l {0}
run: |
set -e
micromamba activate TEST
pushd docs
make clean html linkcheck
popd

- name: Deploy
if: success() && github.event_name == 'release'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
65 changes: 65 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish to PyPI

on:
pull_request:
push:
branches:
- main
release:
types:
- published

defaults:
run:
shell: bash

jobs:
build_wheels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Setup Micromamba Python
uses: mamba-org/setup-micromamba@v2
with:
environment-name: PYPI
init-shell: bash
create-args: >-
python
pip
pytest
numpy
pyspharm
--channel conda-forge

- name: Install build tools
shell: bash -l {0}
run: |
python -m pip install --upgrade build check-manifest twine

- name: Build binary wheel
shell: bash -l {0}
run: |
python -m build --sdist --wheel . --outdir dist

- name: Check manifest
shell: bash -l {0}
run: |
ls dist
check-manifest --verbose

- name: Test wheels
shell: bash -l {0}
run: |
cd dist && python -m pip install *.whl
python -m twine check *

- name: Publish a Python distribution to PyPI
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
37 changes: 37 additions & 0 deletions .github/workflows/tests-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Standard Tests

on:
pull_request:
push:
branches: [main]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Setup Micromamba Python ${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v2
with:
environment-name: TEST
init-shell: bash
create-args: >-
python=${{ matrix.python-version }} pip pytest numpy pyspharm --channel conda-forge


- name: Install windspharm
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps --force-reinstall

- name: Tests
shell: bash -l {0}
run: |
python -m pytest -vrsx windspharm/tests
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Full Tests

on:
pull_request:
push:
branches: [main]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Setup Micromamba Python ${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v2
with:
environment-name: TEST
init-shell: bash
create-args: >-
python=${{ matrix.python-version }} pip pytest numpy pyspharm iris xarray --channel conda-forge

- name: Install windspharm
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps --force-reinstall

- name: Tests
shell: bash -l {0}
run: |
python -m pytest -vrsx windspharm/tests
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Created by https://www.gitignore.io/api/vim,code,emacs,python

windspharm/_version.py

### Code ###
# Visual Studio Code - https://code.visualstudio.com/
.settings/
Expand Down Expand Up @@ -193,4 +195,4 @@ tags
[._]*.un~


# End of https://www.gitignore.io/api/vim,code,emacs,python
# End of https://www.gitignore.io/api/vim,code,emacs,python
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.0
hooks:
- id: pyproject-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
hooks:
- id: ruff
2 changes: 0 additions & 2 deletions .stickler.yml

This file was deleted.

85 changes: 0 additions & 85 deletions .travis.yml

This file was deleted.

15 changes: 13 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
includ pyproject.toml
include README.md
include license.txt
include versioneer.py
include lib/windspharm/_version.py

graft windspharm

recursive-include examples *.py
recursive-include windspharm *.nc

prune .github
prune *.egg-info
prune docs

exclude *.yaml
exclude windspharm/_version.py
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
windspharm - spherical harmonic vector wind analysis in Python
==============================================================

[![Build Status](https://api.travis-ci.org/repositories/ajdawson/windspharm.svg?branch=master)](https://travis-ci.org/ajdawson/windspharm) [![DOI (paper)](https://img.shields.io/badge/DOI%20%28paper%29-10.5334%2Fjors.129-blue.svg)](http://doi.org/10.5334/jors.129) [![DOI (latest release)](https://zenodo.org/badge/20448/ajdawson/windspharm.svg)](https://zenodo.org/badge/latestdoi/20448/ajdawson/windspharm)
[![DOI (paper)](https://img.shields.io/badge/DOI%20%28paper%29-10.5334%2Fjors.129-blue.svg)](http://doi.org/10.5334/jors.129) [![DOI (latest release)](https://zenodo.org/badge/4715033.svg)](https://zenodo.org/records/1401190)

Overview
--------
Expand All @@ -17,9 +17,7 @@ windspharm provides a replacement for the windfield package from CDAT.
Requirements
------------

`windspharm` only requires [`numpy`](http://numpy.org) and [`pyspharm`](https://github.com/jswhit/pyspharm) (version 1.0.8 or higher), but for full functionality (meta-data interfaces) one or more of [`iris`](http://scitools.org.uk/iris/), [`xarray`](http://xarray.pydata.org) or the `cdms2` module (from [UV-CDAT](http://uvcdat.llnl.gov) is required.
The setuptools package is required for installation.
windspharm runs on Python 2 and 3.
`windspharm` only requires [`numpy`](http://numpy.org) and [`pyspharm`](https://github.com/jswhit/pyspharm) (version 1.0.9 or higher), but for full functionality (meta-data interfaces) one or both of [`iris`](http://scitools.org.uk/iris/) and/or [`xarray`](http://xarray.pydata.org) are required.


Documentation
Expand All @@ -39,8 +37,8 @@ You can additionally cite the [Zenodo DOI](https://zenodo.org/badge/latestdoi/20
Frequently asked questions
--------------------------

* **Do I need UV-CDAT/iris/xarray to use windspharm?**
No. All the computation code uses numpy only. The iris, xarray and cdms2 modules are only required for the meta-data preserving interfaces.
* **Do I need iris/xarray to use windspharm?**
No. All the computation code uses numpy only. The iris and/or xarray modules are only required for the meta-data preserving interfaces.
* **Is windspharm a drop in replacement for windfield?**
No. Because windspharm was written from scratch the naming conventions for methods
are different. Some new methods have been added compared to windfield, and some
Expand All @@ -54,7 +52,9 @@ The easiest way to install is via [conda](http://conda.pydata.org):

conda install -c conda-forge windspharm

You can also install from the source distribution.
Download the archive, unpack it, then enter the source directory and use:
You can also install with pip::

python setup.py install
python -m pip install windspharm

> [!CAUTION]
> Make sure you already have pyspharm dependency installed, as it may fail to install if pip tries to do it.
1 change: 0 additions & 1 deletion docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Full documentation
:maxdepth: 1

windspharm.standard
windspharm.cdms
windspharm.iris
windspharm.xarray
windspharm.tools
Loading