forked from nhm-usgs/gridmet_bmi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update project metadata and continuous integration (#2)
* Remove deprecated versioneer package * Move metadata from setup.py to pyproject.toml * Add version file * Rename license file * Move README from rst to md * Add credits doc and changelog * Include version in package * Include netcdf4 dependency * Replace deprecated np.int and np.float types * Use float64 instead of float32 values * Use conda environment file over pip requirements files * Update Makefile and manifest * Also test the component's BMI * Remove deprecated numpy types * Set up CI with GitHub Actions * Make pretty * Use conda convention of .yml * Include coverage dependency
- Loading branch information
Showing
26 changed files
with
325 additions
and
2,583 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Lint | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Check for lint and format code to a standard style | ||
if: | ||
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniforge-version: latest | ||
python-version: 3.12 | ||
auto-activate-base: false | ||
|
||
- name: Install black and flake8 | ||
run: pip install black flake8 | ||
|
||
- name: Format code | ||
run: | | ||
flake8 . | ||
black . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-test: | ||
if: | ||
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniforge-version: latest | ||
activate-environment: gridmet_bmi | ||
environment-file: environment.yml | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Show conda installation info | ||
run: | | ||
conda info | ||
conda list | ||
- name: Build and install package | ||
run: | | ||
make install | ||
- name: Run unit tests | ||
run: | | ||
pytest | ||
- name: Test BMI | ||
if: ${{ matrix.python-version == '3.12' }} | ||
run: | | ||
make test-bmi | ||
- name: Run examples | ||
working-directory: ${{ github.workspace }}/examples | ||
run: | | ||
python debug.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changes for gridmet_bmi | ||
|
||
## 0.2.0 (unreleased) | ||
|
||
- Nothing yet. | ||
|
||
|
||
## 0.1 (2021-01-15) | ||
|
||
- Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Credits | ||
|
||
## Project lead | ||
|
||
* Rich McDonald | ||
|
||
## Contributors | ||
|
||
* Eric Hutton | ||
* Mark Piper | ||
|
||
## Acknowledgments | ||
|
||
This work was supported by the National Science Foundation under Award No. | ||
[2026951](https://www.nsf.gov/awardsearch/showAward?AWD_ID=2026951), | ||
*EarthCube Capabilities: Cloud-Based Accessible and Reproducible Modeling for Water and Sediment Research*. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
include versioneer.py | ||
include gridmet_bmi/_version.py | ||
|
||
include *.md | ||
include environment.yml | ||
include examples/* | ||
recursive-include tests * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Gridmet_BMI | ||
|
||
Python and command-line interface to the GridMet climate data services. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import matplotlib.pyplot as plt | ||
from gridmet_bmi import BmiGridmet, Gridmet | ||
import numpy as np | ||
from gridmet_bmi import Gridmet | ||
|
||
gridmet = Gridmet(start_date='2019-03-15', end_date='2019-03-21', lazy=True) | ||
|
||
gridmet = Gridmet(start_date="2019-03-15", end_date="2019-03-21", lazy=True) | ||
# assert len(getattr(gridmet, 'tmax')) == 1 | ||
print(len(gridmet.tmax), type(gridmet.tmax)) | ||
tmp = 0 | ||
tmp = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
from ._version import get_versions | ||
from .bmi_gridmet import BmiGridmet | ||
|
||
# from examples.bmi import BmiGridmet | ||
from .gridmet import Gridmet | ||
from .helpers import getaverage, np_get_wval | ||
from ._version import __version__ | ||
|
||
__all__ = ["BmiGridmet", "Gridmet", "np_get_wval", "getaverage"] | ||
|
||
__version__ = get_versions()["version"] | ||
del get_versions | ||
__all__ = ["BmiGridmet", "Gridmet", "np_get_wval", "getaverage", "__version__"] |
Oops, something went wrong.