Re: [Numpy-discussion] How to use user input as equation directly

2016-10-27 Thread Benjamin Root
"only be used by engineers/scientists for research" Famous last words. I know plenty of scientists who would love to "do research" with an exposed eval(). Full disclosure, I personally added a security hole into matplotlib thinking I covered all my bases in protecting an eval() statement. Ben

Re: [Numpy-discussion] How to use user input as equation directly

2016-10-27 Thread djxvillain
This will not be a public product and will only be used by other engineers/scientists for research. I don't think security should be a huge issue, but I appreciate your input and concern for the quality of my code. -- View this message in context:

Re: [Numpy-discussion] How to use user input as equation directly

2016-10-27 Thread Benjamin Root
Perhaps the numexpr package might be safer? Not exactly meant for this situation (meant for optimizations), but the evaluator is pretty darn safe. Ben Root On Thu, Oct 27, 2016 at 5:33 PM, John Ladasky wrote: > This isn't just a Numpy issue. You are interested in Python's

Re: [Numpy-discussion] How to use user input as equation directly

2016-10-27 Thread John Ladasky
This isn't just a Numpy issue. You are interested in Python's eval(). Keep in mind that any programming language that blurs the line between code and data (many do not) has a potential security vulnerability. What if your user doesn't type "x = 2*np.sin(2*np.pi*44100*t+np.pi/2)" but instead

Re: [Numpy-discussion] How to use user input as equation directly

2016-10-27 Thread djxvillain
That worked perfectly. I've been googling how to do this, I guess I didn't phrase it correctly. Thank you very much. You just saved me a ton of time. -- View this message in context: http://numpy-discussion.10968.n7.nabble.com/How-to-use-user-input-as-equation-directly-tp43665p43667.html

Re: [Numpy-discussion] How to use user input as equation directly

2016-10-27 Thread Ryan May
On Thu, Oct 27, 2016 at 1:58 PM, djxvillain wrote: > Hello all, > > I am an electrical engineer and new to numpy. I need the ability to take > in > user input, and use that input as a variable. For example: > > t = input('enter t: ') > x = input('enter x: ') > > I need

[Numpy-discussion] How to use user input as equation directly

2016-10-27 Thread djxvillain
Hello all, I am an electrical engineer and new to numpy. I need the ability to take in user input, and use that input as a variable. For example: t = input('enter t: ') x = input('enter x: ') I need the user to be able to enter something like x = 2*np.sin(2*np.pi*44100*t+np.pi/2) and it be

Re: [Numpy-discussion] Added atleast_nd, request for clarification/cleanup of atleast_3d

2016-10-27 Thread Joseph Fox-Rabinovitz
Hi, I would like to revitalize the discussion on including PR#7804 (atleast_nd function) at Stephan Hoyer's request. atleast_nd has come up as a convenient workaround for #8206 (adding padding options to diff) to be able to do broadcasting with the required dimensions reversed. Regards,

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Robert Kern
On Thu, Oct 27, 2016 at 10:45 AM, Todd wrote: > > On Thu, Oct 27, 2016 at 12:12 PM, Nathaniel Smith wrote: >> >> Ever notice how Anaconda doesn't provide pyfftw? They can't legally ship both MKL and pyfftw, and they picked MKL. > > Anaconda does ship GPL code

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Todd
On Thu, Oct 27, 2016 at 12:12 PM, Nathaniel Smith wrote: > Ever notice how Anaconda doesn't provide pyfftw? They can't legally ship > both MKL and pyfftw, and they picked MKL. Anaconda does ship GPL code [1]. They even ship GPL code that depends on numpy, such as cvxcanon and

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Nathaniel Smith
On Oct 27, 2016 8:42 AM, "Robert McLeod" wrote: > > Releasing NumPy under GPL would make it incompatible with SciPy, which may be _slightly_ inconvenient to the scientific Python community: > > https://scipy.github.io/old-wiki/pages/License_Compatibility.html > >

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Julian Taylor
As I understand it the wiki is talking about including code in numpy/scipy itself, all code in numpy and scipy must be permissively licensed so it is easy to reason about when building your binaries. The license of the binaries produced from the code is a different matter, which at that time

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Todd
It would still be compatible with SciPy, it would "just" mean that SciPy (and anything else that uses numpy) would be effectively GPL. On Thu, Oct 27, 2016 at 11:42 AM, Robert McLeod wrote: > Releasing NumPy under GPL would make it incompatible with SciPy, which may > be

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Robert McLeod
Releasing NumPy under GPL would make it incompatible with SciPy, which may be _slightly_ inconvenient to the scientific Python community: https://scipy.github.io/old-wiki/pages/License_Compatibility.html https://mail.scipy.org/pipermail/scipy-dev/2013-August/019149.html Robert On Thu, Oct 27,

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Julian Taylor
On 10/27/2016 04:52 PM, Todd wrote: On Thu, Oct 27, 2016 at 10:43 AM, Julian Taylor > wrote: On 10/27/2016 04:30 PM, Todd wrote: On Thu, Oct 27, 2016 at 4:25 AM, Ralf Gommers

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Todd
On Thu, Oct 27, 2016 at 10:43 AM, Julian Taylor < jtaylor.deb...@googlemail.com> wrote: > On 10/27/2016 04:30 PM, Todd wrote: > >> On Thu, Oct 27, 2016 at 4:25 AM, Ralf Gommers > > wrote: >> >> >> On Thu, Oct 27, 2016 at 10:25 AM,

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Julian Taylor
On 10/27/2016 04:30 PM, Todd wrote: On Thu, Oct 27, 2016 at 4:25 AM, Ralf Gommers > wrote: On Thu, Oct 27, 2016 at 10:25 AM, Pavlyk, Oleksandr > wrote: Please

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Todd
On Thu, Oct 27, 2016 at 4:25 AM, Ralf Gommers wrote: > > > On Thu, Oct 27, 2016 at 10:25 AM, Pavlyk, Oleksandr < > oleksandr.pav...@intel.com> wrote: > >> Please see responses inline. >> >> >> >> *From:* NumPy-Discussion [mailto:numpy-discussion-boun...@scipy.org] *On >>

[Numpy-discussion] Problem with compiling openacc with f2py

2016-10-27 Thread Vikram Singh
I am a newbie to f2py so I have been creating simple test cases. Eventually I want to be able to use openacc subroutine from python. So here's the test case module test use iso_c_binding, only: sp => C_FLOAT, dp => C_DOUBLE, i8 => C_INT use omp_lib use openacc implicit

Re: [Numpy-discussion] Intel random number package

2016-10-27 Thread Ralf Gommers
On Thu, Oct 27, 2016 at 10:25 AM, Pavlyk, Oleksandr < oleksandr.pav...@intel.com> wrote: > Please see responses inline. > > > > *From:* NumPy-Discussion [mailto:numpy-discussion-boun...@scipy.org] *On > Behalf Of *Todd > *Sent:* Wednesday, October 26, 2016 4:04 PM > *To:* Discussion of Numerical