Skip to content

Commit

Permalink
Iss349 (#355)
Browse files Browse the repository at this point in the history
* format

* format

* format

* unpin matplotlib in binder

---------

Co-authored-by: Miguel Jimenez <mjimen17@jhu.edu>
  • Loading branch information
Miguel Jimenez and Mikejmnez authored May 19, 2023
1 parent ab60c6d commit fb4cc96
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
dependencies:
- python
- numpy
- matplotlib<=3.6.0
- matplotlib
- pandas
- bokeh
- rise
Expand Down
2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- ffmpeg
- aiohttp
- pandas
- matplotlib<=3.6
- matplotlib
- fsspec!=0.9.0
- pooch
- pip
Expand Down
8 changes: 6 additions & 2 deletions oceanspy/tests/test_animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@
# ==========
# TS diagram
# ==========
Xmin = od.dataset["XC"].min().values
Xmax = od.dataset["XC"].max().values


@pytest.mark.parametrize(
"od_in," " cutout_kwargs, colorName, Tlim, Slim, cmap_kwargs",
"od_in, cutout_kwargs, colorName, Tlim, Slim, cmap_kwargs",
[
(od, None, None, None, None, None),
(od, {"ZRange": 0}, "Temp", [0, 1], [0, 1], {"robust": True}),
(od, {"XRange": [Xmin, Xmax]}, "Temp", [0, 1], [0, 1], {"robust": True}),
],
)
def test_anim_TSdiagram(od_in, cutout_kwargs, colorName, Tlim, Slim, cmap_kwargs):
Expand Down
12 changes: 8 additions & 4 deletions oceanspy/tests/test_subsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def test_cutout_faces(
# =======
# MOORING
# =======
@pytest.mark.parametrize("od", [MITgcm_rect_nc])
@pytest.mark.parametrize("od", [MITgcm_rect_nc, ECCOod])
@pytest.mark.parametrize("cartesian", [True, False])
@pytest.mark.parametrize(
"kwargs", [{}, {"YRange": None, "XRange": None, "add_Hbdr": True}]
Expand All @@ -338,16 +338,20 @@ def test_mooring(od, cartesian, kwargs):
Xmoor = [this_od.dataset["XC"].min().values, this_od.dataset["XC"].max().values]
Ymoor = [this_od.dataset["YC"].min().values, this_od.dataset["YC"].max().values]
else:
Xmoor = [-80, 80]
Xmoor = [-80, 0]
Ymoor = [35, 35]
new_od = this_od.subsample.mooring_array(Xmoor=Xmoor, Ymoor=Ymoor, **kwargs)

with pytest.raises(ValueError):
new_od.subsample.mooring_array(Xmoor=Xmoor, Ymoor=Ymoor)

for index in [0, -1]:
assert new_od.dataset["XC"].isel(mooring=index).values == Xmoor[index]
assert new_od.dataset["YC"].isel(mooring=index).values == Ymoor[index]
if "face" not in od.dataset.dims:
assert new_od.dataset["XC"].isel(mooring=index).values == Xmoor[index]
assert new_od.dataset["YC"].isel(mooring=index).values == Ymoor[index]
else:
assert new_od.dataset["XC"].isel(mooring=index).values - Xmoor[index] < 1
assert new_od.dataset["YC"].isel(mooring=index).values - Ymoor[index] < 1

checkX = new_od.grid.diff(new_od.dataset["XC"], "mooring")
checkY = new_od.grid.diff(new_od.dataset["YC"], "mooring")
Expand Down
2 changes: 1 addition & 1 deletion sciserver_catalogs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies:
- cftime
- rasterio
- cfgrib
- matplotlib <= 3.6.0
- matplotlib
- cf_xarray
- ipykernel
- numba
Expand Down

0 comments on commit fb4cc96

Please sign in to comment.