Closed scheidan closed 2 years ago
The inverse function fails if we have nested Named Tuples. For "normal" tuples it works well:
inverse
using TransformVariables # v0.6.2 # transformation with nested *Named*Tuple t1 = as(( a = as(Real, 0, 0.1), b = as( (b1 = as(Real, 1, 5), b2 = as(Real, 10, 50)) ) )) x = transform(t1, randn(dimension(t1))) y = inverse(t1, x) # <- fails # ERROR: ArgumentError: length(x) == dimension(tt) must hold. Got # length(x) => 3 # dimension(tt) => 2 # transformation with nested Tuple t2 = as(( a = as(Real, 0, 0.1), b = as( (as(Real, 1, 5), # no names as(Real, 10, 50)) ) )) x = transform(t2, dimension(t2)) y = inverse(t2, x) # works :)
Thanks, I can confirm that this is a bug. Will look into it.
The
inverse
function fails if we have nested Named Tuples. For "normal" tuples it works well: