mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-09 06:48:12 +08:00
#78 Revert "Rename argument "filter" to "subpath""
This reverts commit fdd6cca297.
This commit is contained in:
@@ -50,8 +50,8 @@ class FileItemSource(ItemSource):
|
||||
def get_annotations_subpath(self, item) -> str:
|
||||
return self.convert_h5ad_path_to_annotation(item.descriptor)
|
||||
|
||||
def list_items(self, subpath: str = None) -> ItemTree:
|
||||
item_tree = self.scan_directory("" if subpath is None else subpath)
|
||||
def list_items(self, filter: str = None) -> ItemTree:
|
||||
item_tree = self.scan_directory("" if filter is None else filter)
|
||||
|
||||
"""def get_items(dir):
|
||||
if dir.branches:
|
||||
@@ -102,7 +102,9 @@ class FileItemSource(ItemSource):
|
||||
]
|
||||
# Exclude branches without files as leaves. Since traversal is applied pre-order,
|
||||
# branch.branches has already been processed and we don't need to check deeper nesting.
|
||||
branches = [branch for branch in branches if branch.items or branch.branches]
|
||||
branches = [
|
||||
branch for branch in branches if branch.items or branch.branches
|
||||
]
|
||||
|
||||
return ItemTree(subpath, items, branches)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class LookupResult:
|
||||
|
||||
class ItemSource(ABC):
|
||||
@abstractmethod
|
||||
def list_items(self, subpath: str = None) -> List[Item]:
|
||||
def list_items(self, filter: str = None) -> List[Item]:
|
||||
raise Exception('"list_items" unimplemented')
|
||||
|
||||
@abstractmethod
|
||||
|
||||
@@ -72,8 +72,8 @@ class S3ItemSource(ItemSource):
|
||||
def get_annotations_subpath(self, item) -> str:
|
||||
return self.convert_h5ad_key_to_annotation(item.descriptor)
|
||||
|
||||
def list_items(self, subpath: str = None) -> ItemTree:
|
||||
item_tree = self.scan_directory("" if subpath is None else subpath)
|
||||
def list_items(self, filter: str = None) -> ItemTree:
|
||||
item_tree = self.scan_directory("" if filter is None else filter)
|
||||
return item_tree
|
||||
|
||||
@property
|
||||
@@ -116,7 +116,9 @@ class S3ItemSource(ItemSource):
|
||||
branches = None
|
||||
if len(subdir_keys) > 0:
|
||||
branches = [self.scan_directory(key) for key in subdir_keys]
|
||||
branches = [branch for branch in branches if branch.items or branch.branches]
|
||||
branches = [
|
||||
branch for branch in branches if branch.items or branch.branches
|
||||
]
|
||||
|
||||
return ItemTree(directory_key, items, branches)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user