JSwan over Hops : DataTree structure issue

Hey there,

@AndyPayne Here’s the next step in the debugging of my huge grasshopper definition I want to run over compute. I hope you’re not getting too tired of me :joy:

I am not sure why, but I made some experiments with Hops and JSwan, and it seems that paths are getting somehow lost in the deserializing process.
I made a minimal example, demonstrating what is failing.
When using JSwan over Hops, to deserialize a JSON string, the data path I get as output is different from what it should be.
So what’s wrong in this demo is that the output of the JSwan over Hops should have the path {12;34;56}, and it is actually {12;3;5} (path of the first item in the data tree).

I made a custom python 3 script that does the deserialization just fine and the paths are working. So I will use that for now in my other concerned scripts where I faced the issue.

I thought it would still be a good thing if you guys could have a look at it, and eventually fix it.

I attached the minimal grasshopper definition for you to test, plus the 2 Hops definitions
local_geometries_tree_access.gh (5.6 KB)
local_geometries_tree_access_python.gh (7.8 KB)
minimal_demo_jswan_data_tree_over_hops.gh (18.5 KB)

I’m having trouble opening your minimal_demo_jswan_data_tree_over_hops.gh file. It seems to be locking up my Rhino application. And when I open the local_geometries_tree_access_python.gh I get this error message.

1 Like

Weird that it’s locking your Rhino app.
I am using latest Rhino 8 and latest Hops
image
image

You should have JSwan installed I guess, I attach the JSwan .gha file I am using just to be sure.
(…\AppData\Roaming\Grasshopper\Libraries) :
jswan_0.gha (42 KB)

Other than this, maybe try locking the solver before opening the file ? It may be something with your local compute ?

For the python script error it’s because the input JSON parameter is empty. It should work just fine with a JSON as input. I attach a version that looks for empty J parameter to handle this case without throwing an error. You can replace it if you want.

Let me know your progress, and thanks again for your support.
local_geometries_tree_access_python.gh (8.7 KB)