Skip to content

Commit

Permalink
Merge pull request #314 from rapidsai/branch-21.08
Browse files Browse the repository at this point in the history
  • Loading branch information
raydouglass committed Aug 4, 2021
2 parents 2c686ad + ca8089f commit e2ceb8d
Show file tree
Hide file tree
Showing 15 changed files with 166 additions and 129 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# cuXfilter 21.08.00 (4 Aug 2021)

## 🐛 Bug Fixes

- Fix/follow up to #303 ([#304](https://github.com/rapidsai/cuxfilter/pull/304)) [@AjayThorve](https://github.com/AjayThorve)
- update pyproj version ([#302](https://github.com/rapidsai/cuxfilter/pull/302)) [@AjayThorve](https://github.com/AjayThorve)

## 🛠️ Improvements

- Fix/update bokeh version ([#303](https://github.com/rapidsai/cuxfilter/pull/303)) [@AjayThorve](https://github.com/AjayThorve)
- Fix `21.08` forward-merge conflicts ([#301](https://github.com/rapidsai/cuxfilter/pull/301)) [@ajschmidt8](https://github.com/ajschmidt8)
- Fix merge conflicts ([#290](https://github.com/rapidsai/cuxfilter/pull/290)) [@ajschmidt8](https://github.com/ajschmidt8)

# cuXfilter 21.06.00 (9 Jun 2021)

## 🛠️ Improvements
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,27 +143,27 @@ Please see the [Demo Docker Repository](https://hub.docker.com/r/rapidsai/rapids

cuxfilter can be installed with conda ([miniconda](https://conda.io/miniconda.html), or the full [Anaconda distribution](https://www.anaconda.com/download)) from the `rapidsai` channel:

For `cuxfilter version == 0.19` :
For `cuxfilter version == 21.08.18` :
```bash
# for CUDA 10.1
# for CUDA 11.0
conda install -c rapidsai -c nvidia -c numba -c conda-forge \
cuxfilter=0.19 python=3.7 cudatoolkit=10.1
cuxfilter=21.08 python=3.7 cudatoolkit=11.0

# or, for CUDA 10.2
# or, for CUDA 11.2
conda install -c rapidsai -c nvidia -c numba -c conda-forge \
cuxfilter=0.19 python=3.7 cudatoolkit=10.2
cuxfilter=21.08 python=3.7 cudatoolkit=11.2

```

For the nightly version of `cuxfilter` :
```bash
# for CUDA 10.1
# for CUDA 11.0
conda install -c rapidsai-nightly -c nvidia -c numba -c conda-forge \
cuxfilter python=3.7 cudatoolkit=10.1
cuxfilter python=3.7 cudatoolkit=11.0

# or, for CUDA 10.2
# or, for CUDA 11.2
conda install -c rapidsai-nightly -c nvidia -c numba -c conda-forge \
cuxfilter python=3.7 cudatoolkit=10.2
cuxfilter python=3.7 cudatoolkit=11.2
```

Note: cuxfilter is supported only on Linux, and with Python versions 3.7 and later.
Expand Down
4 changes: 2 additions & 2 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ gpuci_conda_retry install -y \
"cuspatial=$MINOR_VERSION.*" \
"dask-cudf=$MINOR_VERSION.*" "dask-cuda=$MINOR_VERSION.*" \
"numba>=0.51.2" \
"bokeh<=2.2.3" \
"bokeh>=2.3.2,<2.4" \
"rapids-build-env=$MINOR_VERSION.*" \
"rapids-notebook-env=$MINOR_VERSION.*"

# https://docs.rapids.ai/maintainers/depmgmt/
# conda remove -f rapids-build-env rapids-notebook-env
# conda remove --force rapids-build-env rapids-notebook-env
# conda install "your-pkg=1.0.0"

gpuci_logger "Check versions"
Expand Down
12 changes: 6 additions & 6 deletions conda/environments/cuxfilter_dev_cuda10.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ channels:
- anaconda
dependencies:
- cupy>7.1.0,<10.0.0a0
- cuspatial=21.06
- cuspatial=21.08
- python>=3.6,<3.8
- cudf=21.06
- cudf=21.08
- dask>=2.12.0
- distributed>=2.12.0
- dask-cuda=21.06
- dask-cudf=21.06
- dask-cuda=21.08
- dask-cudf=21.08
- datashader>=0.11.1
- numba>=0.51.2
- geopandas >=0.9.0,<0.10.0a0
- pyproj>=2.4, <=3.0.1
- pyproj>=2.4, <=3.1
- libwebp
- pandoc=<2.0.0
- bokeh>=2.1.1,<=2.2.3
- bokeh>=2.3.2,<2.4
- panel>=0.10.3
- cudatoolkit=10.1
- nodejs
Expand Down
12 changes: 6 additions & 6 deletions conda/environments/cuxfilter_dev_cuda10.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ channels:
- anaconda
dependencies:
- cupy>7.1.0,<10.0.0a0
- cuspatial=21.06
- cuspatial=21.08
- python>=3.6,<3.8
- cudf=21.06
- cudf=21.08
- dask>=2.12.0
- distributed>=2.12.0
- dask-cuda=21.06
- dask-cudf=21.06
- dask-cuda=21.08
- dask-cudf=21.08
- datashader>=0.11.1
- numba>=0.51.2
- geopandas >=0.9.0,<0.10.0a0
- pyproj>=2.4, <=3.0.1
- pyproj>=2.4, <=3.1
- libwebp
- pandoc=<2.0.0
- bokeh>=2.1.1,<=2.2.3
- bokeh>=2.3.2,<2.4
- panel>=0.10.3
- cudatoolkit=10.2
- nodejs
Expand Down
12 changes: 6 additions & 6 deletions conda/environments/cuxfilter_dev_cuda11.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ channels:
- anaconda
dependencies:
- cupy>7.1.0,<10.0.0a0
- cuspatial=21.06
- cuspatial=21.08
- python>=3.6,<3.8
- cudf=21.06
- cudf=21.08
- dask>=2.12.0
- distributed>=2.12.0
- dask-cuda=21.06
- dask-cudf=21.06
- dask-cuda=21.08
- dask-cudf=21.08
- datashader>=0.11.1
- numba>=0.51.2
- geopandas >=0.9.0,<0.10.0a0
- pyproj>=2.4, <=3.0.1
- pyproj>=2.4, <=3.1
- libwebp
- pandoc=<2.0.0
- bokeh>=2.1.1,<=2.2.3
- bokeh>=2.3.2,<2.4
- panel>=0.10.3
- cudatoolkit=11.0
- nodejs
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cuxfilter/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ requirements:
- numba >=0.51.2
- cupy >=7.8.0,<10.0.0a0
- panel >=0.10.3
- bokeh >=2.1.1,<=2.2.3
- pyproj >=2.4, <=3.0.1
- bokeh >=2.3.2,<2.4
- pyproj >=2.4, <=3.1
- geopandas >=0.9.0,<0.10.0a0
- nodejs >=12,<15
- libwebp
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
# built documents.
#
# The short X.Y version.
version = '21.06'
version = '21.08'
# The full version, including alpha/beta/rc tags
release = '21.06.01'
release = '21.08.00'

nbsphinx_allow_errors = True
# -- General configuration ---------------------------------------------------
Expand Down
67 changes: 50 additions & 17 deletions python/cuxfilter/charts/core/aggregate/core_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class BaseAggregateChart(BaseChart):
datatile_active_color = DATATILE_ACTIVE_COLOR
stride = None
data_points = None
_x_dtype = float

@property
def datatile_loaded_state(self):
Expand All @@ -48,10 +49,32 @@ def datatile_loaded_state(self, state: bool):
else:
self.filter_widget.bar_color = DATATILE_INACTIVE_COLOR

@property
def x_dtype(self):
"""
override core_chart x_dtype and make it constant, as panel 0.11 seems
to update the datetime x_axis type to float during runtime
"""
return self._x_dtype

@x_dtype.setter
def x_dtype(self, value):
self._x_dtype = value

@property
def custom_binning(self):
return self._stride is not None or self._data_points is not None

def _transformed_source_data(self, property):
"""
this fixes a bug introduced with panel 0.11, where bokeh CDS
x-axis datetime is converted to float, and the only way to
convert it back to datetime is using datetime64[ms]
"""
if self.x_dtype in CUDF_DATETIME_TYPES:
return self.source.data[property].astype("datetime64[ms]")
return self.source.data[property]

def __init__(
self,
x,
Expand Down Expand Up @@ -110,15 +133,14 @@ def __init__(
self.y_axis_tick_formatter = y_axis_tick_formatter
self.library_specific_params = library_specific_params

def _compute_array_all_bins(
self, source_x, source_y, update_data_x, update_data_y
):
def _compute_array_all_bins(self, source_x, update_data_x, update_data_y):
"""
source_x: current_source_x, np.array()
source_y: current_source_y, np.array()
update_data_x: updated_data_x, np.array()
update_data_y: updated_data_x, np.array()
"""
if self.x_dtype in CUDF_DATETIME_TYPES:
source_x = source_x.astype("datetime64[ms]")
result_array = np.zeros(shape=source_x.shape)
indices = [np.where(x_ == source_x)[0][0] for x_ in update_data_x]
np.put(result_array, indices, update_data_y)
Expand Down Expand Up @@ -154,7 +176,7 @@ def initiate_chart(self, dashboard_cls):
Ouput:
"""
self.source = dashboard_cls._cuxfilter_df.data
self.x_dtype = dashboard_cls._cuxfilter_df.data[self.x].dtype
# reset data_point to input _data_points
self.data_points = self._data_points
# reset stride to input _stride
Expand Down Expand Up @@ -248,19 +270,18 @@ def calculate_source(self, data, patch_update=False):
}

if patch_update and len(dict_temp["X"]) < len(
self.source.data[self.data_x_axis]
self._transformed_source_data(self.data_x_axis)
):
# if not all X axis bins are provided, filling bins not updated
# with zeros
y_axis_data = self._compute_array_all_bins(
self.source.data[self.data_x_axis],
self.source.data[self.data_y_axis],
self._transformed_source_data(self.data_x_axis),
dict_temp["X"],
dict_temp["Y"],
)

dict_temp = {
"X": self.source.data[self.data_x_axis],
"X": self._transformed_source_data(self.data_x_axis),
"Y": y_axis_data,
}

Expand Down Expand Up @@ -393,10 +414,13 @@ def query_chart_by_range(self, active_chart, query_tuple, datatile):
round((max_val - active_chart.min_value) / active_chart.stride)
)
if self.custom_binning:
datatile_indices = self.source.data[self.data_x_axis]
datatile_indices = self._transformed_source_data(self.data_x_axis)
else:
datatile_indices = (
(self.source.data[self.data_x_axis] - self.min_value)
(
self._transformed_source_data(self.data_x_axis)
- self.min_value
)
/ self.stride
).astype(int)

Expand Down Expand Up @@ -473,10 +497,13 @@ def query_chart_by_indices_for_mean(
Ouput:
"""
if self.custom_binning:
datatile_indices = self.source.data[self.data_x_axis]
datatile_indices = self._transformed_source_data(self.data_x_axis)
else:
datatile_indices = (
(self.source.data[self.data_x_axis] - self.min_value)
(
self._transformed_source_data(self.data_x_axis)
- self.min_value
)
/ self.stride
).astype(int)
if len(new_indices) == 0 or new_indices == [""]:
Expand Down Expand Up @@ -525,10 +552,13 @@ def query_chart_by_indices_for_count(
Ouput:
"""
if self.custom_binning:
datatile_indices = self.source.data[self.data_x_axis]
datatile_indices = self._transformed_source_data(self.data_x_axis)
else:
datatile_indices = (
(self.source.data[self.data_x_axis] - self.min_value)
(
self._transformed_source_data(self.data_x_axis)
- self.min_value
)
/ self.stride
).astype(int)
if len(new_indices) == 0 or new_indices == [""]:
Expand Down Expand Up @@ -577,10 +607,13 @@ def query_chart_by_indices_for_minmax(
Ouput:
"""
if self.custom_binning:
datatile_indices = self.source.data[self.data_x_axis]
datatile_indices = self._transformed_source_data(self.data_x_axis)
else:
datatile_indices = (
(self.source.data[self.data_x_axis] - self.min_value)
(
self._transformed_source_data(self.data_x_axis)
- self.min_value
)
/ self.stride
).astype(int)

Expand Down
5 changes: 5 additions & 0 deletions python/cuxfilter/charts/core/core_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def stride(self, value):
self.stride_type = type(value)
self._stride = value

@property
def x_dtype(self):
# default x_dtype
return float

def _xaxis_np_dt64_transform(self, dates):
"""
Description: convert to datetime64 if self.x_dtype is of type datetime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from bokeh.core.properties import Image, Bool, String
from bokeh.core.properties import Image, Bool, String, Nullable
from bokeh.models import Tool
from bokeh.util.compiler import TypeScript

Expand All @@ -13,7 +13,7 @@
super.connect_signals()
this.connect(this.model.properties.active.change, () => {
this.model._active = this.model.properties.active.spec.value
this.model._active = this.model.active
})
}
}
Expand Down Expand Up @@ -53,6 +53,6 @@

class CustomInspectTool(Tool):
__implementation__ = TypeScript(TS_CODE)
_active = Bool
_active = Nullable(Bool)
icon = Image()
tool_name = String
tool_name = String()
2 changes: 0 additions & 2 deletions python/cuxfilter/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,6 @@ def _calc_data_tiles(self, cumsum=True):
"""
Calculate data tiles for all aggregate type charts.
"""
# query_str = self._generate_query_str(self._active_view)

# NO DATATILES for scatter types, as they are essentially all
# points in the dataset
query = self._generate_query_str(ignore_chart=self._active_view)
Expand Down
Loading

0 comments on commit e2ceb8d

Please sign in to comment.