Skip to content

Commit

Permalink
ENH sort subject list and improve repr of transforms (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdoc authored Apr 4, 2024
1 parent 66d6639 commit 59a6f5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cortex/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def __getitem__(self, name):
raise AttributeError

def __repr__(self):
return "Transforms: [{xfms}]".format(xfms=",".join(self.xfms))
xfms = "\n".join(sorted(self.xfms))
return f"Available transforms for {self.subject}:\n{xfms}"

class XfmSet(object):
def __init__(self, subj, name, filestore=default_filestore):
Expand Down Expand Up @@ -178,6 +179,7 @@ def subjects(self):
return self._subjects
subjs = os.listdir(os.path.join(self.filestore))
subjs = [s for s in subjs if os.path.isdir(os.path.join(self.filestore, s))]
subjs = sorted(subjs)
self._subjects = dict([(sname, SubjectDB(sname, filestore=self.filestore)) for sname in subjs])
return self._subjects

Expand Down

0 comments on commit 59a6f5b

Please sign in to comment.