-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for heterogeneous lists #29
Comments
I'll have to dive into jpype to see if this is possible. Also, I will check how the RNetlogo package deals with this. If possible, I prefer to maintain feature parity with them. |
I started messing around with jpype directly as I needed heterogeneous output from something. Here's I ended up using the following python function which can directly take the output from
The overhead doesn't seem to be about the same as the current version:
( Here's some sample output:
|
Interesting idea. Basically, instead of trying to convert everything within Java as I currently do (see here line 100). You could pass everything straight to python and deal with it there. Dealing with heterogenous collections is much easier this way and performance seems fine. |
Currently, attempting to report a heterogeneous list gives a
ParseException
pyNetLogo attempts to the elements of aLogoList
based on the type first element:Heterogeneous lists are quite useful, especially when associating results with parameters.
It should be possible to return heterogeneous lists by leaving the
LogoList
elements boxed and converting to an object array (instead of a value array), or surfacing theLogoList
to jpype directly and converting on the Python side (though I don't know much about jpype). These options could have a performance hit depending on how jpype's memory sharing works, but they could be done as fallback options when returning a value array would fail.The text was updated successfully, but these errors were encountered: