Add wind barbs plot method to hvplot
Adds ds.hvplot.barbs() method to support meteorological wind barb visualizations using GeoViews' WindBarbs element.
Changes
Converter (hvplot/converter.py):
- Conditional import of
WindBarbsfrom geoviews (falls back toVectorFieldplaceholder) - Added 'barbs' to
_kind_mapping,_kind_options, and_geo_types - Implemented
barbs()converter method supporting both Cartesian (u, v) and polar (angle, mag) wind components - Parameter validation prevents mixing formats and ensures completeness
Plotting API (hvplot/plotting/core.py):
- Added
barbs()method tohvPlotTabularwith comprehensive docstring - Registered 'barbs' in
__all__list
Tests:
- Added
TestWindBarbsclass with 7 test cases covering valid usage and validation errors - Excluded 'barbs' from generic
FRAME_TYPES(requires special parameters like vectorfield)
Usage
import pandas as pd
import hvplot.pandas
# Cartesian components
df.hvplot.barbs(x='lon', y='lat', u='u_wind', v='v_wind', geo=True)
# Polar components
df.hvplot.barbs(x='lon', y='lat', angle='direction', mag='speed', geo=True)
# Via kind parameter
df.hvplot(x='lon', y='lat', u='u_wind', v='v_wind', kind='barbs')
Requires geoviews package. Works with and without geographic projections.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/holoviz/geoviews/pulls/805
- Triggering command:
/usr/bin/curl curl -s REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)
Original prompt
This section details on the original issue you should resolve
<issue_title>Add wind barbs as a method to hvplot</issue_title> <issue_description>Now that https://github.com/holoviz/geoviews/pull/805 is in, I think we can add
ds.hvplot.barbs(...)to hvplot</issue_description>Comments on the Issue (you are @copilot in this section)
- Fixes holoviz/hvplot#1695
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.