Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 committed Jul 10, 2023
1 parent adfb5af commit a332141
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion geoviews/element/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,10 @@ def from_uv(cls, data, kdims=None, vdims=None, **params):
if vdims is None:
vdims = ['u', 'v']
dataset = Dataset(data, kdims=kdims, vdims=vdims, **params)
us, vs = (dataset.dimension_values(i) for i in range(2, 4))
us, vs = (dataset.dimension_values(i) for i in (2, 3))

uv_magnitudes = np.hypot(us, vs) # unscaled
# using meteorological convention (direction FROM which wind blows)
radians = np.pi / 2 - np.arctan2(-vs, -us)

# calculations on this data could mutate the original data
Expand Down
2 changes: 1 addition & 1 deletion geoviews/tests/plotting/mpl/test_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_windbarbs_dataset(self):
np.testing.assert_almost_equal(mpl_barbs.v.data, V.T.flatten())

def test_windbarbs_from_uv(self):
x = np.linspace(-1, 1, 2)
x = np.linspace(-1, 1, 4)
X, Y = np.meshgrid(x, x)
U, V = 10 * X, 2 * Y

Expand Down

0 comments on commit a332141

Please sign in to comment.