Skip to content

Commit

Permalink
import monetio succeeds!
Browse files Browse the repository at this point in the history
note that pyresample is currently a required dep in monet
  • Loading branch information
zmoon committed Jan 26, 2022
1 parent 86610e5 commit 70c74ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions monetio/models/prepchem.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import xarray as xr
from pyresample.utils import wrap_longitudes
from scipy.io import FortranFile

try:
import fv3grid as fg
Expand Down Expand Up @@ -30,6 +28,9 @@ def open_dataset(fname, dtype="f4", res="C384", tile=1):
Description of returned object.
"""
from pyresample.utils import wrap_longitudes
from scipy.io import FortranFile

w = FortranFile(fname)
a = w.read_reals(dtype=dtype)
r = int(res[1:])
Expand Down Expand Up @@ -66,6 +67,8 @@ def to_prepchem_binary(data, fname="output.bin", dtype="f4"):
Description of returned object.
"""
from scipy.io import FortranFile

f = FortranFile(fname, "w")
f.write_record(data.astype(dtype))
f.close()
1 change: 1 addition & 0 deletions tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import monetio # noqa: F401

0 comments on commit 70c74ad

Please sign in to comment.