Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt711 committed Aug 16, 2024
1 parent 1b2ba85 commit cbb780d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion python/cuxfilter/charts/bokeh/plots/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class InteractiveBar(param.Parameterized):
x = param.String("x", doc="x axis column name")
y = param.List(["y"], doc="y axis column names as a list")
source_df = param.ClassSelector(
class_=(cudf.DataFrame, pd.DataFrame), default=cudf.DataFrame(), doc="source dataframe"
class_=(cudf.DataFrame, pd.DataFrame),
default=cudf.DataFrame(),
doc="source dataframe",
)
box_stream = param.ClassSelector(
class_=hv.streams.SelectionXY, default=hv.streams.SelectionXY()
Expand Down
8 changes: 6 additions & 2 deletions python/cuxfilter/charts/core/core_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,19 @@ def library_specific_params(self):
def x_dtype(self):
if isinstance(self.source, ColumnDataSource):
return self.source.data[self.data_x_axis].dtype
elif isinstance(self.source, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)):
elif isinstance(
self.source, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)
):
return self.source[self.x].dtype
return None

@property
def y_dtype(self):
if isinstance(self.source, ColumnDataSource):
return self.source.data[self.data_x_axis].dtype
elif isinstance(self.source, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)):
elif isinstance(
self.source, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)
):
return self.source[self.y].dtype
return None

Expand Down
8 changes: 6 additions & 2 deletions python/cuxfilter/charts/core/non_aggregate/core_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,17 @@ def __init__(

@property
def x_dtype(self):
if isinstance(self.nodes, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)):
if isinstance(
self.nodes, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)
):
return self.nodes[self.node_x].dtype
return None

@property
def y_dtype(self):
if isinstance(self.nodes, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)):
if isinstance(
self.nodes, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)
):
return self.nodes[self.node_y].dtype
return None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def y_dtype(self):
overwriting the y_dtype property from BaseChart for stackedLines where
self.y is a list of columns
"""
if isinstance(self.source, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)):
if isinstance(
self.source, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)
):
return self.source[self.y[0]].dtype
return None

Expand Down
4 changes: 3 additions & 1 deletion python/cuxfilter/charts/panel_widgets/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class DateRangeSlider(BaseWidget):
def x_dtype(self):
if isinstance(self.source, ColumnDataSource):
return self.source.data[self.data_x_axis].dtype
elif isinstance(self.source, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)):
elif isinstance(
self.source, (cudf.DataFrame, dask_cudf.DataFrame, pd.DataFrame)
):
return self.source[self.x].dtype
return None

Expand Down

0 comments on commit cbb780d

Please sign in to comment.