Skip to content
Open
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.

15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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: "daily"
labels:
- "Bot"
groups:
github-actions:
patterns:
- '*'
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Full Tests

on:
pull_request:
push:
branches: [main]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Setup Micromamba Python ${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@422500192359a097648154e8db4e39bdb6c6eed7 #v1
with:
environment-name: TEST
init-shell: bash
create-args: >-
python=${{ matrix.python-version }} pip python-build compilers --channel conda-forge

- name: Install wheel
run: >
python -m build --wheel . --outdir dist
&& pip install pytest dist/*.whl

- name: Tests
run: >
cp -R test/ dist/test/
&& pushd dist/
&& python -m pytest -rxs test
56 changes: 0 additions & 56 deletions .travis.yml

This file was deleted.

19 changes: 17 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
include LICENSE
include versioneer.py
include xcape/_version.py
include README.md
include pyproject.toml

graft xcape

prune .github
prune *.egg-info
prune doc
prune test

exclude .coveragerc
exclude ruff.toml
exclude .gitignore
exclude .isort.cfg
exclude .pre-commit-config.yaml
exclude *.yml
exclude xcape/_version.py
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# xcape

Fast convective parameters for numpy, dask, and xarray

[![pypi package](https://badge.fury.io/py/xcape.svg)](https://badge.fury.io/py/xcape)
[![conda
forge](https://anaconda.org/conda-forge/xcape/badges/version.svg)](https://anaconda.org/conda-forge/xcape)
[![Full Tests](https://github.com/xgcm/xcape/actions/workflows/tests.yml/badge.svg)](https://github.com/xgcm/xcape/actions/workflows/tests.yml)
[![code coverage](https://codecov.io/github/xgcm/xcape/coverage.svg?branch=master)](https://codecov.io/github/xgcm/xcape?branch=master)
[![documentation status](https://readthedocs.org/projects/xcape/badge/?version=latest)](http://xcape.readthedocs.org/en/stable/?badge=latest)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/xgcm/xcape)
[![DOI](https://zenodo.org/badge/202226985.svg)](https://zenodo.org/badge/latestdoi/202226985)

For more information, including installation instructions, read the full
[xcape documentation](https://xcape.readthedocs.io/en/latest/).

## Funding Support

Development of this package was supported by NSF award OCE-1740648
(original Pangeo EarthCube award).

## To Install Development Version

```shell
python setup.py build_ext pip install -e .
```
41 changes: 0 additions & 41 deletions README.rst

This file was deleted.

63 changes: 63 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
project(
'xcape',
['c', 'fortran'],
version: '1.0',
meson_version: '>= 1.1.0',
default_options: ['warning_level=1', 'buildtype=release']
)

py = import('python').find_installation(pure: false)
py_dep = py.dependency()

numpy_include_dir = run_command(py, ['-c', 'import numpy; print(numpy.get_include())'], check: true).stdout().strip()
f2py_include_dir = run_command(py, ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], check: true).stdout().strip()
inc_np = include_directories(numpy_include_dir, f2py_include_dir)

modules = [
'CAPE_CODE_model_lev',
'CAPE_CODE_pressure_lev',
'Bunkers_model_lev',
'Bunkers_pressure_lev',
'SREH_model_lev',
'SREH_pressure_lev',
'stdheight_2D_model_lev',
'stdheight_2D_pressure_lev',
]

foreach MOD : modules
_module = custom_target(f'@MOD@',
input: [
f'xcape/fortran/@MOD@.pyf',
f'xcape/fortran/@MOD@.f90'
],
output: [
f'@MOD@module.c',
f'@MOD@-f2pywrappers.f'
],
command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', f'@MOD@', '--lower'],
)

py.extension_module(f'@MOD@',
[
f'xcape/fortran/@MOD@.f90',
_module,
f2py_include_dir / 'fortranobject.c',
],
include_directories: inc_np,
dependencies: [py_dep],
install : true,
subdir: 'xcape/fortran',
)
endforeach

py.install_sources(
'xcape/__init__.py',
'xcape/cape_fortran.py',
'xcape/cape_numba.py',
'xcape/core.py',
'xcape/duck_array_ops.py',
'xcape/srh.py',
'xcape/stdheight.py',
'xcape/xarray.py',
subdir: 'xcape'
)
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[build-system]
build-backend = "mesonpy"
requires = [
"charset_normalizer",
"meson-python>=0.15",
"numpy>=2",
"setuptools_scm",
]

[project]
name = "xcape"
description = "Fast convective parameters for numpy, dask, and xarray"
readme = "README.md"
license = {file = "LICENSE"}
authors = [
{name = "xcape Developers", email = "rpa@ldeo.columbia.edu"},
]
requires-python = ">=3.9"
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering',
]
dynamic = [
"version",
]
dependencies = [
"dask",
"numpy>=1.16",
"xarray>=0.14.1",
]

[project.urls]
documentation = "https://xcape.readthedocs.io/en/latest/"
homepage = "https://github.com/xgcm/xcape"
repository = "https://github.com/xgcm/xcape"

[tool.setuptools_scm]
write_to = "xcape/_version.py"
write_to_template = "__version__ = '{version}'"
tag_regex = "^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$"

[tool.check-manifest]
ignore = [
"*.yml",
".coveragerc",
"doc",
"doc/*",
"test",
"test/*",
]
10 changes: 0 additions & 10 deletions setup.cfg

This file was deleted.

Loading