Skip to content

Commit

Permalink
Standardize storage.search_for
Browse files Browse the repository at this point in the history
  • Loading branch information
frthjf committed Jun 30, 2024
1 parent ad20c11 commit ea7bc9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/examples/globus-storage/globus.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ 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(),
show_hidden=True,
)
found = []
for item in response:
if experiment.hash in item["name"]:
if interface.hash in item["name"]:
found.append(item["name"])

return found
3 changes: 3 additions & 0 deletions src/machinable/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ea7bc9d

Please sign in to comment.