Repository: blaylockbk/goes2go (language: python)

Issue:
Test for getting GOES-18 data
Should just need to set `satellite=18` to explicitly get GOES-18. But when user requests `satellite="west"` it should automatically detect which is the operational satellite (17 or 18).


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/release_to_pypi.yml b/.github/workflows/release_to_pypi.yml
new file mode 100644
index 0000000..72dbe7d
--- /dev/null
+++ b/.github/workflows/release_to_pypi.yml
@@ -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.
diff --git a/README.md b/README.md
index 7f2ac1f..cf21e53 100644
--- a/README.md
+++ b/README.md
@@ -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)
@@ -24,9 +25,9 @@
 
 </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>
 
@@ -34,7 +35,7 @@ GOES-East and GOES-West satellite data are made available on Amazon Web Services
 
 <br>
 
----
+<hr>
 
 # Installation
 
@@ -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)
 
@@ -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
@@ -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
@@ -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_**
 
@@ -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!
 
@@ -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)
diff --git a/environment.yml b/environment.yml
index 1128d1a..d44c536 100644
--- a/environment.yml
+++ b/environment.yml
@@ -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/
diff --git a/pyproject.toml b/pyproject.toml
index 8ca4445..3fc02e8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,81 @@
+[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 = "blaylockbk@gmail.com" }]
+maintainers = [{ name = "Brian K. Blaylock", email = "blaylockbk@gmail.com" }]
+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"
@@ -9,3 +83,11 @@ 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 = []
diff --git a/requirements.txt b/requirements.txt
index b1cb466..b98cc58 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -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
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index c4be3ed..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,69 +0,0 @@
-[metadata]
-name = goes2go
-description = Retrieve GOES-16/17 data from AWS. Also proves some RGB recipes.
-author = Brian K. Blaylock
-author_email = blaylockbk@gmail.com
-long_description = file: README.md
-long_description_content_type = text/markdown
-license = MIT
-license_file = LICENSE
-platform = any
-url = https://github.com/blaylockbk/goes2go
-project_urls =
-    Source Code = https://github.com/blaylockbk/goes2go
-    Documentation = https://goes2go.readthedocs.io/
-    Release Notes = https://github.com/blaylockbk/goes2go/releases
-    Bug Tracker = https://github.com/blaylockbk/goes2go/issues
-keywords =
-    meteorology
-    weather
-    satellite
-    GOES
-    atmosphere
-    xarray
-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 :: OS Independent
-    License :: OSI Approved :: MIT License
-    Intended Audience :: Science/Research
-    Topic :: Scientific/Engineering :: Atmospheric Science
-
-[options]
-packages = find:
-include_package_data = True
-setup_requires = setuptools_scm
-python_requires = >=3.8
-zip_safe = False
-install_requires =
-    numpy
-    pandas
-    xarray
-    metpy
-    cartopy
-    toml
-    s3fs
-
-[options.extras_require]
-docs =
-    autodocsumm
-    linkify-it-py
-    myst-parser
-    nbconvert
-    nbsphinx
-    pydata-sphinx-theme
-    recommonmark
-    sphinx
-    sphinx-autosummary-accessors
-    sphinx-design
-    sphinx-markdown-tables
-    sphinxcontrib-mermaid
-
-#tests =
-#    pytest
-#    black
-#    isort
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 7f1a176..0000000
--- a/setup.py
+++ /dev/null
@@ -1,4 +0,0 @@
-from setuptools import setup
-
-if __name__ == "__main__":
-    setup()


Test patch:
diff --git a/.github/workflows/tests-python.yml b/.github/workflows/tests-python.yml
new file mode 100644
index 0000000..8efb19e
--- /dev/null
+++ b/.github/workflows/tests-python.yml
@@ -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
diff --git a/requirements-test.txt b/requirements-test.txt
new file mode 100644
index 0000000..e70c0b4
--- /dev/null
+++ b/requirements-test.txt
@@ -0,0 +1,1 @@
+pytest<8
diff --git a/tests/test_GOES.py b/tests/test_GOES.py
index 6b63eba..486e95c 100644
--- a/tests/test_GOES.py
+++ b/tests/test_GOES.py
@@ -1,28 +1,45 @@
 from goes2go import GOES
 
 
-def test_GOES():
+########################################################################
+
+
+def test_GOES16():
     """Create a GOES object"""
     G = GOES(satellite="noaa-goes16", domain="C")
     assert G.satellite == "noaa-goes16"
     assert G.domain == "C"
 
 
-def test_GOES_latest():
-    G = GOES()
-    ds = G.latest()
+def test_GOES16_latest():
+    ds = GOES(satellite=16).latest()
+
+
+def test_GOES16_nearesttime():
+    ds = GOES(satellite=16).nearesttime("2022-01-01")
+
+
+def test_GOES16_timerange():
+    ds = GOES(satellite=16).timerange("2022-01-01 00:00", "2022-01-01 01:00")
 
 
-def test_GOES_nearesttime():
-    G = GOES()
-    ds = G.nearesttime("2022-01-01")
+def test_GOES16_df():
+    df = GOES(satellite=16).df("2022-01-01 00:00", "2022-01-01 01:00")
+
+
+########################################################################
+
+
+def test_GOES18():
+    """Create a GOES object"""
+    G = GOES(satellite="noaa-goes18", domain="C")
+    assert G.satellite == "noaa-goes18"
+    assert G.domain == "C"
 
 
-def test_GOES_timerange():
-    G = GOES()
-    ds = G.timerange("2022-01-01 00:00", "2022-01-01 01:00")
+def test_GOES18_latest():
+    ds = GOES(satellite=18).latest()
 
 
-def test_GOES_df():
-    G = GOES()
-    df = G.df("2022-01-01 00:00", "2022-01-01 01:00")
+def test_GOES18_nearesttime():
+    ds = GOES(satellite=18).nearesttime("2023-07-01")