Hops wishes or available options?

Ahoy !

I’m currently working on a CPython Hops library to bring Matplotlib in Grasshopper.
First of all, Hops is absolutely great ! Thank you for its development, I’m personally having fun playing with it on this small project !

Here’s just one of the many possibilities
Figure_1

I have a couple of questions about some Hops options though…

  • Can we set cache on memory to False by default through code?
  • Same question for cache on server?

→ These are essential for Matplotlib to draw the plot on demand. If any cache is set to True, Matplotlib will not display the plot twice, only the first time.

/

  • Can we set Asynchronous to True by defaul through code?

→ Would be great to move around 3d model while the plot is being displayed. Asynchronous is a really nice option.

/

  • I think this one isn’t possible, but could we set a Hops component to not run in parallel?

→ I have a weird behavior sometimes where the console is locked in a loop (that ends after 1 minute) and prints “main thread is not in main loop”. I don’t see where this could come from else than parallel run. Maybe there is a Python way to avoid this kind of situation?

Thank you for your time in advance, and for Hops in general !

Cheers
Antoine

Help?


:no_mouth:

Should we consider CPython Hops dead already in the sight of RhinoCode?
Not a sarcastic question.

@stevebaer

Sorry, I missed these questions when you initially posted them. If you are still having problems, let me know and I’ll see what I can do.

It depends on how you want to use hops. Hops is all about “hopping” to another process either on the same computer or a different computer to perform calculations are return them to Grasshopper. RhinoCode brings CPython into the same process as Rhino/Grasshopper. I would think some use cases of hops with CPython may be better suited with RhinoCode in the future and some cases are not.

Thank you for your reply !

Yes, I’m still having those questions (and the last problem, with thread not in main loop)
Sometimes the graph is displayed after that error message has been triggered +/- 15 times, but it takes about 20 seconds.
Most of the time, I need to restart the local server after this happened, because hops goes not responsive.

I’ve also got other questions since, but I’ll make detailed new posts for those :slight_smile:

That sounds strange. Wouldn’t you expect the same graph when making the same request?

This error is coming from python as web servers are processing requests on different threads. Here are a few sites to look at for getting matplotlib to work with a web server

I sure would !
But… :slight_smile:

Is it not possible to force no cache in memory through code? (I’ve no idea how complicated or silly that could be).

Thanks for the links ! I’ll test that !
I see in the first one they recommend not to use pyplot with flask, which is what I use. But I close every opened plot, which should be ok… (according to them)

I’ll keep this thread updated as soon as I’ve got time to test all this !