Skip to content

Commit 7f93ccf

Browse files
committed
CLN: removed unused AbstractPathAdapter
1 parent 79fae50 commit 7f93ccf

2 files changed

Lines changed: 3 additions & 22 deletions

File tree

‎larray_editor/arrayadapter.py‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -958,25 +958,6 @@ def update_finite_min_max_values(self, finite_values: np.ndarray,
958958
return vmin_slice, vmax_slice
959959

960960

961-
# this is NOT (and should not inherit from) AbstractAdapter
962-
# instances of this class "adapt" a Path object with specific suffixes to a type understood/handled by a real
963-
# (arrayish) adapter (ie a descendant from AbstractAdapter)
964-
class AbstractPathAdapter:
965-
# Path adapters MAY override this method, but should probably override
966-
# open() instead
967-
@classmethod
968-
def get_file_handler_and_adapter_creator(cls, fpath):
969-
file_handler_object = cls.open(fpath)
970-
return file_handler_object, get_adapter_creator(file_handler_object)
971-
972-
# Path adapters MAY override these methods
973-
@classmethod
974-
def open(cls, fpath):
975-
"""The result of this method will be stored in the .data
976-
attribute and passed as argument to the adapter class"""
977-
raise NotImplementedError()
978-
979-
980961
class DirectoryPathAdapter(AbstractColumnarAdapter):
981962
_COL_NAMES = ['Name', 'Type', 'Date Modified', 'Size']
982963
_SORT_FUNCS = {

‎larray_editor/arraywidget.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@
7878
LinearGradient, logger, cached_property, data_frac_digits,
7979
num_int_digits)
8080
from larray_editor.arrayadapter import (get_adapter, get_adapter_creator,
81-
AbstractAdapter, AbstractPathAdapter,
82-
MAX_FILTER_OPTIONS)
81+
AbstractAdapter, MAX_FILTER_OPTIONS)
8382
from larray_editor.arraymodel import (HLabelsArrayModel, VLabelsArrayModel, LabelsArrayModel,
8483
AxesArrayModel, DataArrayModel)
8584
from larray_editor.combo import FilterComboBox, CombinedSortFilterMenu
@@ -135,7 +134,7 @@ def reset_to_defaults(self):
135134
data_adapter = self.array_widget.data_adapter
136135
if data_adapter is None:
137136
return
138-
assert isinstance(data_adapter, (AbstractAdapter, AbstractPathAdapter)), \
137+
assert isinstance(data_adapter, AbstractAdapter), \
139138
f"unexpected data_adapter type: {type(data_adapter)}"
140139
filter_names = data_adapter.get_filter_names()
141140
# size > 0 to avoid arrays with length 0 axes and len(axes) > 0 to avoid scalars (scalar.size == 1)
@@ -1231,6 +1230,7 @@ def activate_cell(self, index: QModelIndex):
12311230
return True
12321231
return False
12331232

1233+
12341234
class ScrollBar(QScrollBar):
12351235
"""
12361236
A specialised scrollbar.

0 commit comments

Comments
 (0)