Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OpenDrift/opendrift
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eefa4def1bf1515fc0dadb4346f0e042d4b2518e
Choose a base ref
..
head repository: OpenDrift/opendrift
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 571a4764dab96311129f48e2d47a29f7b504212c
Choose a head ref
Showing with 1 addition and 6 deletions.
  1. +0 −5 opendrift/readers/reader_netCDF_CF_generic.py
  2. +1 −1 tests/unit/test_fvcom.py
5 changes: 0 additions & 5 deletions opendrift/readers/reader_netCDF_CF_generic.py
Original file line number Diff line number Diff line change
@@ -462,11 +462,6 @@ def get_variables(self, requested_variables, time=None,

variables[par] = np.asarray(variables[par])

# If 2D array is returned due to the fancy slicing
# methods of netcdf-python, we need to take the diagonal
if variables[par].ndim > 1 and block is False:
variables[par] = variables[par].diagonal()

# Mask values outside domain
variables[par] = np.ma.array(variables[par],
ndmin=2, mask=False)
2 changes: 1 addition & 1 deletion tests/unit/test_fvcom.py
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ def test_get_variables(benchmark):
times = r.times[tidx]
xc = r.xc[idx]
yc = r.yc[idx]
z = r.siglay[zidx, idx] * r.dataset['h_center'][idx]
z = (r.dataset['siglay_center'][zidx, idx] * r.dataset['h_center'][idx]).diagonal()
assert z.shape == xc.shape

# u is a face / siglay variable