From ea7bc9d5dd4a587afd8daca21da1fcebc7146779 Mon Sep 17 00:00:00 2001 From: Frithjof Gressmann Date: Sat, 29 Jun 2024 21:56:51 -0500 Subject: [PATCH] Standardize storage.search_for --- docs/examples/globus-storage/globus.py | 4 ++-- src/machinable/storage.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/examples/globus-storage/globus.py b/docs/examples/globus-storage/globus.py index 1b9315c5..efe34e7d 100644 --- a/docs/examples/globus-storage/globus.py +++ b/docs/examples/globus-storage/globus.py @@ -212,7 +212,7 @@ def local_path(self, *append): def remote_path(self, *append): return os.path.join(self.config.remote_endpoint_directory, *append) - def search_for(self, experiment) -> List[str]: + def search_for(self, interface) -> List[str]: response = self.transfer_client.operation_ls( self.config.remote_endpoint_id, path=self.remote_path(), @@ -220,7 +220,7 @@ def search_for(self, experiment) -> List[str]: ) found = [] for item in response: - if experiment.hash in item["name"]: + if interface.hash in item["name"]: found.append(item["name"]) return found diff --git a/src/machinable/storage.py b/src/machinable/storage.py index 8390272f..c534b40a 100644 --- a/src/machinable/storage.py +++ b/src/machinable/storage.py @@ -124,6 +124,9 @@ def retrieve(self, uuid: str, local_directory: str) -> bool: ... return False + def search_for(self, interface: "Interface") -> List[str]: + raise NotImplementedError() + def fetch(uuid: str, directory: str) -> bool: available = False