Skip to content

Commit

Permalink
Drop 3.8 support, fix admap1 url (#140)
Browse files Browse the repository at this point in the history
* adding back fetch tests

* drop python 3.8 support

* use major versions in test.yml

* new admap1 url

* add previously excluded tests

* catch attribute error in get_grd_info()
  • Loading branch information
mdtanker committed Mar 21, 2023
1 parent d8c821e commit 30ea5aa
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 31 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- latest
include:
- dependencies: oldest
python: "3.8"
python: "3.9"
- dependencies: latest
python: "3.10"
env:
Expand All @@ -53,7 +53,7 @@ jobs:
steps:
# Checkout current git repository
- name: Checkout
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -62,7 +62,7 @@ jobs:

# Install Mambaforge with conda-forge dependencies
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2.1.1
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: antarctic_plots
environment-file: env/env_test.yml
Expand All @@ -77,15 +77,13 @@ jobs:

# Show installed pkg information for postmortem diagnostic
- name: List installed packages
# shell: bash -el {0}
run: mamba list

- name: Run the tests
continue-on-error: true
# shell: bash -el {0}
run: |
mkdir -p .cov
pytest --cov . --cov-config=pyproject.toml --cov-report xml:.cov/coverage.xml -m "not earthdata and not issue and not fetch"
pytest --cov . --cov-config=pyproject.toml --cov-report xml:.cov/coverage.xml -m ""
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion antarctic_plots/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,7 @@ def preprocessing(fname, action, pooch2):
return str(fname_processed)

path = pooch.retrieve(
url="https://admap.kongju.ac.kr/admapdata/ant_new.zip",
url="http://admap.kopri.re.kr/admapdata/ant_new.zip",
fname="admap1.zip",
path=f"{pooch.os_cache('pooch')}/antarctic_plots/magnetics",
known_hash=None,
Expand Down
1 change: 0 additions & 1 deletion antarctic_plots/tests/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,6 @@ def test_ghf_points():
]

@pytest.mark.fetch
@pytest.mark.issue
@pytest.mark.parametrize("test_input,expected", test)
def test_gia(test_input, expected):
grid = fetch.gia(test_input)
Expand Down
10 changes: 7 additions & 3 deletions antarctic_plots/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ def get_grid_info(grid):
except AttributeError:
print(
"grid registration not extracted, re-trying with file loaded as xarray grid"
) # noqa
)
grid = xr.load_dataarray(grid)
reg = grid.gmt.registration
registration = "g" if reg == 0 else "p"
try:
reg = grid.gmt.registration
registration = "g" if reg == 0 else "p"
except AttributeError:
print("grid registration can't be extracted, setting to 'g'.")
registration = "g"
except Exception:
print("grid registration can't be extracted")
registration = None
Expand Down
20 changes: 11 additions & 9 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

### 💫 Highlights
* Dropped support for Python 3.8 in PR #140

### 🚀 Features

Expand All @@ -13,6 +14,7 @@
### 📖 Documentation

### ⛔ Maintenance
* new URL for fetching ADMAP1 magnetic data

### 🧑‍🤝‍🧑 Contributors

Expand All @@ -34,7 +36,7 @@

---

## Release v0.0.4
## Release v0.0.4

### 💫 Highlights
* New mapping function `antarctic_plots.maps`
Expand Down Expand Up @@ -88,14 +90,14 @@

---

## Release v0.0.3
## Release v0.0.3

### 💫 Highlights
* Finally succeeded in building the docs!

### 📖 Documentation

* Added `make build-docs` to execute and overwrite .ipynb to use in docs, since `PyGMT` can't be included in dependencies and therefore RTD's can't execute the .ipynb's.
* Added `make build-docs` to execute and overwrite .ipynb to use in docs, since `PyGMT` can't be included in dependencies and therefore RTD's can't execute the .ipynb's.

### ⛔ Maintenance

Expand All @@ -107,14 +109,14 @@

---

## Release v0.0.2
## Release v0.0.2

### 💫 Highlights
* Created a [website for the documentation!](https://antarctic-plots.readthedocs.io/en/latest/installation.html#)
* Created a [website for the documentation!](https://antarctic-plots.readthedocs.io/en/latest/installation.html#)

* Added `NumPy` formatted docstrings to the modules

* Wrote contribution guide, which outlines the unique case of publishing a package with dependencies which need C packages, like `PyGMT` (`GMT`) and `GeoPandas` (`GDAL`).
* Wrote contribution guide, which outlines the unique case of publishing a package with dependencies which need C packages, like `PyGMT` (`GMT`) and `GeoPandas` (`GDAL`).

* Added `Tips` for generating shapefiles and picking start/end points

Expand All @@ -136,7 +138,7 @@

---

## Release v0.0.1
## Release v0.0.1

### 💫 Highlights
* also probably should have been published to TestPyPI 🤦♂️
Expand All @@ -156,7 +158,7 @@
### ⛔ Maintenance

* Looks of issues with the Poetry -> Jupyter-Books -> Read the Docs workflow
* Poetry / RTD don't like `PyGMT` or `GeoPandas` since they both rely on C packages which can't be installed via pip (`GMT` and `GDAL`). Next release should fix this.
* Poetry / RTD don't like `PyGMT` or `GeoPandas` since they both rely on C packages which can't be installed via pip (`GMT` and `GDAL`). Next release should fix this.


### 🧑‍🤝‍🧑 Contributors
Expand All @@ -165,7 +167,7 @@

---

## Release v0.0.0
## Release v0.0.0

* 🎉 **First release of Antarctic-plots** 🎉

Expand Down
8 changes: 1 addition & 7 deletions docs/gallery/profile_with_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/home/tankerma/antarctic_plots/antarctic_plots/profile.py:582: FutureWarning: The 'color' parameter has been deprecated since v0.8.0 and will be removed in v0.12.0. Please use 'fill' instead.\n",
" fig.plot(\n",
"/Users/home/tankerma/antarctic_plots/antarctic_plots/profile.py:582: FutureWarning: The 'color' parameter has been deprecated since v0.8.0 and will be removed in v0.12.0. Please use 'fill' instead.\n",
" fig.plot(\n",
"/Users/home/tankerma/antarctic_plots/antarctic_plots/profile.py:582: FutureWarning: The 'color' parameter has been deprecated since v0.8.0 and will be removed in v0.12.0. Please use 'fill' instead.\n",
" fig.plot(\n",
"gmtset [WARNING]: Representation of font type not recognized. Using default.\n"
]
},
Expand Down Expand Up @@ -98,7 +92,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.11.0"
},
"vscode": {
"interpreter": {
Expand Down
2 changes: 1 addition & 1 deletion env/env_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python>=3.8
- python>=3.9
# Run-time
- pandas
- openpyxl
Expand Down
2 changes: 1 addition & 1 deletion env/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python>=3.8
- python>=3.9
- pip
# Build
- build
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "antarctic_plots"
dynamic = ["version"]
description = "Functions to automate Antarctic data visualization"
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = {file = "LICENSE"}
authors = [
{name = "Matthew Tankersley", email = "matt.d.tankersley@gmail.com"},
Expand All @@ -23,7 +23,6 @@ classifiers = [
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
Expand Down

0 comments on commit 30ea5aa

Please sign in to comment.