Skip to content

Commit c06c310

Browse files
committed
add sanity check for split transform
1 parent 3d84607 commit c06c310

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bayesflow/adapters/adapter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,12 @@ def shift(self, keys: str | Sequence[str], by: float | np.ndarray):
670670
def split(self, key: str, *, into: Sequence[str], indices_or_sections: int | Sequence[int] = None, axis: int = -1):
671671
from .transforms import Split
672672

673-
self.transforms.append(Split(key, into, indices_or_sections, axis))
673+
if isinstance(into, str):
674+
transform = Rename(key, into)
675+
else:
676+
transform = Split(key, into, indices_or_sections, axis)
677+
678+
self.transforms.append(transform)
674679

675680
return self
676681

0 commit comments

Comments
 (0)