Skip to content

Commit c145fe3

Browse files
committed
add test for concatenate to rename conversion
1 parent a47fb3d commit c145fe3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_adapters/test_adapters.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,3 +393,16 @@ def test_nnpe(random_data):
393393
# Both should assign noise to high-variance dimension
394394
assert std_dim[1] > 0
395395
assert std_glob[1] > 0
396+
397+
398+
def test_single_concatenate_to_rename():
399+
# test that single-element concatenate is converted to rename
400+
from bayesflow import Adapter
401+
from bayesflow.adapters.transforms import Rename, Concatenate
402+
403+
ad = Adapter().concatenate("a", into="b")
404+
assert isinstance(ad[0], Rename)
405+
ad = Adapter().concatenate(["a"], into="b")
406+
assert isinstance(ad[0], Rename)
407+
ad = Adapter().concatenate(["a", "b"], into="c")
408+
assert isinstance(ad[0], Concatenate)

0 commit comments

Comments
 (0)