Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH sort subject list and improve repr of transforms #530

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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