Skip to content

Commit

Permalink
fix: add IEMRE roundtrip test
Browse files Browse the repository at this point in the history
  • Loading branch information
akrherz committed Aug 6, 2024
1 parent b041d7f commit 2d31d5d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_iemre.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ def test_writing_grids():
cursor = pgconn.cursor()
valid = datetime.date.today() + datetime.timedelta(days=120)
ds = iemre.get_grids(valid, varnames=["high_tmpk"], domain=domain)
# Set a sentinel value to see if it approximately round-trips
sentinel = 251
ds["high_tmpk"].values[140, 130] = sentinel
iemre.set_grids(valid, ds, domain=domain)
ds = iemre.get_grids(valid, varnames=["high_tmpk"], domain=domain)
assert abs(ds["high_tmpk"].values[140, 130] - sentinel) < 0.1
assert ds["high_tmpk"].lat[0] > 0
# Cleanup after ourself
cursor.execute(
Expand Down

0 comments on commit 2d31d5d

Please sign in to comment.