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
6 changes: 3 additions & 3 deletions .github/workflows/black.yml → .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Black
name: Format

on: [push, pull_request]

Expand All @@ -14,8 +14,8 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: psf/black@stable
with:
args: ". --check"
13 changes: 5 additions & 8 deletions .github/workflows/flake8.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Flake8
name: Lint

on: [push, pull_request]

Expand All @@ -14,13 +14,10 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/checkout@v4
- uses: actions/setup-python@v4

- name: Lint
run: |
pip install flake8
make lint
pip install ruff
ruff check .
24 changes: 9 additions & 15 deletions .github/workflows/build-test-ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build/Test CI
name: Test

on: [push, pull_request]

Expand All @@ -20,17 +20,16 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: true

- name: Show conda installation info
run: |
Expand All @@ -39,21 +38,16 @@ jobs:

- name: Install requirements
run: |
conda install mamba
mamba install --file=requirements.txt
mamba list
mamba install --file=requirements.txt --file=requirements-testing.txt

- name: Build and install package
run: pip install -e .

- name: Install testing dependencies
run: mamba install --file=requirements-testing.txt

- name: Test
run: |
pytest --cov=heat --cov-report=xml:./coverage.xml -vvv
bmi-test heat:BmiHeat --config-file=./examples/heat.yaml --root-dir=./examples -vvv

- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
uses: AndreMiras/coveralls-python-action@v20201129
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: AndreMiras/coveralls-python-action@develop
7 changes: 6 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ Changelog for bmi-example-python
2.1.2 (unreleased)
------------------

- Nothing changed yet.
- Build and test with Python 3.12 (#29)
- Use random subpackage from numpy instead of scipy (#26)
- Add example notebooks (#25)
- Move static project metadata to pyproject.toml (#23)
- Bundle maintenance tasks (#22)
- Use declarative setuptools configuration setup.cfg (#21)


2.1.1 (2021-08-26)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ clean-test: ## remove test and coverage artifacts
rm -fr htmlcov/
rm -fr .pytest_cache

lint: ## check style with flake8
flake8 heat tests
lint: ## check style with ruff
ruff check . --fix

pretty:
find heat -name '*.py' | xargs isort
Expand Down
9 changes: 6 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
:target: https://bmi.readthedocs.io/
:alt: Basic Model Interface

.. image:: https://github.com/csdms/bmi-example-python/workflows/Build/Test%20CI/badge.svg
:target: https://github.com/csdms/bmi-example-python/actions?query=workflow%3A%22Build%2FTest+CI%22
.. image:: https://github.com/csdms/bmi-example-python/actions/workflows/test.yml/badge.svg
:target: https://github.com/csdms/bmi-example-python/actions/workflows/test.yml
:alt: CI status

.. image:: https://coveralls.io/repos/csdms/bmi-example-python/badge.png?branch=master
:target: https://coveralls.io/r/csdms/bmi-example-python?branch=master
:alt: Coverage status

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/csdms/bmi
:alt: Black

bmi-example-python
==================
Expand Down Expand Up @@ -66,5 +69,5 @@ To run the tests,


.. _Python bindings: https://github.com/csdms/bmi-python
.. _Basic Model Interface: https://bmi-spec.readthedocs.io
.. _Basic Model Interface: https://bmi.readthedocs.io
.. _README: https://github.com/csdms/bmi-python/blob/master/README.rst
43 changes: 29 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ name = "bmi-heat"
description = "BMI Python example"
authors = [
{email = "eric.hutton@colorado.edu"},
{name = "The CSDMS team"}
{name = "Eric Hutton"}
]
maintainers = [
{email = "eric.hutton@colorado.edu"},
{name = "The CSDMS team"}
{name = "Mark Piper", email = "mark.piper@colorado.edu"},
{name = "Eric Hutton", email = "eric.hutton@colorado.edu"},
]
keywords = [
"bmi",
"component modeling",
"csdms",
"earth science",
]
license = {file = "LICENSE"}
Expand All @@ -25,14 +26,14 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Physics",
]
requires-python = ">=3.7"
requires-python = ">=3.9"
dependencies = [
"numpy",
"scipy",
Expand All @@ -41,20 +42,20 @@ dependencies = [
]
dynamic = ["readme", "version"]


[project.urls]
homepage = "https://github.com/csdms/bmi-example-python"
documentation = "https://github.com/csdms/bmi-example-python#readme"
repository = "https://github.com/csdms/bmi-example-python"
changelog = "https://github.com/csdms/bmi-example-python/blob/master/CHANGES.rst"
Homepage = "https://csdms.colorado.edu"
Documentation = "https://bmi.readthedocs.io"
Repository = "https://github.com/csdms/bmi-example-python"
Changelog = "https://github.com/csdms/bmi-example-python/blob/master/CHANGES.rst"

[project.optional-dependencies]
testing = [
"coveralls",
"flake8",
"pytest",
"pytest-cov",
"six",
"black",
"isort",
"ruff",
"bmi-tester",
]

Expand All @@ -72,7 +73,7 @@ norecursedirs = [".*", "*.egg*", "build", "dist"]
addopts = """
--ignore setup.py
--tb native
--strict
--strict-markers
--durations 16
--doctest-modules
-vvv
Expand All @@ -89,3 +90,17 @@ include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
line_length = 88

[tool.ruff]
line-length = 88
ignore = [
"E203",
"E501",
]

[tool.coverage.run]
relative_files = true

[tool.zest-releaser]
tag-format = "v{version}"
python-file-with-version = "heat/_version.py"
5 changes: 3 additions & 2 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
coveralls
flake8
pytest
pytest-cov
six
black
isort
ruff
bmi-tester
16 changes: 0 additions & 16 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/test_irf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import numpy as np
import yaml
from numpy.testing import assert_almost_equal, assert_array_equal, assert_array_less
from six.moves import range

from heat import BmiHeat

Expand Down