Skip to content

Commit 3d8aad6

Browse files
committed
ENH: better repr for Derivatives class
1 parent 1829514 commit 3d8aad6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nibabies/utils/bids.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ def __init__(self, bids_root: Path | str, spec: dict | Path | str | None = None,
6767
setattr(self, name, None)
6868

6969
def __repr__(self):
70-
return '\n'.join([name for name in self.names if getattr(self, name)])
70+
output = ["Derivatives |"]
71+
output.extend([f" {attr}: {getattr(self, attr)}" for attr in self.names])
72+
return '\n'.join(output)
73+
#return '\n'.join(f"{name}: {getattr(self, name)}" for name in self.names)
7174

7275
def __contains__(self, val: str):
7376
return val in self.names

0 commit comments

Comments
 (0)