Skip to content

Commit

Permalink
Merge pull request #381 from babsey/find_data
Browse files Browse the repository at this point in the history
Add the function find_data
  • Loading branch information
apdavison authored Oct 11, 2019
2 parents 360c79b + 4a52683 commit 7998ccb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sumatra/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()):
Expand Down

0 comments on commit 7998ccb

Please sign in to comment.