Johann Cohen-Tanugi wrote:
On 10/20/2010 11:10 PM, Robert Kern wrote:
On Wed, Oct 20, 2010 at 15:58, Johann Cohen-Tanugico...@lpta.in2p3.fr
wrote:
On 10/20/2010 10:35 PM, Nathaniel Smith wrote:
IMPORTANT USAGE NOTE: never do this :-)
On 10/20/2010 11:49 PM, Zachary Pincus wrote:
Hi Robert,
so in a big data analysis framework, that is essentially written in C
++,
exposed to python with SWIG, plus dedicated python modules, the user
performs an analysis choosing some given modules by name,as in :
myOpt=foo
I'm trying to write an implementation of the amoeba function from
numerical recipes and need to be able to pass a function name and
parameter list to be called from within the amoeba function. Simply
passing the name as a string doesn't work since python doesn't know it
is a function and throws a
I'm trying to write an implementation of the amoeba function from
numerical recipes and need to be able to pass a function name and
parameter list to be called from within the amoeba function. Simply
passing the name as a string doesn't work since python doesn't know it
is a function and
If you really need to pass the function name :
In [3]: def my_func(x):
...: return 2*x
In [4]: def caller(fname,x):
...: return eval(%s(%f)%(fname,x))
In [5]: caller(my_func,2)
Out[5]: 4.0
On 10/20/2010 03:46 PM, Zachary Pincus wrote:
I'm trying to write an implementation of
On Wed, Oct 20, 2010 at 9:46 AM, Zachary Pincus zachary.pin...@yale.edu wrote:
I'm trying to write an implementation of the amoeba function from
numerical recipes and need to be able to pass a function name and
parameter list to be called from within the amoeba function. Simply
passing the
On Wed, 2010-10-20 at 09:46 -0400, Zachary Pincus wrote:
I'm trying to write an implementation of the amoeba function from
numerical recipes and need to be able to pass a function name and
parameter list to be called from within the amoeba function. Simply
passing the name as a string
On Wed, 2010-10-20 at 13:18 -0400, Alan G Isaac wrote:
On 10/20/2010 9:42 AM, Thomas Kirk Gamble wrote:
I'm trying to write an implementation of the amoeba function from
numerical recipes and need to be able to pass a function name and
parameter list to be called from within the amoeba
On Wed, Oct 20, 2010 at 6:51 AM, Johann Cohen-Tanugi
co...@lpta.in2p3.fr wrote:
If you really need to pass the function name :
In [3]: def my_func(x):
...: return 2*x
In [4]: def caller(fname,x):
...: return eval(%s(%f)%(fname,x))
In [5]: caller(my_func,2)
Out[5]: 4.0
The
On 10/20/2010 10:35 PM, Nathaniel Smith wrote:
On Wed, Oct 20, 2010 at 6:51 AM, Johann Cohen-Tanugi
co...@lpta.in2p3.fr wrote:
If you really need to pass the function name :
In [3]: def my_func(x):
...: return 2*x
In [4]: def caller(fname,x):
...: return
On Wed, Oct 20, 2010 at 15:58, Johann Cohen-Tanugi co...@lpta.in2p3.fr wrote:
On 10/20/2010 10:35 PM, Nathaniel Smith wrote:
IMPORTANT USAGE NOTE: never do this :-)
What would you recommand? I do encounter situations where I need
instantiation based on the name of the thing to instantiate,
On 10/20/2010 11:10 PM, Robert Kern wrote:
On Wed, Oct 20, 2010 at 15:58, Johann Cohen-Tanugico...@lpta.in2p3.fr
wrote:
On 10/20/2010 10:35 PM, Nathaniel Smith wrote:
IMPORTANT USAGE NOTE: never do this :-)
What would you recommand? I do encounter situations where
Hi Robert,
so in a big data analysis framework, that is essentially written in C
++,
exposed to python with SWIG, plus dedicated python modules, the user
performs an analysis choosing some given modules by name,as in :
myOpt=foo
my_analyse.perform(use_optimizer=myOpt)
The attribute
On Wed, Oct 20, 2010 at 16:49, Zachary Pincus zachary.pin...@yale.edu wrote:
But why not have the user just pass in the relevant optObject from the
pyOpt namespace (or some restricted namespace that just has the
relevant functions exposed)? E.g.
my_analysis.perform(optimizer=pyOpt.Amoeba)
14 matches
Mail list logo