Skip to content

Commit

Permalink
Merge pull request #74 from blaylockbk/72-review-required-package-ver…
Browse files Browse the repository at this point in the history
…sions-in-build-process

Modernize install using only pyproject.toml and add some GitHub Actions
  • Loading branch information
blaylockbk authored Aug 23, 2023
2 parents a71d50f + 4b92bec commit 252df85
Show file tree
Hide file tree
Showing 10 changed files with 233 additions and 101 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to PyPI

on:
push:
tags:
- "20*"

jobs:
pypi-release:
name: Publish release on PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"

- name: Build source and wheel distributions
run: |
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# Remember to manually create release on GitHub using the same tag.
66 changes: 66 additions & 0 deletions .github/workflows/tests-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Tests (Python)

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allow job to be triggered manually.
workflow_dispatch:

# Cancel in-progress jobs when pushing to the same branch.
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11"]
# In order to save resources, only run particular
# matrix slots on other OS than Linux.
include:
- os: "macos-latest"
python-version: "3.11"
- os: "windows-latest"
python-version: "3.11"

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

defaults:
run:
shell: bash -el {0}

name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }}
steps:

- name: Acquire sources
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: 'setup.cfg'

- name: Install project
run: |
pip3 install --requirement=requirements-test.txt
pip3 install --editable=.
- name: Run tests
env:
TMPDIR: ${{ runner.temp }}
run: |
pytest
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

![](https://img.shields.io/github/license/blaylockbk/goes2go)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Tests (Python)](https://github.com/blaylockbk/goes2g0/actions/workflows/tests-python.yml/badge.svg)](https://github.com/blaylockbk/goes2g0/actions/workflows/tests-python.yml)
[![Documentation Status](https://readthedocs.org/projects/goes2go/badge/?version=latest)](https://goes2go.readthedocs.io/?badge=latest)
[![Python](https://img.shields.io/pypi/pyversions/goes2go.svg)](https://pypi.org/project/goes2go/)
[![Conda Recipe](https://img.shields.io/badge/recipe-goes2go-green.svg)](https://anaconda.org/conda-forge/goes2go)
Expand All @@ -24,17 +25,17 @@

</div>

GOES-East and GOES-West satellite data are made available on Amazon Web Services through [NOAA's Big Data Program](https://www.noaa.gov/information-technology/big-data). **GOES-2-go** is a python package that makes it easy to find and download the files you want to your local computer with some additional helpers to look at and understand the data.
GOES-East and GOES-West satellite data are made available on Amazon Web Services through [NOAA's Open Data Dissemination Program](https://www.noaa.gov/information-technology/open-data-dissemination). **GOES-2-go** is a python package that makes it easy to find and download the files you want from [AWS](https://registry.opendata.aws/noaa-goes/) to your local computer with some additional helpers to visualize and understand the data.

---
<hr>

<br>

# 📔 [GOES-2-go Documentation](https://goes2go.readthedocs.io/)

<br>

---
<hr>

# Installation

Expand Down Expand Up @@ -62,7 +63,7 @@ conda activate goes2go
Alternatively, `goes2go` is published on PyPI and you can install it with pip, _but_ it requires some additional dependencies that you will have to install yourself:

- Python 3.8+
- [Cartopy](https://scitools.org.uk/cartopy/docs/latest/installing.html), which requires GEOS and Proj.
- [Cartopy](https://scitools.org.uk/cartopy/docs/latest/installing.html), which requires GEOS and Proj (if using `cartopy<0.22.0`).
- MetPy
- _Optional:_ [Carpenter Workshop](https://github.com/blaylockbk/Carpenter_Workshop)

Expand Down Expand Up @@ -154,7 +155,7 @@ There are methods to do the following:

## RGB Recipes

The `rgb` xarray accessor creates an RGB product for a GOES ABI multichannel xarray.Dataset. See the [demo](https://goes2go.readthedocs.io/en/latest/user_guide/notebooks/DEMO_rgb_recipes.html#) for more examples of RGB products.
The `rgb` xarray accessor computes various RGB products from a GOES ABI ***ABI-L2-MCMIP*** (multi-channel cloud and moisture imagry products) `xarray.Dataset`. See the [demo](https://goes2go.readthedocs.io/en/latest/user_guide/notebooks/DEMO_rgb_recipes.html#) for more examples of RGB products.

```python
import matplotlib.pyplot as plt
Expand All @@ -168,7 +169,7 @@ ax.coastlines()

## Field of View

The `FOV` xarray accessor creates shapely.Polygon objects for the ABI and GLM field of view. See notebooks for [GLM](https://goes2go.readthedocs.io/en/latest/user_guide/notebooks/field-of-view_GLM.html) and [ABI](https://goes2go.readthedocs.io/en/latest/user_guide/notebooks/field-of-view_ABI.html) field of view.
The `FOV` xarray accessor creates `shapely.Polygon` objects for the ABI and GLM field of view. See notebooks for [GLM](https://goes2go.readthedocs.io/en/latest/user_guide/notebooks/field-of-view_GLM.html) and [ABI](https://goes2go.readthedocs.io/en/latest/user_guide/notebooks/field-of-view_ABI.html) field of view.

```python
from goes2go.data import goes_latest
Expand All @@ -192,7 +193,7 @@ If GOES-2-go played an important role in your work, please [tell me about it](ht

**_Suggested Citation_**

> Blaylock, B. K. (2022). GOES-2-go: Download and display GOES-East and GOES-West data (Version 2022.07.15) [Computer software]. https://github.com/blaylockbk/goes2go
> Blaylock, B. K. (2023). GOES-2-go: Download and display GOES-East and GOES-West data (Version 2022.07.15) [Computer software]. https://github.com/blaylockbk/goes2go
**_Suggested Acknowledgment_**

Expand All @@ -202,7 +203,7 @@ If GOES-2-go played an important role in your work, please [tell me about it](ht

As an alternative you can use [rclone](https://rclone.org/) to download GOES files from AWS. I quite like rclone. Here is a [short rclone tutorial](https://github.com/blaylockbk/pyBKB_v3/blob/master/rclone_howto.md).

---
<hr>

I hope you find this makes GOES data easier to retrieve and display. Enjoy!

Expand All @@ -213,9 +214,12 @@ I hope you find this makes GOES data easier to retrieve and display. Enjoy!
🚑 [GitHub Issues](https://github.com/blaylockbk/goes2go/issues)
🌐 [Personal Webpage](http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/home.html)

P.S. If you like GOES-2-go, check out my [Herbie](https://github.com/blaylockbk/Herbie) package to download weather model data and [SynopticPy](https://github.com/blaylockbk/Herbie) to download mesonet data from the Synoptic API.
P.S. If you like GOES-2-go, check out my other python packages
- [🏁 Herbie](https://github.com/blaylockbk/Herbie): download numerical weather model data
- [🌡️ SynopticPy](https://github.com/blaylockbk/SynopticPy): retrieve mesonet data from the Synoptic API.
- [🌹 Pandas-rose](https://github.com/blaylockbk/pandas-rose): easly wind rose from Pandas dataframe.

# Useful Links
# Related Content

- [🙋🏻‍♂️ Brian's AWS GOES Web Downloader](https://home.chpc.utah.edu/~u0553130/Brian_Blaylock/cgi-bin/goes16_download.cgi)
- [📔 GOES-R Series Data Book](https://www.goes-r.gov/downloads/resources/documents/GOES-RSeriesDataBook.pdf)
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: goes2go
channels:
- conda-forge
dependencies:
- python>=3.10
- python>=3.11
- pip
- git
- rclone >= 1.58.0 # Not required by goes2go, but is an awesome alternative https://rclone.org/
Expand Down
82 changes: 82 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,93 @@
[project]
name = "goes2go"
description = "Retrieve GOES-16/17 data from AWS. Also proves some RGB recipes."
readme = "README.md"
requires-python = ">=3.8"
license = { file = "LICENSE" }
authors = [{ name = "Brian K. Blaylock", email = "[email protected]" }]
maintainers = [{ name = "Brian K. Blaylock", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Atmospheric Science",

]
keywords = [
"weather",
"meteorology",
"satellite",
"atmosphere",
"GOES",
"xarray",
"AWS",
"NOAA",
]
dependencies = [
"cartopy>=0.22.0",
"h5netcdf",
"matplotlib",
"metpy",
"numpy",
"pandas",
"s3fs>=2023.6.0",
"toml",
"xarray",
]
dynamic = ["version"]

[project.urls]
"Homepage" = "https://github.com/blaylockbk/goes2go"
"Documentation" = "https://goes2go.readthedocs.io/"
"Repository" = "https://github.com/blaylockbk/goes2go"
"Changelog" = "https://github.com/blaylockbk/goes2go/releases"
"Bug Tracker" = "https://github.com/blaylockbk/goes2go/issues"

[project.optional-dependencies]
docs = [
"autodocsumm",
"linkify-it-py",
"myst-parser",
"nbconvert",
"nbsphinx",
"pydata-sphinx-theme",
"recommonmark",
"sphinx",
"sphinx-autosummary-accessors",
"sphinx-design",
"sphinx-markdown-tables",
"sphinxcontrib-mermaid",
]

test = ["pytest", "black", "isort"]

[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["goes2go"]

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "no-local-version"
write_to = "goes2go/_version.py"

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
minversion = "2.0"
addopts = "-rsfEX -p pytester --strict-markers --verbosity=3"
log_level = "DEBUG"
testpaths = ["tests"]
xfail_strict = true
markers = []
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest<8
10 changes: 6 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
cartopy>=0.22.0
h5netcdf
matplotlib
metpy
numpy
pandas
xarray
metpy
s3fs>=2023.6.0
toml
cartopy
matplotlib
xarray
git+https://github.com/blaylockbk/Carpenter_Workshop.git
69 changes: 0 additions & 69 deletions setup.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

Loading

0 comments on commit 252df85

Please sign in to comment.