Skip to content

Commit e5a149d

Browse files
committed
fix: update DataUIManager to handle file number display logic correctly
1 parent 012b2f1 commit e5a149d

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

pydelmod/dvue/dataui.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,11 @@ def select_data_catalog(self, index=[]):
384384
return
385385
idcol = self._station_id_column
386386
table = self.display_table
387+
387388
if idcol and idcol in self._dfcat.columns:
388389
# get station ids from the _map_features being displayed
389390
stations_map_selected = (
390-
self._map_features.dframe().iloc[index][idcol].unique()
391+
self._map_features.data.iloc[index][idcol].unique()
391392
)
392393
# get the stations selected in table already
393394
stations_table_selected = table.selected_dataframe[idcol].unique()
@@ -413,7 +414,7 @@ def select_data_catalog(self, index=[]):
413414
)
414415
selected_indices = i_selected_indices + list(keep_selected_from_map)
415416
else:
416-
dfs = self._map_features.dframe().iloc[index]
417+
dfs = self._map_features.data.iloc[index]
417418
merged_indices = (
418419
self._dfcat.reset_index().merge(dfs)["index"].to_list()
419420
) # index matching

pydelmod/dvue/tsdataui.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ def __init__(
129129
self.filename_column
130130
].apply(lambda x: unique_files.tolist().index(x))
131131
self.display_fileno = True
132+
else:
133+
self.file_number_column_name = None
134+
self.display_fileno = False
132135
self.time_range = self.get_time_range(self.get_data_catalog())
133136
super().__init__(**params)
134137
table_columns = list(self.get_table_columns())
@@ -311,10 +314,11 @@ def adjust_column_width(self, column_width_map, max_width=100):
311314

312315
def get_table_column_width_map(self):
313316
column_width_map = self._get_table_column_width_map()
314-
column_width_map[self.filename_column] = "10%"
315-
if self.display_fileno:
316-
column_width_map[self.file_number_column_name] = "5%"
317-
self.adjust_column_width(column_width_map)
317+
if self.filename_column:
318+
column_width_map[self.filename_column] = "10%"
319+
if self.display_fileno:
320+
column_width_map[self.file_number_column_name] = "5%"
321+
self.adjust_column_width(column_width_map)
318322
return column_width_map
319323

320324
def get_color_style_mapping(self, unique_values):

0 commit comments

Comments
 (0)