Skip to content

Commit

Permalink
Merge branch 'main' into add_op_threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt committed Sep 29, 2023
2 parents 02e561a + df635f6 commit 21d35ff
Show file tree
Hide file tree
Showing 23 changed files with 299 additions and 223 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

open_collective: holoviz
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
shell: bash -l {0}
env:
CHANS_DEV: "-c pyviz/label/dev -c bokeh"
PKG_TEST_PYTHON: "--test-python=py37"
PYTHON_VERSION: "3.7"
PKG_TEST_PYTHON: "--test-python=py38"
PYTHON_VERSION: "3.8"
CHANS: "-c pyviz"
MPLBACKEND: "Agg"
CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }}
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: 3.8
python-version: ${{ matrix.python-version }}
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- name: Set output
Expand Down Expand Up @@ -64,8 +64,8 @@ jobs:
shell: bash -l {0}
env:
CHANS_DEV: "-c pyviz/label/dev -c bokeh"
PKG_TEST_PYTHON: "--test-python=py37"
PYTHON_VERSION: "3.7"
PKG_TEST_PYTHON: "--test-python=py38"
PYTHON_VERSION: "3.8"
CHANS: "-c pyviz"
MPLBACKEND: "Agg"
PPU: ${{ secrets.PPU }}
Expand Down
75 changes: 5 additions & 70 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,10 @@ concurrency:

jobs:
pre_commit:
name: Run pre-commit hooks
name: Run pre-commit
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "1"
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: pre-commit
uses: pre-commit/[email protected]
- uses: holoviz-dev/holoviz_tasks/[email protected]
test_suite:
name: Pytest on ${{ matrix.os }} with Python ${{ matrix.python-version }}
needs: [pre_commit]
Expand All @@ -39,35 +29,27 @@ jobs:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
# Run on the full set on schedule, workflow_dispatch and push&tags events, otherwise on a subset.
python-version: ${{ ( github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'push' && github.ref_type == 'tag' ) ) && fromJSON('["3.7", "3.8", "3.9", "3.10", "3.11"]') || fromJSON('["3.7", "3.9", "3.11"]') }}
python-version: ${{ ( github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'push' && github.ref_type == 'tag' ) ) && fromJSON('["3.8", "3.9", "3.10", "3.11"]') || fromJSON('["3.8", "3.11"]') }}
timeout-minutes: 90
defaults:
run:
shell: bash -el {0}
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0.1a12
- uses: holoviz-dev/holoviz_tasks/install@v0.1a17
with:
name: unit_test_suite
python-version: ${{ matrix.python-version }}
channel-priority: strict
channels: pyviz/label/dev,conda-forge,nodefaults
envs: "-o examples_tests -o tests"
envs: "-o examples_tests -o tests -o examples_conda"
cache: true
conda-update: true
conda-mamba: mamba
id: install
- name: patch fiona/geostack on Python 3.7 / Macos
if: steps.install.outputs.cache-hit != 'true' && contains(matrix.os, 'macos') && matrix.python-version == '3.7'
run: |
conda activate test-environment
mamba install "fiona=1.8" "gdal=3.3"
- name: doit test_unit
run: |
conda activate test-environment
doit test_unit
- name: test examples
# Should be removed when numba support python 3.11
if: matrix.python-version != '3.11'
run: |
conda activate test-environment
bokeh sampledata
Expand All @@ -76,50 +58,3 @@ jobs:
run: |
conda activate test-environment
codecov
test_suite_36:
name: Pytest on ${{ matrix.os }} with Python ${{ matrix.python-version }}
needs: [pre_commit]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['macos-latest', 'windows-latest']
python-version: ['3.6']
timeout-minutes: 90
defaults:
run:
shell: bash -l {0}
steps:
- uses: holoviz-dev/holoviz_tasks/[email protected]
with:
name: unit_test_suite_36
python-version: ${{ matrix.python-version }}
channel-priority: strict
channels: pyviz/label/dev,conda-forge,nodefaults
envs: "-o tests"
cache: true
conda-update: true
conda-mamba: mamba
id: install
- name: doit develop_install py
if: steps.install.outputs.cache-hit != 'true'
run: |
conda activate test-environment
# - Pin panel on Python 3.6 because one or more dev releases on the 0.13.* series
# can be installed on Python 3.6 but are actually not compatible with Python 3.6
# Panel 0.13 will support Python >= 3.7 only so the pin here can stay indefinitely.
# - Install importlib_resources to fix tqdm that missed adding it as a dependency
# for 3.6 (https://github.com/conda-forge/tqdm-feedstock/pull/114)
conda install "panel=0.12" "importlib_resources" --no-update-deps
- name: doit env_capture
run: |
conda activate test-environment
doit env_capture
- name: doit test_unit
run: |
conda activate test-environment
doit test_unit
- name: codecov
run: |
conda activate test-environment
codecov
8 changes: 0 additions & 8 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ requirements:
- {{ dep }}
{% endfor %}

test:
imports:
- hvplot
requires:
{% for dep in sdata['extras_require']['tests'] %}
- {{ dep }}
{% endfor %}

about:
home: {{ sdata['url'] }}
summary: {{ sdata['description'] }}
Expand Down
2 changes: 1 addition & 1 deletion doc/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Latest release | [![Github release](https://img.shields.io/github/release/holoviz/hvplot.svg?label=tag&colorB=11ccbb)](https://github.com/holoviz/hvplot/releases) [![PyPI version](https://img.shields.io/pypi/v/hvplot.svg?colorB=cc77dd)](https://pypi.python.org/pypi/hvplot) [![hvplot version](https://img.shields.io/conda/v/pyviz/hvplot.svg?colorB=4488ff&style=flat)](https://anaconda.org/pyviz/hvplot) [![conda-forge version](https://img.shields.io/conda/v/conda-forge/hvplot.svg?label=conda%7Cconda-forge&colorB=4488ff)](https://anaconda.org/conda-forge/hvplot) [![defaults version](https://img.shields.io/conda/v/anaconda/hvplot.svg?label=conda%7Cdefaults&style=flat&colorB=4488ff)](https://anaconda.org/anaconda/hvplot) |
| Python | [![Python support](https://img.shields.io/pypi/pyversions/hvplot.svg)](https://pypi.org/project/hvplot/) |

hvPlot supports Python 3.6, 3.7, 3.8, 3.9 and 3.10 on Linux, Windows, or Mac. The recommended way to install hvPlot is using the [conda](https://conda.io/en/latest/) command provided by [Anaconda](https://docs.anaconda.com/anaconda/install/index.html) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html):
hvPlot supports Python 3.8, 3.9, 3.10 and 3.11 on Linux, Windows, or Mac. The recommended way to install hvPlot is using the [conda](https://conda.io/en/latest/) command provided by [Anaconda](https://docs.anaconda.com/anaconda/install/index.html) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html):

conda install -c pyviz hvplot

Expand Down
13 changes: 10 additions & 3 deletions examples/reference/pandas/scatter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,17 @@
"metadata": {},
"outputs": [],
"source": [
"df.hvplot.scatter(x='sepal_length', y='sepal_width', by='species', \n",
" legend='top', height=400, width=400,\n",
"df.hvplot.scatter(x='sepal_length', y='sepal_width', s='petal_length', scale=5, by='species', \n",
" legend='top', height=400, width=600,\n",
" hover_cols=[\"species\", \"sepal_length\", \"sepal_width\", \"petal_width\"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can add the 's' parameter in scatter to specify the marker plot size and add the 'scale' parameter to specify what the scaling factor should be."
]
}
],
"metadata": {
Expand All @@ -63,5 +70,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
2 changes: 1 addition & 1 deletion examples/user_guide/Explorer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"source": [
"hvPlot API provides a simple and intuitive way to create plots. However when you are exploring data you don't always know in advance the best way to display it, or even what kind of plot would be best to visualize the data. You will very likely embark in an iterative process that implies choosing a kind of plot, setting various options, running some code, and repeat until you're satisfied with the output and the insights you get. The *Explorer* is a *Graphical User Interface* that allows you to easily generate customized plots, which in practice gives you the possibility to **explore** both your data and hvPlot's extensive API.\n",
"\n",
"To create an *Explorer* you pass your data to the high-level `hvplot.explorer` function which returns a [Panel](https://panel.holoviz.org/) layout that can be displayed in a notebook or served in a web application. This object displays on the right-hand side a preview of the plot you are building, and on the left-hand side the various options that you can set to customize the plot.\n",
"To create an *Explorer* you pass your data to the high-level `hvplot.explorer` function which returns a [Panel](https://panel.holoviz.org/) layout that can be displayed in a notebook or served in a web application. This object displays on the right-hand side a preview of the plot you are building, and on the left-hand side the various options that you can set to customize the plot. These options can passed to the constructor if you already have pre-defined some, for example `hvplot.explorer(data, title='Penguins', width=200)`.\n",
"\n",
"Note that for the explorer to be displayed in a notebook you need to load the hvPlot extension, which happens automatically when you execute `import hvplot.pandas`. If instead of building Bokeh plots you would rather build Matplotlib or Plotly plot, simply execute once `hvplot.extension('matplotlib')` or `hvplot.extension('matplotlib')` before displaying the explorer."
]
Expand Down
34 changes: 34 additions & 0 deletions examples/user_guide/Timeseries_Data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@
"sst.hvplot(xformatter=formatter)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Auto range\n",
"Automatic auto-ranging on the data in x or y is supported, making it easy to scale the given axes and fit the entire visible curve after a zoom or pan."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sst.hvplot(autorange=\"y\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -166,6 +183,23 @@
"source": [
"Note that xarray supports grouping and aggregation using a similar syntax. To learn more about timeseries in xarray, see the [xarray timeseries docs](https://xarray.pydata.org/en/stable/time-series.html)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Downsample time series\n",
"An option when working with large time series is to downsample the data before plotting it. This can be done with `downsample=True`, which applies the `lttb` (Largest Triangle Three Buckets) algorithm to the data."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sst.hvplot(label=\"original\") * sst.hvplot(downsample=True, label=\"downsampled\")"
]
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 21d35ff

Please sign in to comment.