From 4a526833ea6057cc3da33151e0bca6e027432898 Mon Sep 17 00:00:00 2001 From: babsey Date: Tue, 7 Aug 2018 11:44:31 +0200 Subject: [PATCH] Add the function find_data --- sumatra/projects.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sumatra/projects.py b/sumatra/projects.py index 5c730c5a..37030853 100644 --- a/sumatra/projects.py +++ b/sumatra/projects.py @@ -316,7 +316,14 @@ def find_records(self, tags=None, reverse=False, parameters=None, *args, **kwarg records = [rec for rec in records if len(rec.parameters.diff(parameters)[-1]) == 0] return records - # def find_data() here? + def find_data(self, *args, **kwargs): + records = self.find_records(*args, **kwargs) + output_data = [] + for record in records: + for output_datakey in record.output_data: + if self.data_store.contains_path(output_datakey.path): + output_data.append(os.path.join(self.data_store.root, output_datakey.path)) + return output_data def format_records(self, format='text', mode='short', tags=None, reverse=False, *args, **kwargs): if format=='text' and mode=='short' and ('parameters' not in kwargs.keys()):