Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
indexing added to print statements for adapter
Browse files Browse the repository at this point in the history
eodole committed Jan 1, 2025
1 parent 78dd5d5 commit 2de69c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bayesflow/adapters/adapter.py
Original file line number Diff line number Diff line change
@@ -76,7 +76,12 @@ def __call__(self, data: dict[str, any], *, inverse: bool = False, **kwargs) ->
return self.forward(data, **kwargs)

def __repr__(self):
return f"Adapter([{' -> '.join(map(repr, self.transforms))}])"
str_transf = ''
for i in range(0, len(self.transforms)):
str_transf = str_transf + str(i) + ': ' + repr(self.transforms[i])
if i != len(self.transforms) - 1:
str_transf = str_transf + ' -> '
return f"Adapter([{str_transf}])"

def __getitem__(self, index):
if isinstance(index, slice):

0 comments on commit 2de69c9

Please sign in to comment.