Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Commit 5a4f2d9

Browse files
committed
update API
1 parent 6463148 commit 5a4f2d9

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Write data to NetCDF (HDF5) with `-o` option.
4646
import pyhwm93
4747
from datetime import datetime
4848

49-
winds = pyhwm93.runhwm93(t=datetime(2017,11,12,8), altkm=150.,
50-
glat=65., glon=-148., f107a=150, f107=150, ap=4)
49+
winds = pyhwm93.run(t=datetime(2017,11,12,8), altkm=150.,
50+
glat=65., glon=-148., f107a=150, f107=150, ap=4)
5151
```
5252

5353
`winds` is an [xarray.Dataset](http://xarray.pydata.org/en/stable/generated/xarray.Dataset.html)
@@ -75,7 +75,7 @@ print(winds.zonal.values)
7575

7676
If you don't have the Matlab Aerospace Toolbox, you can import this Python module from Matlab ≥ R2014b as
7777
```matlab
78-
py.pyhwm93.runhwm93()
78+
py.pyhwm93.run()
7979
```
8080

8181
## Notes

RunHWM93.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from numpy import arange
1313
from dateutil.parser import parse
1414
from argparse import ArgumentParser
15-
from pyhwm93 import runhwm93
15+
import pyhwm93
1616
try:
1717
from matplotlib.pyplot import show
1818
from pyhwm93.plots import plothwm
@@ -44,7 +44,7 @@ def main():
4444

4545
T = parse(p.simtime)
4646

47-
winds = runhwm93(T, altkm, glat, glon, p.f107a, p.f107, p.ap)
47+
winds = pyhwm93.run(T, altkm, glat, glon, p.f107a, p.f107, p.ap)
4848

4949
if p.outfn:
5050
outfn = Path(p.outfn).expanduser()

pyhwm93/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import xarray
66

77

8-
def runhwm93(t: datetime, altkm: np.ndarray, glat: float, glon: float,
9-
f107a: float, f107: float, ap: int) -> xarray.Dataset:
8+
def run(t: datetime, altkm: np.ndarray, glat: float, glon: float,
9+
f107a: float, f107: float, ap: int) -> xarray.Dataset:
1010
altkm = np.atleast_1d(altkm).astype(float)
1111
iyd, utsec, stl = datetime2gtd(t, glon)
1212

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pyhwm93
3-
version = 0.8.1
3+
version = 0.9.0
44
author = Michael Hirsch, Ph.D.
55
description = Horizontal Wind Model 1993 in Python
66
url = https://github.com/scivision/pyhwm93

tests/test_all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from numpy.testing import assert_allclose
33
import pytest
44
from datetime import datetime
5-
from pyhwm93 import runhwm93
5+
import pyhwm93
66

77

88
def test_hwm():
@@ -14,7 +14,7 @@ def test_hwm():
1414
f107 = 100
1515
ap = 4
1616

17-
wind = runhwm93(t, altkm, glat, glon, f107a, f107, ap)
17+
wind = pyhwm93.run(t, altkm, glat, glon, f107a, f107, ap)
1818

1919
assert_allclose(wind['meridional'], -110.16133881, rtol=1e-4) # gfortran 4.6 vs 5.2
2020
assert_allclose(wind['zonal'], -12.40071201, rtol=1e-4) # gfortran 4.6 vs 5.2

0 commit comments

Comments
 (0)