Skip to content

Commit

Permalink
Add test for multi-time grid
Browse files Browse the repository at this point in the history
Added a test grid with two date/time values for a grid. Bumped version
number.
  • Loading branch information
nawendt committed Jan 27, 2023
1 parent 6f62440 commit 1dc224d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import find_packages, setup

NAME = 'gempakio'
VERSION = '0.8.2'
VERSION = '0.8.3'
DESCR = 'Read GEMPAK data with pure Python.'
URL = 'https://github.com/nawendt/gempakio'
REQUIRES = ['numpy', 'pandas', 'pyproj', 'xarray']
Expand Down
Binary file added tests/data/multi_time.grd
Binary file not shown.
13 changes: 13 additions & 0 deletions tests/test_grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,16 @@ def test_time_keywords(keyword, date_time):
expected = datetime.strptime(date_time, '%Y%m%d%H%M')

assert grid_dt == expected


def test_multi_time_grid():
"""Test files with multiple times on a single grid."""
g = Path(__file__).parent / 'data' / 'multi_time.grd'

grid = GempakGrid(g)
grid_info = grid.gdinfo()[0]
dattim1 = grid_info.DATTIM1
dattim2 = grid_info.DATTIM2

assert dattim1 == datetime(1991, 8, 19, 0, 0)
assert dattim2 == datetime(1991, 8, 20, 0, 0)

0 comments on commit 1dc224d

Please sign in to comment.