Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Jul 10, 2023
1 parent 79a8efe commit ba4c42f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
12 changes: 6 additions & 6 deletions holonote/annotate/annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ def refresh(self, clear=False):
"Method to update display state of the annotator and optionally clear stale visual state"
pass

# def set_annotation_table(self, annotation_table): # FIXME! Won't work anymore, set_connector??
# self._region = {}
# self.annotation_table = annotation_table
# self.annotation_table.register_annotator(self)
# self.annotation_table._update_index()
# self.snapshot()
def set_annotation_table(self, annotation_table): # FIXME! Won't work anymore, set_connector??
self._region = {}
self.annotation_table = annotation_table
self.annotation_table.register_annotator(self)
self.annotation_table._update_index()
self.snapshot()

# Selecting annotations

Expand Down
4 changes: 2 additions & 2 deletions holonote/annotate/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,5 +363,5 @@ def update_row(self, **updates): # updates as a dictionary OR remove posarg?
self.con.commit()

def add_schema(self, schema):
# self._schemas.append(schema)
self.column_schema |= schema
# TODO: Check if schema don't overwrite existing columns
self.column_schema = {**self.column_schema, **schema}
7 changes: 0 additions & 7 deletions holonote/annotate/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ def load(self, connector=None, fields_df=None, primary_key_name=None, fields=Non
fields_df = fields_df.set_index(primary_key_name)
self._field_df = fields_df

# FIXME: Proper solution is to only load relevant columns
self._field_df = self._field_df
self._region_df = self._region_df

self.clear_edits()
self._update_index()

Expand Down Expand Up @@ -359,8 +355,6 @@ def _mask2D(self, kdims):
)

def load_annotation_table(self, conn, fields):
# if conn.table_name not in conn.get_tables():
# return
df = conn.transforms['load'](conn.load_dataframe())
fields_df = df[fields].copy()
self.define_fields(fields_df, {ind:ind for ind in fields_df.index})
Expand Down Expand Up @@ -394,7 +388,6 @@ def load_annotation_table(self, conn, fields):
self.clear_edits()

def add_schema_to_conn(self, conn):
# if conn.table_name not in conn.get_tables():
field_dtypes = {col: str for col in conn.fields} # FIXME - generalize
all_region_types = [an.region_types for an in self._annotators.values()]
all_kdim_dtypes = [an.kdim_dtypes for an in self._annotators.values()]
Expand Down

0 comments on commit ba4c42f

Please sign in to comment.