From fdd6cca29704a13ff8c9cd17e98971c999e0a91d Mon Sep 17 00:00:00 2001 From: Andreas Eisenbarth Date: Wed, 12 Oct 2022 13:40:39 +0200 Subject: [PATCH] Rename argument "filter" to "subpath" --- cellxgene_gateway/filecrawl.py | 8 ++++---- cellxgene_gateway/items/file/fileitem_source.py | 4 ++-- cellxgene_gateway/items/item_source.py | 2 +- cellxgene_gateway/items/s3/s3item_source.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cellxgene_gateway/filecrawl.py b/cellxgene_gateway/filecrawl.py index f812091..2ae9487 100644 --- a/cellxgene_gateway/filecrawl.py +++ b/cellxgene_gateway/filecrawl.py @@ -60,8 +60,8 @@ def render_item_tree(item_tree, item_source): return html -def render_item_source(item_source, filter=None): - item_tree = item_source.list_items(filter) - filterpart = "" if filter is None else ":" + filter - heading = f"
{item_source.name}{filterpart}
" +def render_item_source(item_source, path=None): + item_tree = item_source.list_items(path) + path_part = "" if path is None else ":" + path + heading = f"
{item_source.name}{path_part}
" return heading + render_item_tree(item_tree, item_source) diff --git a/cellxgene_gateway/items/file/fileitem_source.py b/cellxgene_gateway/items/file/fileitem_source.py index 4ade4b9..22f6ce4 100644 --- a/cellxgene_gateway/items/file/fileitem_source.py +++ b/cellxgene_gateway/items/file/fileitem_source.py @@ -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, filter: str = None) -> ItemTree: - item_tree = self.scan_directory("" if filter is None else filter) + def list_items(self, subpath: str = None) -> ItemTree: + item_tree = self.scan_directory("" if subpath is None else subpath) """def get_items(dir): if dir.branches: diff --git a/cellxgene_gateway/items/item_source.py b/cellxgene_gateway/items/item_source.py index eb778ff..fbc26cc 100644 --- a/cellxgene_gateway/items/item_source.py +++ b/cellxgene_gateway/items/item_source.py @@ -21,7 +21,7 @@ class LookupResult: class ItemSource(ABC): @abstractmethod - def list_items(self, filter: str = None) -> List[Item]: + def list_items(self, subpath: str = None) -> List[Item]: raise Exception('"list_items" unimplemented') @abstractmethod diff --git a/cellxgene_gateway/items/s3/s3item_source.py b/cellxgene_gateway/items/s3/s3item_source.py index 130df19..a98fc16 100644 --- a/cellxgene_gateway/items/s3/s3item_source.py +++ b/cellxgene_gateway/items/s3/s3item_source.py @@ -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, filter: str = None) -> ItemTree: - item_tree = self.scan_directory("" if filter is None else filter) + def list_items(self, subpath: str = None) -> ItemTree: + item_tree = self.scan_directory("" if subpath is None else subpath) return item_tree @property