Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bokeh pinning to >=2.4 #525

Merged
merged 24 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
shell: bash -l {0}
env:
DESC: "Documentation build"
CHANS_DEV: "-c pyviz/label/dev -c bokeh -c conda-forge"
CHANS_DEV: "-c pyviz/label/dev -c conda-forge -c nodefaults"
MPLBACKEND: "Agg"
MOZ_HEADLESS: 1
DISPLAY: ":99.0"
Expand Down Expand Up @@ -47,6 +47,7 @@ jobs:
- name: doit develop_install
run: |
eval "$(conda shell.bash hook)"
conda config --set channel_priority strict
conda activate test-environment
conda list
doit develop_install ${{ env.CHANS_DEV}} -o doc -o examples
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8, 3.9]
exclude:
- os: windows-latest
python-version: 3.6
- os: ubuntu-latest
python-version: 3.6
- os: macos-latest
python-version: 3.7
timeout-minutes: 60
defaults:
run:
Expand All @@ -29,8 +27,8 @@ jobs:
DESC: "Python ${{ matrix.python-version }} tests"
HV_REQUIREMENTS: "unit_tests"
PYTHON_VERSION: ${{ matrix.python-version }}
CHANS_DEV: "-c pyviz/label/dev -c bokeh -c conda-forge"
CHANS: "-c pyviz -c bokeh -c conda-forge"
CHANS_DEV: "-c pyviz/label/dev -c conda-forge -c nodefaults"
CHANS: "-c pyviz -c conda-forge -c nodefaults"
DISPLAY: ":99.0"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand All @@ -52,12 +50,17 @@ jobs:
doit ecosystem_setup
conda install -c conda-forge "nodejs=15.3.0"
doit env_create ${{ env.CHANS_DEV}} --python=${{ matrix.python-version }}
- name: conda priority
if: (!contains(matrix.os, 'macos'))
run: |
eval "$(conda shell.bash hook)"
conda config --set channel_priority strict
- name: doit develop_install
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
conda list
doit develop_install ${{ env.CHANS_DEV}} -o examples -o recommended -o tests -o build
doit develop_install ${{ env.CHANS_DEV}} -o examples -o recommended
bokeh sampledata
geoviews fetch-data --path=examples
echo "-----"
Expand Down
30 changes: 14 additions & 16 deletions examples/gallery/bokeh/katrina_track.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"outputs": [],
"source": [
"import geoviews as gv\n",
"import cartopy.crs as ccrs\n",
"import cartopy.io.shapereader as shpreader\n",
"import shapely.geometry as sgeom\n",
"\n",
Expand Down Expand Up @@ -58,19 +59,20 @@
"title = 'US States which intersect the track of Hurricane Katrina (2005)'\n",
"\n",
"track_buffer = track.buffer(2)\n",
"shapes = []\n",
"intersects, buffers, other = [], [], []\n",
"for state in shpreader.Reader(states_shp).geometries():\n",
" # pick a default color for the land with a black outline,\n",
" # this will change if the storm intersects with our track\n",
" facecolor = (0.9375, 0.9375, 0.859375)\n",
"\n",
" if state.intersects(track):\n",
" facecolor = 'red'\n",
" intersects.append(state)\n",
" elif state.intersects(track_buffer):\n",
" facecolor = '#FF7E00'\n",
" shapes.append(gv.Shape(state).opts(style=dict(fill_color=facecolor)))\n",
"shapes.append(gv.Shape(track_buffer).opts(style=dict(alpha=0.5)))\n",
"shapes.append(gv.Shape(track))"
" buffers.append(state)\n",
" else:\n",
" other.append(state)\n",
"\n",
"intersects = gv.Polygons(intersects, label='State directly intersects with track').opts(show_legend=True, fill_color='#FF0000')\n",
"buffers = gv.Polygons(buffers, label='State is within 2 degrees of track').opts(show_legend=True, fill_color='#FF7E00')\n",
"other = gv.Polygons(other).opts(fill_color=(0.9375, 0.9375, 0.859375))\n",
"track_buffer = gv.Shape(track_buffer).opts(alpha=0.5)\n",
"track = gv.Shape(track)"
]
},
{
Expand All @@ -86,12 +88,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Add proxy artists for legend\n",
"popts = dict(show_legend=True, apply_ranges=False)\n",
"direct_hit = gv.Polygons([[(0,0)]], label='State directly intersects with track').opts(color='red', **popts)\n",
"within_2_deg = gv.Polygons([[(0,0)]], label='State is within 2 degrees of track').opts(color='#FF7E00', **popts)\n",
"\n",
"(gv.Overlay(shapes) * direct_hit * within_2_deg).opts(width=700, height=500, infer_projection=True, title=title)"
"(intersects * buffers * other * track_buffer * track).opts(\n",
" width=700, height=500, projection=ccrs.PlateCarree(), title=title, show_legend=True)"
]
}
],
Expand Down
23 changes: 21 additions & 2 deletions examples/gallery/bokeh/vectorfield_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"source": [
"import numpy as np\n",
"import geoviews as gv\n",
"from cartopy.examples import arrows\n",
"import cartopy.crs as ccrs\n",
"\n",
"gv.extension('bokeh')"
]
Expand All @@ -26,7 +26,26 @@
"metadata": {},
"outputs": [],
"source": [
"xs, ys, U, V, crs = arrows.sample_data()\n",
"def sample_data(shape=(20, 30)):\n",
" \"\"\"\n",
" Return ``(x, y, u, v, crs)`` of some vector data\n",
" computed mathematically. The returned crs will be a rotated\n",
" pole CRS, meaning that the vectors will be unevenly spaced in\n",
" regular PlateCarree space.\n",
"\n",
" \"\"\"\n",
" crs = ccrs.RotatedPole(pole_longitude=177.5, pole_latitude=37.5)\n",
"\n",
" x = np.linspace(311.9, 391.1, shape[1])\n",
" y = np.linspace(-23.6, 24.8, shape[0])\n",
"\n",
" x2d, y2d = np.meshgrid(x, y)\n",
" u = 10 * (2 * np.cos(2 * np.deg2rad(x2d) + 3 * np.deg2rad(y2d + 30)) ** 2)\n",
" v = 20 * np.cos(6 * np.deg2rad(x2d))\n",
"\n",
" return x, y, u, v, crs\n",
"\n",
"xs, ys, U, V, crs = sample_data()\n",
"mag = np.sqrt(U**2 + V**2)\n",
"angle = (np.pi/2.) - np.arctan2(U/mag, V/mag)\n",
"tiles = gv.tile_sources.Wikipedia\n",
Expand Down
23 changes: 12 additions & 11 deletions examples/gallery/matplotlib/katrina_track.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,20 @@
"title = 'US States which intersect the track of Hurricane Katrina (2005)'\n",
"\n",
"track_buffer = track.buffer(2)\n",
"shapes = []\n",
"intersects, buffers, other = [], [], []\n",
"for state in shpreader.Reader(states_shp).geometries():\n",
" # pick a default color for the land with a black outline,\n",
" # this will change if the storm intersects with our track\n",
" facecolor = [0.9375, 0.9375, 0.859375]\n",
"\n",
" if state.intersects(track):\n",
" facecolor = 'red'\n",
" intersects.append(state)\n",
" elif state.intersects(track_buffer):\n",
" facecolor = '#FF7E00'\n",
" shapes.append(gv.Shape(state).opts(facecolor=facecolor))\n",
"shapes.append(gv.Shape(track_buffer).opts(alpha=0.5))\n",
"shapes.append(gv.Shape(track).opts(facecolor='none'))"
" buffers.append(state)\n",
" else:\n",
" other.append(state)\n",
"\n",
"intersects = gv.Polygons(intersects, label='State directly intersects with track').opts(facecolor='#FF0000')\n",
"buffers = gv.Polygons(buffers, label='State is within 2 degrees of track').opts(facecolor='#FF7E00')\n",
"other = gv.Polygons(other).opts(facecolor=(0.9375, 0.9375, 0.859375))\n",
"track_buffer = gv.Shape(track_buffer).opts(alpha=0.5)\n",
"track = gv.Shape(track)"
]
},
{
Expand All @@ -88,7 +89,7 @@
"metadata": {},
"outputs": [],
"source": [
"gv.Overlay(shapes).relabel(title)"
"(intersects * buffers * other * track_buffer * track).opts(title=title)"
]
}
],
Expand Down
23 changes: 21 additions & 2 deletions examples/gallery/matplotlib/vectorfield_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"source": [
"import numpy as np\n",
"import geoviews as gv\n",
"from cartopy.examples import arrows\n",
"import cartopy.crs as ccrs\n",
"\n",
"gv.extension('matplotlib')\n",
"\n",
Expand All @@ -28,7 +28,26 @@
"metadata": {},
"outputs": [],
"source": [
"xs, ys, U, V, crs = arrows.sample_data()\n",
"def sample_data(shape=(20, 30)):\n",
" \"\"\"\n",
" Return ``(x, y, u, v, crs)`` of some vector data\n",
" computed mathematically. The returned crs will be a rotated\n",
" pole CRS, meaning that the vectors will be unevenly spaced in\n",
" regular PlateCarree space.\n",
"\n",
" \"\"\"\n",
" crs = ccrs.RotatedPole(pole_longitude=177.5, pole_latitude=37.5)\n",
"\n",
" x = np.linspace(311.9, 391.1, shape[1])\n",
" y = np.linspace(-23.6, 24.8, shape[0])\n",
"\n",
" x2d, y2d = np.meshgrid(x, y)\n",
" u = 10 * (2 * np.cos(2 * np.deg2rad(x2d) + 3 * np.deg2rad(y2d + 30)) ** 2)\n",
" v = 20 * np.cos(6 * np.deg2rad(x2d))\n",
"\n",
" return x, y, u, v, crs\n",
"\n",
"xs, ys, U, V, crs = sample_data()\n",
"mag = np.sqrt(U**2 + V**2)\n",
"angle = (np.pi/2.) - np.arctan2(U/mag, V/mag)\n",
"tiles = gv.tile_sources.Wikipedia\n",
Expand Down
Loading