Numpy array not converting to NDArray in some installations

283 views
Skip to first unread message

Jim Olsen

unread,
Apr 18, 2017, 2:47:31 PM4/18/17
to Jep Project
OK, so I have a function that uses python to populate a numpy array.  Following this, I use getValue() to obtain the numpy array, expecting to receive a jep.NDArray.  On my macintosh, this works perfectly as expected.  On my windows machine, and on another person's mac, it is coming through as a string object.  The exact same code, with the same versions of numpy.note that the python versions are slightly different across all machines, but the JEP version is exactly the same.

So it seems like in some circumstances it just will not convert a numpy array into an NDArray and does strings instead.  Any thoughts as to why this might occur?

Ben Steffensmeier

unread,
Apr 18, 2017, 3:00:55 PM4/18/17
to Jim Olsen, Jep Project
It sounds like you may have compiled jep without support for numpy. If the build scripts don't detect numpy then jep will be built without numpy support. You may need to rebuild jep with numpy installed or you may need to update something in the build to help it find numpy. To test this theory use either the jep interpreter or jep.eval in your program you should check the value of jep.JEP_NUMPY_ENABLED. Here is an example of how I confirmed numpy is enabled on my currently installed jep:

$ jep
>>> import jep
>>> jep.JEP_NUMPY_ENABLED
1
>>>

Ben


On Tue, Apr 18, 2017 at 1:47 PM, Jim Olsen <clif...@gmail.com> wrote:
OK, so I have a function that uses python to populate a numpy array.  Following this, I use getValue() to obtain the numpy array, expecting to receive a jep.NDArray.  On my macintosh, this works perfectly as expected.  On my windows machine, and on another person's mac, it is coming through as a string object.  The exact same code, with the same versions of numpy.note that the python versions are slightly different across all machines, but the JEP version is exactly the same.

So it seems like in some circumstances it just will not convert a numpy array into an NDArray and does strings instead.  Any thoughts as to why this might occur?

--
You received this message because you are subscribed to the Google Groups "Jep Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jep-project+unsubscribe@googlegroups.com.
To post to this group, send email to jep-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jep-project/40a60571-18b6-4860-a204-7a75d9394eb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jim Olsen

unread,
Apr 18, 2017, 3:17:02 PM4/18/17
to Jep Project, clif...@gmail.com

OK, think I found what it actually is.  Order of install is important.  I upgraded numpy for another package and that seemed to disable jep support for numpy when using pip install.  simply uninstalling jep and reinstalling made the below test work.  I will confirm this fixes the code, but I was getting zero for a result before I did this....

Thanks!

Jim

On Tuesday, April 18, 2017 at 1:00:55 PM UTC-6, Ben Steffensmeier wrote:
It sounds like you may have compiled jep without support for numpy. If the build scripts don't detect numpy then jep will be built without numpy support. You may need to rebuild jep with numpy installed or you may need to update something in the build to help it find numpy. To test this theory use either the jep interpreter or jep.eval in your program you should check the value of jep.JEP_NUMPY_ENABLED. Here is an example of how I confirmed numpy is enabled on my currently installed jep:

$ jep
>>> import jep
>>> jep.JEP_NUMPY_ENABLED
1
>>>

Ben

On Tue, Apr 18, 2017 at 1:47 PM, Jim Olsen <clif...@gmail.com> wrote:
OK, so I have a function that uses python to populate a numpy array.  Following this, I use getValue() to obtain the numpy array, expecting to receive a jep.NDArray.  On my macintosh, this works perfectly as expected.  On my windows machine, and on another person's mac, it is coming through as a string object.  The exact same code, with the same versions of numpy.note that the python versions are slightly different across all machines, but the JEP version is exactly the same.

So it seems like in some circumstances it just will not convert a numpy array into an NDArray and does strings instead.  Any thoughts as to why this might occur?

--
You received this message because you are subscribed to the Google Groups "Jep Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jep-project...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages