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

Commit

Permalink
update API
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jul 13, 2018
1 parent 6463148 commit 5a4f2d9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Write data to NetCDF (HDF5) with `-o` option.
import pyhwm93
from datetime import datetime

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

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

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

## Notes
Expand Down
4 changes: 2 additions & 2 deletions RunHWM93.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from numpy import arange
from dateutil.parser import parse
from argparse import ArgumentParser
from pyhwm93 import runhwm93
import pyhwm93
try:
from matplotlib.pyplot import show
from pyhwm93.plots import plothwm
Expand Down Expand Up @@ -44,7 +44,7 @@ def main():

T = parse(p.simtime)

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

if p.outfn:
outfn = Path(p.outfn).expanduser()
Expand Down
4 changes: 2 additions & 2 deletions pyhwm93/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import xarray


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

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyhwm93
version = 0.8.1
version = 0.9.0
author = Michael Hirsch, Ph.D.
description = Horizontal Wind Model 1993 in Python
url = https://github.com/scivision/pyhwm93
Expand Down
4 changes: 2 additions & 2 deletions tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from numpy.testing import assert_allclose
import pytest
from datetime import datetime
from pyhwm93 import runhwm93
import pyhwm93


def test_hwm():
Expand All @@ -14,7 +14,7 @@ def test_hwm():
f107 = 100
ap = 4

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

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

0 comments on commit 5a4f2d9

Please sign in to comment.