Skip to content

Commit

Permalink
Merge pull request #1349 from knutfrode/dev
Browse files Browse the repository at this point in the history
Testing with Numpy>=2.0 and netCDF>=1.7.1. Seems to work locally.
  • Loading branch information
knutfrode authored Jul 3, 2024
2 parents 072ba69 + 8a6ae17 commit b2149bf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
- matplotlib>=3.5
- numpy>=1.17
- numpy<2.0
- scipy>=1.6
- netcdf4<=1.6.1
- ffmpeg
Expand All @@ -29,7 +29,7 @@ dependencies:
- cmocean
- utm
- roaring-landmask>=0.7
- trajan>=0.1.3
- trajan>=0.6.3
- adios_db<1.2
- copernicusmarine
- pip
2 changes: 1 addition & 1 deletion examples/example_openoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from opendrift.readers import reader_netCDF_CF_generic
from opendrift.models.openoil import OpenOil

o = OpenOil(loglevel=20, weathering_model='noaa')
o = OpenOil(loglevel=20, location='Norway')

print(o.oiltypes) # Print available oil types

Expand Down
4 changes: 2 additions & 2 deletions opendrift/models/basemodel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3114,7 +3114,7 @@ def plot_timestep(i):
if cmap is None:
cmap = 'jet'
if isinstance(cmap, str):
cmap = matplotlib.cm.get_cmap(cmap)
cmap = matplotlib.colormaps[cmap]
if color is not False:
if isinstance(color, str):
colorarray = self.get_property(color)[0].T
Expand Down Expand Up @@ -3499,7 +3499,7 @@ def plot(self,
lvmax = param.max()
lc = LineCollection(
segments,
#cmap=plt.get_cmap('Spectral'),
#cmap=plt.colormaps['Spectral'],
cmap=cmap,
norm=plt.Normalize(lvmin, lvmax),
transform=gcrs)
Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_openberg(self):
arr=[0.16072658,0.16466097,0.17384121,0.17325179,0.1715925,0.15592695]

for indx in range(len(arr)):
self.assertAlmostEqual(o.uw_weighting[indx],arr[indx],8)
self.assertAlmostEqual(o.uw_weighting[indx],arr[indx],7)

self.assertAlmostEqual(o.history['lon'].data[0][1],3.991, 3)
self.assertAlmostEqual(o.history['lat'].data[0][1],62.011, 3)
Expand Down

0 comments on commit b2149bf

Please sign in to comment.