diff --git a/conda/environments/all_cuda-129_arch-aarch64.yaml b/conda/environments/all_cuda-129_arch-aarch64.yaml index 1ec9ef9c..97d09d1e 100644 --- a/conda/environments/all_cuda-129_arch-aarch64.yaml +++ b/conda/environments/all_cuda-129_arch-aarch64.yaml @@ -5,7 +5,7 @@ channels: - rapidsai-nightly - conda-forge dependencies: -- bokeh>=3.1,<=3.6.3 +- bokeh>=3.1 - bokeh_sampledata - cuda-version=12.9 - cudf==25.12.*,>=0.0.0a0 diff --git a/conda/environments/all_cuda-129_arch-x86_64.yaml b/conda/environments/all_cuda-129_arch-x86_64.yaml index 8743f297..1db57c29 100644 --- a/conda/environments/all_cuda-129_arch-x86_64.yaml +++ b/conda/environments/all_cuda-129_arch-x86_64.yaml @@ -5,7 +5,7 @@ channels: - rapidsai-nightly - conda-forge dependencies: -- bokeh>=3.1,<=3.6.3 +- bokeh>=3.1 - bokeh_sampledata - cuda-version=12.9 - cudf==25.12.*,>=0.0.0a0 diff --git a/conda/environments/all_cuda-130_arch-aarch64.yaml b/conda/environments/all_cuda-130_arch-aarch64.yaml index 82ba3f11..b52f4d0a 100644 --- a/conda/environments/all_cuda-130_arch-aarch64.yaml +++ b/conda/environments/all_cuda-130_arch-aarch64.yaml @@ -5,7 +5,7 @@ channels: - rapidsai-nightly - conda-forge dependencies: -- bokeh>=3.1,<=3.6.3 +- bokeh>=3.1 - bokeh_sampledata - cuda-version=13.0 - cudf==25.12.*,>=0.0.0a0 diff --git a/conda/environments/all_cuda-130_arch-x86_64.yaml b/conda/environments/all_cuda-130_arch-x86_64.yaml index a8df56a9..1ee72636 100644 --- a/conda/environments/all_cuda-130_arch-x86_64.yaml +++ b/conda/environments/all_cuda-130_arch-x86_64.yaml @@ -5,7 +5,7 @@ channels: - rapidsai-nightly - conda-forge dependencies: -- bokeh>=3.1,<=3.6.3 +- bokeh>=3.1 - bokeh_sampledata - cuda-version=13.0 - cudf==25.12.*,>=0.0.0a0 diff --git a/dependencies.yaml b/dependencies.yaml index 25615f1d..569c76ab 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -133,7 +133,7 @@ dependencies: common: - output_types: [conda, requirements] packages: - - &bokeh bokeh>=3.1,<=3.6.3 + - &bokeh bokeh>=3.1 - &bokeh_sampledata bokeh_sampledata - &holoviews holoviews>=1.16.0,<1.21.0a0 - ipykernel @@ -194,7 +194,7 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - - bokeh>=3.1,<=3.6.3 + - bokeh>=3.1 - datashader>=0.15 - geopandas>=0.11.0 - shapely<2.1.0 diff --git a/python/cuxfilter/assets/cudf_utils.py b/python/cuxfilter/assets/cudf_utils.py index 60be904f..8ea91481 100644 --- a/python/cuxfilter/assets/cudf_utils.py +++ b/python/cuxfilter/assets/cudf_utils.py @@ -1,12 +1,13 @@ # SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -import dask_cudf import dask.dataframe as dd -from ..charts.constants import CUDF_DATETIME_TYPES +import dask_cudf def get_min_max(df, col_name): + from cuxfilter.charts.constants import CUDF_DATETIME_TYPES + min, max = df[col_name].min(), df[col_name].max() if isinstance(df, dask_cudf.DataFrame): if df[col_name].dtype in CUDF_DATETIME_TYPES: diff --git a/python/cuxfilter/charts/bokeh/bokeh.py b/python/cuxfilter/charts/bokeh/bokeh.py index c780c339..62bc4112 100644 --- a/python/cuxfilter/charts/bokeh/bokeh.py +++ b/python/cuxfilter/charts/bokeh/bokeh.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 from argparse import ArgumentError + from .plots import Bar, Histogram @@ -19,48 +20,44 @@ def bar( **library_specific_params, ): """ + Create a bar chart or histogram using Bokeh backend. + Parameters ---------- - - x: str + x : str x-axis column name from the gpu dataframe - y: str, default None + y : str y-axis column name from the gpu dataframe - data_points: int, default None + data_points : int when None, it means no custom number of bins are provided and data_points will default to df[self.x].nunique() - - add_interaction: {True, False}, default True - - aggregate_fn: {'count', 'mean'}, default 'count' - - step_size: int, default None - - step_size_type: {int, float}, default int - - title: str, - + add_interaction : {True, False} + whether to add selection interaction to the chart + aggregate_fn : {'count', 'mean'} + aggregation function to apply when y is provided + step_size : int + step size for binning data + step_size_type : {int, float} + type of step size for binning + title : str chart title - - autoscaling: bool, - - set whether chart scale is updated automatically for - y_axis when data updates - - unselected_alpha: float, default 0.1 - - **library_specific_params: + autoscaling : bool + set whether chart scale is updated automatically for y_axis when data + updates + unselected_alpha : float + alpha value for unselected data points + **library_specific_params additional library specific keyword arguments to be passed to the function, a list of all the supported arguments can be found by - running - ```python + running: + >>> import holoviews as hv >>> hv.help(hv.Bars) - ```` Returns ------- - A bokeh chart object of type vbar + Bar or Histogram + A bokeh chart object of type vbar (Bar) or histogram (Histogram) """ if y is not None: diff --git a/python/cuxfilter/charts/bokeh/plots/histogram.py b/python/cuxfilter/charts/bokeh/plots/histogram.py index e1a6d08b..47c9067e 100644 --- a/python/cuxfilter/charts/bokeh/plots/histogram.py +++ b/python/cuxfilter/charts/bokeh/plots/histogram.py @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 import holoviews as hv +import panel as pn import param -from cuxfilter.charts.core.aggregate import BaseAggregateChart + from cuxfilter.assets.numba_kernels import calc_value_counts -import panel as pn +from cuxfilter.charts.core.aggregate import BaseAggregateChart class InteractiveHistogram(param.Parameterized): @@ -88,14 +89,7 @@ def view(self): class Histogram(BaseAggregateChart): - """ - Description: - """ - def generate_chart(self, **kwargs): - """ - returns a histogram chart - """ self.chart = InteractiveHistogram( x=self.x, source_df=self.calculate_source(), @@ -106,14 +100,17 @@ def generate_chart(self, **kwargs): def calculate_source(self, data=None): """ - Description: - Calculate the binned counts for the histogram for the x column - ------------------------------------------- - Input: - data = cudf.DataFrame - ------------------------------------------- - Output: - cudf.DataFrame + Calculate the binned counts for the histogram for the x column. + + Parameters + ---------- + data : cudf.DataFrame, optional + Input dataframe. If None, uses self.source. + + Returns + ------- + cudf.DataFrame + DataFrame with binned counts for the x column. """ data = self.source if data is None else data return calc_value_counts( @@ -125,7 +122,7 @@ def calculate_source(self, data=None): def reload_chart(self, data): """ - reload chart with new data + Reload chart with new data """ self.chart.update_data(self.calculate_source(data)) @@ -138,7 +135,7 @@ def view(self, width=800, height=400): def apply_theme(self, theme): """ - apply thematic changes to the chart based on the theme + Apply thematic changes to the chart based on the theme """ if "fill_color" not in self.library_specific_params: self.library_specific_params["fill_color"] = theme.chart_color diff --git a/python/cuxfilter/charts/datashader/custom_extensions/graph_inspect_widget.py b/python/cuxfilter/charts/datashader/custom_extensions/graph_inspect_widget.py index 320374fb..dd54a9c5 100644 --- a/python/cuxfilter/charts/datashader/custom_extensions/graph_inspect_widget.py +++ b/python/cuxfilter/charts/datashader/custom_extensions/graph_inspect_widget.py @@ -45,8 +45,6 @@ this.define(({Boolean}) => ({ _active: [ Boolean, true ] })) - - this.register_alias("customInspect", () => new CustomInspectTool()) } } diff --git a/python/cuxfilter/dashboard.py b/python/cuxfilter/dashboard.py index b565c99e..909945be 100644 --- a/python/cuxfilter/dashboard.py +++ b/python/cuxfilter/dashboard.py @@ -1,22 +1,23 @@ # SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +import os +import urllib +import warnings +from collections import Counter from typing import Dict, Union + import bokeh.embed.util as u import cudf import dask_cudf import panel as pn -from panel.io.server import get_server from bokeh.embed import server_document -import os -import urllib -import warnings -from collections import Counter +from panel.io.server import get_server +from cuxfilter.assets import cudf_utils, get_open_port from cuxfilter.charts.core import BaseChart, BaseWidget, ViewDataFrame -from cuxfilter.layouts import single_feature from cuxfilter.charts.panel_widgets import data_size_indicator -from cuxfilter.assets import get_open_port, cudf_utils +from cuxfilter.layouts import single_feature from cuxfilter.themes import default DEFAULT_NOTEBOOK_URL = "http://localhost:8888" @@ -69,6 +70,18 @@ def _check_if_duplicates(charts): class DashBoard: """ A cuxfilter GPU DashBoard object. + + Methods + ------- + .. autosummary:: + :toctree: generated/ + + add_charts + app + export + show + stop + Examples -------- @@ -493,10 +506,8 @@ def show( ---------- notebook_url: str, optional, default localhost:8888 - - URL where you want to run the dashboard as a web-app, - including the port number. - - - Can use localhost instead of ip if running locally. + URL where you want to run the dashboard as a web-app, including the + port number. Can use localhost instead of ip if running locally. port: int, optional Has to be an open port diff --git a/python/cuxfilter/dataframe.py b/python/cuxfilter/dataframe.py index cfafe65f..3dd755ce 100644 --- a/python/cuxfilter/dataframe.py +++ b/python/cuxfilter/dataframe.py @@ -1,15 +1,16 @@ # SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +from typing import Type + import cudf import dask_cudf import pyarrow as pa -from typing import Type +from cuxfilter.assets import notebook_assets from cuxfilter.dashboard import DashBoard from cuxfilter.layouts import single_feature from cuxfilter.themes import default -from cuxfilter.assets import notebook_assets def read_arrow(source): @@ -22,7 +23,17 @@ def read_arrow(source): # class DataFrame: class DataFrame: """ - A cuxfilter GPU DataFrame object + A cuxfilter GPU DataFrame object. + + Methods + ------- + .. autosummary:: + :toctree: generated/ + + from_arrow + from_dataframe + load_graph + dashboard """ data: Type[cudf.DataFrame] = None diff --git a/python/pyproject.toml b/python/pyproject.toml index 23483a26..741cf8d7 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -19,7 +19,7 @@ authors = [ license = { text = "Apache-2.0" } requires-python = ">=3.10" dependencies = [ - "bokeh>=3.1,<=3.6.3", + "bokeh>=3.1", "cudf==25.12.*,>=0.0.0a0", "cupy-cuda13x>=13.6.0", "dask-cudf==25.12.*,>=0.0.0a0",