Skip to content

Commit

Permalink
flake8 syntax update
Browse files Browse the repository at this point in the history
  • Loading branch information
frodedinessen committed Apr 11, 2024
1 parent 8cedca1 commit 0bcf317
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/test_sarwind.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def testSARWind_using_s1EWnc_arome_filenames(sarEW_NBS, arome):
Arome Arctic model.
"""
w = SARWind(sarEW_NBS, arome)
assert type(w) == SARWind
assert isinstance(w, SARWind)


@pytest.mark.safe
Expand All @@ -65,4 +65,4 @@ def testSARWind_using_s1IWDVsafe_meps_filenames(sarIW_SAFE, arome):
from MEPS model.
"""
w = SARWind(sarIW_SAFE, arome)
assert type(w) == SARWind
assert isinstance(w, SARWind)
2 changes: 1 addition & 1 deletion tests/test_winddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def testWINDdata_input_parameter():
""" Freetext search """
kw_names = 'Arome-Arctic%'
or_filt = WINDdata._get_freetxt_search([], kw_names)
assert type(or_filt) == fes.PropertyIsLike
assert isinstance(or_filt, fes.PropertyIsLike)

""" Restricting search from start,stop time """
stop = datetime.datetime(2023, 4, 17, 0, 00, 00).replace(tzinfo=pytz.utc)
Expand Down
5 changes: 3 additions & 2 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ def plot_wind_map(w, vmin=0, vmax=20, title=None):
""" Plot a map of the wind field in w.
"""
land_f = cfeature.NaturalEarthFeature('physical', 'land', '50m', edgecolor='face',
facecolor='lightgray')
facecolor='lightgray')

# FIG 1
ax1 = plt.subplot(projection=ccrs.PlateCarree())
ax1.add_feature(land_f)
cb = True
mlon, mlat = w.get_geolocation_grids()
da = xr.DataArray(np.sqrt(np.square(w['U']) + np.square(w['V'])),
dims=["y", "x"], coords={"lat": (("y", "x"), mlat), "lon": (("y", "x"), mlon)})
dims=["y", "x"],
coords={"lat": (("y", "x"), mlat), "lon": (("y", "x"), mlon)})
da.plot.pcolormesh("lon", "lat", ax=ax1, vmin=vmin, vmax=vmax, cmap=cmocean.cm.balance,
add_colorbar=cb)
# ds = xr.open_dataset(w.filename)
Expand Down

0 comments on commit 0bcf317

Please sign in to comment.