Skip to content

Commit

Permalink
Remove code no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Sep 27, 2023
1 parent 7550472 commit 24cf1a5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 66 deletions.
53 changes: 0 additions & 53 deletions holonote/annotate/annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,22 +680,6 @@ def overlay(self,
layers.append(self.region_editor().opts(*region_style))
return hv.Overlay(layers).collate()

# def _point_indicators(self, filtered_df, dimensionality, invert_axes=False):
# if dimensionality == '1d':
# return Indicator.points_1d(filtered_df, None, invert_axes=invert_axes)
# else:
# return Indicator.points_2d(filtered_df, None, invert_axes=invert_axes)

# def _range_indicators(self, filtered_df, dimensionality, invert_axes=False):
# # fields_mask = self.annotator.annotation_table._field_df.index.isin(filtered_df['_id'])
# # field_df = self.annotator.annotation_table._field_df[fields_mask] # Currently assuming 1-to-1
# if dimensionality == '1d':
# vectorized = Indicator.ranges_1d(filtered_df, self.annotator.annotation_table._field_df, invert_axes=invert_axes)
# else:
# vectorized = Indicator.ranges_2d(filtered_df, self.annotator.annotation_table._field_df, invert_axes=invert_axes)
# return vectorized.opts(tools=[self._build_hover_tool()])


@property
def static_indicators(self):
data = self.annotator.get_dataframe(self.kdims)
Expand All @@ -719,43 +703,6 @@ def static_indicators(self):

return indicator

# if len(self.kdims) == 1:
# dim_mask = self.annotator.annotation_table._mask1D(self.kdims)
# points_df = self.annotator.annotation_table._filter(dim_mask, "point")
# ranges_df = self.annotator.annotation_table._filter(dim_mask, "range")
# if len(points_df) == 0:
# return self._range_indicators(ranges_df, '1d', invert_axes=invert_axes)
# elif len(ranges_df) == 0:
# return self._point_indicators(points_df, '1d', invert_axes=invert_axes)
# else:
# raise NotImplementedError # FIXME: Both in overlay

# if len(self.kdims) > 1:

# # FIXME: SHH, Converting new region_df format into old format
# df_dim = self.annotator.annotation_table._collapse_region_df(columns=self.kdims)
# if df_dim.empty:
# ranges_df = pd.DataFrame({"_id": [], "value": []})
# else:
# order = [
# f"start[{self.kdims[0]}]",
# f"end[{self.kdims[0]}]",
# f"start[{self.kdims[1]}]",
# f"end[{self.kdims[1]}]"
# ]
# df2 = df_dim.dropna(axis=0)
# value = tuple(df2[order].values)

# # Convert to accepted format for further processing
# ranges_df = pd.DataFrame({"_id": df2.index, "value": value})
# points_df = [] # self.annotator.annotation_table._filter(dim_mask, "Point")
# if len(points_df) == 0:
# return self._range_indicators(ranges_df, '2d', invert_axes=invert_axes)
# elif len(ranges_df) == 0:
# return self._point_indicators(points_df, '2d', invert_axes=invert_axes)
# else:
# raise NotImplementedError # FIXME: Both in overlay

def selected_dim_expr(self, selected_value, non_selected_value):
self._selected_values.append(selected_value)
self._selected_options.append({i:selected_value for i in self.annotator.selected_indices})
Expand Down
13 changes: 0 additions & 13 deletions holonote/annotate/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,19 +389,6 @@ def get_dataframe(self, kdims: list[str] | None=None, spec: SpecDict | None=None
df = df.reindex(field_df.index)
return df

# def _filter(self, dim_mask, region_type):
# region_mask = self._region_df["region"] == region_type
# return self._region_df[region_mask & dim_mask]

# def _mask1D(self, kdims):
# return self._region_df["dim"] == str(kdims[0])

# def _mask2D(self, kdims):
# dim1_name, dim2_name = str(kdims[0]), str(kdims[1])
# return np.logical_and(
# self._region_df["dim1"] == dim1_name, self._region_df["dim2"] == dim2_name
# )

def load_annotation_table(self, conn: Connector, fields: list[str], spec: SpecDict) -> None:
"""Load the AnnotationTable region and field DataFrame from a connector.
Expand Down

0 comments on commit 24cf1a5

Please sign in to comment.