Unusual Behaviour when Grafting Data Tree

Hi all,

The first issue I’m having is when simplifying data trees with structure {0;0;0} they don’t simplify to {0} when using the simplify option. This is a problem when you switch from multiple inputs to a single input; the data no longer flows through in the same way.

The secondly issue is with grafting:
If I use graft on a standard {0;0}(i) tree, it ends up as {0;0;i}(), which is expected.
However, if I have a tree that is {2;0}(i) and I use ‘branch shift’ to get {2}(i) and then graft it, I end up with {2:0}(i) again. It is as if GH has remembered the original structure and reverted to it…

Any thoughts on why either of the above are happening would be appreciated.
I can’t share the file, but here is a screenshot:

Cheers,
Steven

These are the expected behaviors.

The first issue I’m having is when simplifying data trees with structure {0;0;0} they don’t simplify to {0}

What you are looking for is the Suirify component. (I don’t get the naming :grimacing:)

1 Like

Thanks Michael,

good tip with the Suirify component, hadn’t seen that before!

regarding the grafting though, I would expect {2;0}(i) to shift to {2}(i) and then graft to {0;2}(i). Ie, I would expect graft to always add the “0” to the start. I guess I expect it to act like a bit shifting operation; the shifted digits are lost forever.

Suirify is to me what “Pryoritize” would be to you :wink:

3 Likes

I think because you are grafting an already grafted list. What if you flatten, then graft.

Thanks for the replies folks; I’ve had another look today with fresh eyes and you’re absolutely right, this is the expected behaviour for graft. Took a while to convince myself though :wink: :