Skip to content

Commit

Permalink
Add __repr__ to the DataSource class
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed May 14, 2024
1 parent 2f231ee commit cfb6448
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bidscoin/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ def __init__(self, provenance: Union[str, Path]='', plugins: Dict[str, Plugin]=N
self.sesprefix: str = sesprefix
self._cache: dict = {}

def __repr__(self):
return (f"Path:\t\t{self.path}\n"
f"Datatype:\t{self.datatype}\n"
f"Dataformat:\t{self.dataformat}\n"
f"Plugins:\t{self.plugins}\n"
f"Subprefix:\t{self.subprefix}\n"
f"Sesprefix:\t{self.sesprefix}")

def resubprefix(self) -> str:
"""Returns the subprefix with escaped regular expression characters (except '-'). A single '*' wildcard is returned as ''"""
return '' if self.subprefix=='*' else re.escape(self.subprefix).replace(r'\-','-')
Expand Down

0 comments on commit cfb6448

Please sign in to comment.