Currently I’m in need to do some calculations trough python, with numpy and similar stuff… As I read there is no native support for the Gh-internal interpreter for numpy, so I switched over to the CPython-Plugin provided here…
There the issue starts…
It looks like the component runs succesfully. At least it tells me so… But, there is neither an output within the editor, nor a an output to the canvas as shown in at the github
Further more, it takes kind of forever to do a simple thing…
I have no clue about this issue, but maybe some workaround.
Since IronPython targets dot.net, you could use Math.Net instead of numpy. In addition to that, many grasshopper user just need numpy for functionality like matrix multiplication or a Gaussian solver. Implementing this for yourself might not be as effective as using a mature library, but it has a great learning benefit.
I for myself try to prevent using 3rd party libraries for exactly this reason.
Hi Mark, Disclaimer - I havent tried this
If you have lots of number crunching to do and can reduce it to a relatively small number of steps in and out of Rhino then you could run Cpython externally with the subprocess module, possibly using text files or even a SQL server for data exchange… http://www.ironpython.info/index.php?title=Accessing_SQL_Server
@TomTom
Thanks for the advice. I have to check if this is doable in a reasonable amount of time (translate it to .net)
I followed the same path for a while. Doing and reinventing the wheel again and again is good thing for learning, for sure - but is not fitting productivity…
I passed by this point. I have done a lot of wheeles ;
@Dancergraham
Thanks for the input!
I’m going to research on this approach…
For now I have done it, with a call of System.Process.Start from a C#-Component, passing a string, and getting a string. It includes a lot of formatting and parsing before, but its a hack which isn’t the worst in the moment.