gallantlab / pycortex

Pycortex is a python-based toolkit for surface visualization of fMRI data
https://gallantlab.github.io/pycortex
BSD 2-Clause "Simplified" License
581 stars 137 forks source link

ENH sort subject list and improve repr of transforms #530

Closed mvdoc closed 5 months ago

mvdoc commented 5 months ago

Maybe this problem was a problem only for me. But I always hated how the transforms were listed in the __repr__, as it wasn't really easy to understand what transforms were available for a subject.

Before the PR they would be listed as

>>> cortex.db.subjects["fsaverage"].transforms
Transforms: [atlas,atlas336,atlas_2mm,atlas_3mm]

which is fine for a few transforms, but it becomes quickly unreadable if one has many transforms.

After this PR they are listed as

>>> cortex.db.subjects["fsaverage"].transforms
Available transforms for fsaverage:
atlas
atlas336
atlas_2mm
atlas_3mm

This PR also sorts the subjects when running cortex.db and cortex.db.subjects. The unsorted subjects also bugged me in the past.