Skip to content

Commit 56cfad2

Browse files
committed
prepare for optional Numpy 1.20 type hinting syntax
1 parent 9912ea2 commit 56cfad2

File tree

17 files changed

+586
-557
lines changed

17 files changed

+586
-557
lines changed

examples/plot_geodetic2ecef.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#!/usr/bin/env python3
2+
import typing
23
import pymap3d as pm
34
import matplotlib.pyplot as mpl
45
import numpy as np
56
import argparse
67

8+
try:
9+
from numpy.typing import ArrayLike
10+
except ImportError:
11+
ArrayLike = typing.Any
12+
713
p = argparse.ArgumentParser()
814
p.add_argument("alt_m", help="altitude [meters]", type=float, default=0.0, nargs="?")
915
p = p.parse_args()
@@ -13,7 +19,7 @@
1319
x, y, z = pm.geodetic2ecef(lat, lon, p.alt_m)
1420

1521

16-
def panel(ax, val: np.ndarray, name: str, cmap: str = None):
22+
def panel(ax, val: ArrayLike, name: str, cmap: str = None):
1723
hi = ax.pcolormesh(lon, lat, val, cmap=cmap)
1824
ax.set_title(name)
1925
fg.colorbar(hi, ax=ax).set_label(name + " [m]")

setup.cfg

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pymap3d
3-
version = 2.4.2
3+
version = 2.4.3
44
author = Michael Hirsch, Ph.D.
55
author_email = [email protected]
66
description = pure Python (no prereqs) coordinate conversions, following convention of several popular Matlab routines.
@@ -13,24 +13,14 @@ classifiers =
1313
Intended Audience :: Science/Research
1414
Operating System :: OS Independent
1515
Programming Language :: Python :: 3
16-
Programming Language :: Python :: 3.5
17-
Programming Language :: Python :: 3.6
18-
Programming Language :: Python :: 3.7
19-
Programming Language :: Python :: 3.8
20-
Programming Language :: Python :: 3.9
21-
Programming Language :: Python :: Implementation :: CPython
22-
Programming Language :: Python :: Implementation :: PyPy
2316
Topic :: Scientific/Engineering :: GIS
2417
license_files =
2518
LICENSE.txt
26-
long_description = file: README.md
27-
long_description_content_type = text/markdown
2819

2920
[options]
3021
python_requires = >= 3.5.2
3122
packages = find:
3223
zip_safe = False
33-
install_requires =
3424
package_dir=
3525
=src
3626

0 commit comments

Comments
 (0)