[Py3 Component] Type Hints keep resetting to ghdoc Object

Hi all,
I am sure someone has also experienced this - I already searched the forum a lot but did not find anything to solve this.

I have several GhPy3 components in SDK mode that rely on type hints or at least on the “No Type Hint” option to work properly. However, everytime I change the script, the type hints completely reset.

Is there currently a way to make type hints stick? It is very nnoying that the components keep erroring out just because I changed one line in the script (since all inputs are cast to ghdoc objects again).

Thanks in advance,
Max

@efestwin Which Rhino version are you using? We have made some bug fixes and this should not be happening in 8.7 RC. Would you mind testing that?

1 Like

Hey,
oh thank you for the fast reply and the tip!

I had targeted normal release cycle because of a student workshop that is currently running. But we changed everything to 8.7 RC now and it seems to work much better now!

Much appreciated fix, thanks a lot!

Best wishes,
Max

1 Like

Thanks for testing and reporting the bugs :smiley:

@eirannejad

Seem that problem are still exist on IronPython Script Component

Thankyou very much

Hi again @eirannejad
unfortunately I have to report that the bug is still existent in 8.7 RC. It has gotten “better” if you might say so, but Type Hints still reset.

It might be connected to the fact that I am using the # venv: <some-name> on components now, I can’t tell currently.

Also, I noticed that setting Type Hints to Rhino specific types, i.e. GeometryBase, Transform, does not reset. float and bool also seems to “stick” quite well. But what keeps resetting all the time is the str type hint (which is kind of problematic if everything depends on passing json strings… :joy:)

I would very much appreciate it if you could give that another look. Thanks in advance and have a good start of the week!
Max

Okay this is great info. The resetting of type hints is a potential bug on the piece of code that captures the RunScript signature and tries to set proper type hints based on the signature. I will test this more in 8.7 today to make sure it is behaving correctly. It would be great if you can get the latest 8.7 RC and let me know if it still happens.

https://developer.rhino3d.com/guides/scripting/scripting-gh-python/#changing-runscript-signature

I can replicate this with str and will get it fixed. Thanks for testing!

1 Like

Awesome, thank you so much for the quick reply!

Should I still test anything on my side?

(What do you mean by “latest RC7”, is that 8.7.24121.13001 and if not where can I get an even newer one? Rhino says I have the newest version :sweat_smile:)

Best wishes and have a great day,
Max

1 Like

Ok I pushed a fixed for this for tomorrows 8.7 build

RH-81870 RunScript backporter keeps resetting Type Hints

1 Like

Now I get it. Will report back to you any findings tomorrow.

Much appreciated, thank you!:pray: