Colin J. Williams | 5 May 2004 22:27
Picon
Favicon

numarraycore

It would help to have some documentation on the purpose and usage of the 
class UsesOpPriority and its variable op_priority.

-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
Todd Miller | 5 May 2004 22:51

Re: numarraycore

On Wed, 2004-05-05 at 16:27, Colin J. Williams wrote:
> It would help to have some documentation on the purpose and usage of the 
> class UsesOpPriority and its variable op_priority.

The basic idea was that NumArray subclasses which want to use numarray
operators would:

1.  subclass from UsesOpPriority 

2.  set a class level op_priority > 0. 

NumArrays have op_priority 0,  higher priorities are given "precedence".

Thus, given A=NumArray(...) and B=NumArraySubclass(...), and
A.op_priority==0 and B.op_priority==1, then:  
A+B would execute as B.__radd__(A) rather than A.__add__(B) and hence
the type(A+B) could be NumArraySubclass rather than NumArray.  Different
subclasses could use higher or lower op_priorities to perform the same
kind of operator resolution among themselves.

Todd
--

-- 
Todd Miller <jmiller <at> stsci.edu>

-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
(Continue reading)

Colin J. Williams | 6 May 2004 00:59
Picon
Favicon

Re: numarraycore



Todd Miller wrote:
On Wed, 2004-05-05 at 16:27, Colin J. Williams wrote:
It would help to have some documentation on the purpose and usage of the class UsesOpPriority and its variable op_priority.
Todd,

Thanks for this, perhaps it could be added to the pdf .  I like the basic idea.
The basic idea was that NumArray subclasses which want to use numarray operators would: 1. subclass from UsesOpPriority
UsesOpPriority has no methods and thus, to access the methods of NumArray, it would appear to be necessary to subclass from NumArray.
2. set a class level op_priority > 0. NumArrays have op_priority 0, higher priorities are given "precedence". Thus, given A=NumArray(...) and B=NumArraySubclass(...), and A.op_priority==0 and B.op_priority==1, then: A+B would execute as B.__radd__(A) rather than A.__add__(B) and hence the type(A+B) could be NumArraySubclass rather than NumArray. Different subclasses could use higher or lower op_priorities to perform the same kind of operator resolution among themselves.
I wonder about the desirability of having different levels of priority for the same level of subclassing and am puzzled that a float variable is used for the priority.

It would nice if this depth could be determined automatically.  Perhaps something like the script below could be used.

Colin W.
Todd
# tClassing.py

class A:
  def __init__(self):
    self.p= 0
  def prior(self):
    self.p+= 1
class B(A):
  def __init__(self):
    A.__init__(self)
    self.prior()
class C(B):
  def __init__(self):
    B.__init__(self)
    self.prior()

print A().p
print B().p
c= C()
print 'Priority for C methods:', c.p

------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3

Travis N. Vaught | 6 May 2004 14:27

ANN: SciPy 2004 Conference - Python for Scientific Computing

Greetings,

The 1st annual *SciPy Conference* will be held this year at Caltech, 
September 2-3, 2004.  As some of you may know, we've experienced great 
participation in two SciPy "Workshops" (with ~70 attendees in both 2002 
and 2003) and this year we're graduating to a "conference."  With the 
prestige of a conference comes the responsibility of a keynote address.  
This year, Jim Hugunin has answered the call and will be speaking to 
kickoff the meeting on Thursday September 2nd.  Jim is the creator of 
Numeric Python, Jython, and co-designer of AspectJ. Jim is currently 
working on IronPython--a fast implementation of Python for .NET and Mono.

Registration is now open.  More information can be found here:

http://www.scipy.org/wikis/scipy04

You may register early online for $100.00.  Registration includes 
breakfast and lunch Thursday & Friday and a very nice dinner Thursday 
night.  After July 16, registration will cost $150.00.

Call for Presenters:
If you are interested in presenting at the conference, you may submit an 
abstract in Plain Text, PDF or MS Word formats to abstracts <at> scipy.org -- 
the deadline for abstract submission is July 1, 2004.  Papers and/or 
presentation slides are acceptable and are due by August 20, 2004.

We're also planning three days of informal "Coding Sprints" prior to the 
conference -- August 30 to September 1, 2004.  Conference registration 
is not required to participate in the sprints.  Please email the list, 
however, if you plan to attend.  Topics for these sprints will be 
determined via the mailing lists as well, so please submit any 
suggestions for topics to the scipy-user list:

list signup: http://www.scipy.org/mailinglists/
list address: scipy-user <at> scipy.org

Please forward this announcement to anyone/list that might be interested.

I look forward to seeing you at the conference.

Best Regards,

Travis N. Vaught
Todd Miller | 6 May 2004 20:07

Re: numarraycore

On Wed, 2004-05-05 at 18:59, Colin J. Williams wrote:
> 
> Todd Miller wrote:
> > On Wed, 2004-05-05 at 16:27, Colin J. Williams wrote:
> >   
> > > It would help to have some documentation on the purpose and usage of the 
> > > class UsesOpPriority and its variable op_priority.
> > >     
> > 
> Todd,
> 
> Thanks for this, perhaps it could be added to the pdf .  I like the
> basic idea.

OK.  What is it you want to do?

> > The basic idea was that NumArray subclasses which want to use numarray
> > operators would:
> > 
> > 1.  subclass from UsesOpPriority 
> UsesOpPriority has no methods and thus, to access the methods of
> NumArray, it would appear to be necessary to subclass from NumArray.

For limited but important uses (e.g. masked array) subclassing from
NumArray is not necessary;  I'd summarize these as the cases where a
class wants to take control of operators from NumArray.

> > 2.  set a class level op_priority > 0. 
> > 
> > 
> > NumArrays have op_priority 0,  higher priorities are given "precedence".
> > 
> > 
> > Thus, given A=NumArray(...) and B=NumArraySubclass(...), and
> > A.op_priority==0 and B.op_priority==1, then:  
> > A+B would execute as B.__radd__(A) rather than A.__add__(B) and hence
> > the type(A+B) could be NumArraySubclass rather than NumArray.  Different
> > subclasses could use higher or lower op_priorities to perform the same
> > kind of operator resolution among themselves.
> >   
> I wonder about the desirability of having different levels of priority
> for the same level of subclassing and am puzzled that a float variable
> is used for the priority.

Different levels of priority for the same level of sub-classing makes
sense to me:  it let's you answer the question "What's the result type
of a PyMatrix instance + a SomeOtherSubclass instance?"

A float enables insertions of new members into the middle of an existing
order.

> 
> It would nice if this depth could be determined automatically. 
> Perhaps something like the script below could be used.

I don't think we want something automatic here.   The choices involved
are arbitrary so we just need to be able to define what we want.

Other than masked arrays, the problem we were trying to solve with
UsesOpPriority is more like:

class A(NumArray):              
	op_priority = 1

class B(NumArray):              
	op_priority = 2

whenever A op B is encountered, the result should be a B.  

That said, the solution we currently have is better described by:
whenever A op B is encountered, B.__rop__(A) is called in preference to
A.__op__(B).  With the example above,  even though B.__rop__ is called,
the result is still an A.  :-(   

I fixed this in CVS today to work more like the original description.

Regards,
Todd

> 
> Colin W.
> > Todd
> >   
> # tClassing.py
> 
> class A:
>   def __init__(self):
>     self.p= 0
>   def prior(self):
>     self.p+= 1
> class B(A):
>   def __init__(self):
>     A.__init__(self)
>     self.prior()
> class C(B):
>   def __init__(self):
>     B.__init__(self)
>     self.prior()
> 
> print A().p
> print B().p
> c= C()
> print 'Priority for C methods:', c.p
> ------------------------------------------------------- This SF.Net
> email is sponsored by Sleepycat Software Learn developer strategies
> Cisco, Motorola, Ericsson & Lucent use to deliver higher performing
> products faster, at low TCO.
> http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
> _______________________________________________ Numpy-discussion
> mailing list Numpy-discussion <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
--

-- 
Todd Miller <jmiller <at> stsci.edu>

-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
Colin J. Williams | 7 May 2004 01:16
Picon
Favicon

Re: numarraycore



Todd Miller wrote:
On Wed, 2004-05-05 at 18:59, Colin J. Williams wrote:
Todd Miller wrote:
On Wed, 2004-05-05 at 16:27, Colin J. Williams wrote:
It would help to have some documentation on the purpose and usage of the class UsesOpPriority and its variable op_priority.
Todd, Thanks for this, perhaps it could be added to the pdf . I like the basic idea.
OK. What is it you want to do?
Re: Above.
   Document whatever you decide to do with UsesOpPriority
Re: Below.
  Access the methods of NumArray in a Pythonic manner.
  Subclassing from UsesOpPriority doesn't appear to permit that.
The basic idea was that NumArray subclasses which want to use numarray operators would: 1. subclass from UsesOpPriority
UsesOpPriority has no methods and thus, to access the methods of NumArray, it would appear to be necessary to subclass from NumArray.
For limited but important uses (e.g. masked array) subclassing from NumArray is not necessary; I'd summarize these as the cases where a class wants to take control of operators from NumArray.
Thus, if masked array require use of the UsesOpPrioity, then direct subclassing from there would appear to make sense. 

However, where one wishes to use some of the NumArray methods, then, contrary to 1, above, subclassing from NumArray should, I suggest, be the way to go.
2. set a class level op_priority > 0. NumArrays have op_priority 0, higher priorities are given "precedence". Thus, given A=NumArray(...) and B=NumArraySubclass(...), and A.op_priority==0 and B.op_priority==1, then: A+B would execute as B.__radd__(A) rather than A.__add__(B) and hence the type(A+B) could be NumArraySubclass rather than NumArray. Different subclasses could use higher or lower op_priorities to perform the same kind of operator resolution among themselves.
I wonder about the desirability of having different levels of priority for the same level of subclassing and am puzzled that a float variable is used for the priority.
Different levels of priority for the same level of sub-classing makes sense to me: it let's you answer the question "What's the result type of a PyMatrix instance + a SomeOtherSubclass instance?"
I agree, there is the possibility that one would wish to evaluate such expressions right to left and
the priority provides a way of doing this.
A float enables insertions of new members into the middle of an existing order.
True.  I hope that there will be a database somewhere of all the various values for op_priority
It would nice if this depth could be determined automatically. Perhaps something like the script below could be used.
I don't think we want something automatic here. The choices involved are arbitrary so we just need to be able to define what we want. Other than masked arrays, the problem we were trying to solve with UsesOpPriority is more like: class A(NumArray): op_priority = 1 class B(NumArray): op_priority = 2 whenever A op B is encountered, the result should be a B. That said, the solution we currently have is better described by: whenever A op B is encountered, B.__rop__(A) is called in preference to A.__op__(B). With the example above, even though B.__rop__ is called, the result is still an A. :-( I fixed this in CVS today to work more like the original description. Regards, Todd
Thanks.

Colin W.
Colin W.
Todd
# tClassing.py class A: def __init__(self): self.p= 0 def prior(self): self.p+= 1 class B(A): def __init__(self): A.__init__(self) self.prior() class C(B): def __init__(self): B.__init__(self) self.prior() print A().p print B().p c= C() print 'Priority for C methods:', c.p ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ Numpy-discussion mailing list Numpy-discussion <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion

------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3

Karthikesh Raju | 7 May 2004 10:21
Picon
Picon

covariance and other linear algebra functions

Hi,

Is am searching for a covariance function and other linear algebra
functions like eigen value decomposition. i am interested in both
scipy (havent managed to get scipy installed on the main computation
systems) and also numarray solution.

With warm regards
karthik

-----------------------------------------------------------------------
Karthikesh Raju,		    email: karthik <at> james.hut.fi
Researcher,			    http://www.cis.hut.fi/karthik
Helsinki University of Technology,  Tel: +358-9-451 5389
Laboratory of Comp. & Info. Sc.,    Fax: +358-9-451 3277
Department of Computer Sc.,
P.O Box 5400, FIN 02015 HUT,
Espoo, FINLAND
-----------------------------------------------------------------------
Jon Saenz | 7 May 2004 10:36
Picon
Picon

Re: covariance and other linear algebra functions

With NumPy:
http://www.pyclimate.org

Jon Saenz.				| Tfno: +34 946012445
Depto. Fisica Aplicada II               | Fax:  +34 946013500
Facultad de Ciencias.   \\ Universidad del Pais Vasco \\
Apdo. 644   \\ 48080 - Bilbao  \\ SPAIN

On Fri, 7 May 2004, Karthikesh Raju wrote:

> Hi,
>
> Is am searching for a covariance function and other linear algebra
> functions like eigen value decomposition. i am interested in both
> scipy (havent managed to get scipy installed on the main computation
> systems) and also numarray solution.
>
> With warm regards
> karthik
>
>
> -----------------------------------------------------------------------
> Karthikesh Raju,		    email: karthik <at> james.hut.fi
> Researcher,			    http://www.cis.hut.fi/karthik
> Helsinki University of Technology,  Tel: +358-9-451 5389
> Laboratory of Comp. & Info. Sc.,    Fax: +358-9-451 3277
> Department of Computer Sc.,
> P.O Box 5400, FIN 02015 HUT,
> Espoo, FINLAND
> -----------------------------------------------------------------------
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Sleepycat Software
> Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
> higher performing products faster, at low TCO.
> http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>

-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
Todd Miller | 7 May 2004 16:22

Re: numarraycore

On Thu, 2004-05-06 at 19:16, Colin J. Williams wrote:
> 
> Todd Miller wrote:
> > On Wed, 2004-05-05 at 18:59, Colin J. Williams wrote:
> >   
> > > Todd Miller wrote:
> > >     
> > > > On Wed, 2004-05-05 at 16:27, Colin J. Williams wrote:
> > > >   
> > > >       
> > > > > It would help to have some documentation on the purpose and usage of the 
> > > > > class UsesOpPriority and its variable op_priority.
> > > > >     
> > > > >         
> > > Todd,
> > > 
> > > Thanks for this, perhaps it could be added to the pdf .  I like the
> > > basic idea.
> > >     
> > OK.  What is it you want to do?
> Re: Above.
>    Document whatever you decide to do with UsesOpPriority

I put more comments in numarraycore.   If a lot of people want to
subclass NumArray, it will probably require more discussion because
UsesOpPriority is a limited scheme.  For now,  MaskedArrays do mostly
what I want and it should work for PyMatrix as well.

> Re: Below.
>   Access the methods of NumArray in a Pythonic manner.
>   Subclassing from UsesOpPriority doesn't appear to permit that.

No, it doesn't.  

> >   
> > > > The basic idea was that NumArray subclasses which want to use numarray
> > > > operators would:
> > > > 
> > > > 1.  subclass from UsesOpPriority 
> > > >       
> > > UsesOpPriority has no methods and thus, to access the methods of
> > > NumArray, it would appear to be necessary to subclass from NumArray.
> > >     
> > For limited but important uses (e.g. masked array) subclassing from
> > NumArray is not necessary;  I'd summarize these as the cases where a
> > class wants to take control of operators from NumArray.
> >   
> Thus, if masked array require use of the UsesOpPrioity, then direct
> subclassing from there would appear to make sense.  
> 
> However, where one wishes to use some of the NumArray methods, then,
> contrary to 1, above, subclassing from NumArray should, I suggest, be
> the way to go.

That's true... I overlooked the fact that UsesOpPriority is inherited
automatically by NumArray subclasses.  Sorry for the confusion.

> >   
> > > > 2.  set a class level op_priority > 0. 
> > > > 
> > > > 
> > > > NumArrays have op_priority 0,  higher priorities are given "precedence".
> > > > 
> > > > 
> > > > Thus, given A=NumArray(...) and B=NumArraySubclass(...), and
> > > > A.op_priority==0 and B.op_priority==1, then:  
> > > > A+B would execute as B.__radd__(A) rather than A.__add__(B) and hence
> > > > the type(A+B) could be NumArraySubclass rather than NumArray.  Different
> > > > subclasses could use higher or lower op_priorities to perform the same
> > > > kind of operator resolution among themselves.
> > > >   
> > > >       
> > > I wonder about the desirability of having different levels of priority
> > > for the same level of subclassing and am puzzled that a float variable
> > > is used for the priority.
> > >     
> > Different levels of priority for the same level of sub-classing makes
> > sense to me:  it let's you answer the question "What's the result type
> > of a PyMatrix instance + a SomeOtherSubclass instance?"
> >   
> I agree, there is the possibility that one would wish to evaluate such
> expressions right to left and 
> the priority provides a way of doing this.
> > A float enables insertions of new members into the middle of an existing
> > order.
> >   
> True.  I hope that there will be a database somewhere of all the
> various values for op_priority

Here's the database:  :-)

class                  op_priority

NumArray               0
MaskedArray            1

Regards,
Todd

-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
Gary Ruben | 10 May 2004 06:12
Picon
Favicon

Announce: ErrorVal.py 1.0 for error-bounds calculations

I finally got around to putting my errorbar calculation module on my website.
<http://users.bigpond.net.au/gazzar/python.html>
This should be of interest to Numeric Python users who deal with calculation of error-bounds on
experimental data.

Synopsis:

A module providing a Python number type class and helper functions to ease
the task of computing error bounds on experimental data values.

This module defines an abstract data type, Err, which carries a central/prime
value and upper and lower error bounds.
Helper functions are provided to allow Python Numeric rank-1 arrays of Err objects
to be constructed with ease and to apply Numeric Ufuncs.
Written under Python 2.3.3 and Numeric 23.0

Example of usage:

upperPressure = ArrayOfErr([909., 802., 677., 585., 560., 548.], 1.0)
lowerPressure = ArrayOfErr([144., 246., 378., 469., 493., 505.], 1.0)
pressureDiff = upperPressure - lowerPressure
V_RStandard = ArrayOfErr([2.016, 2.016, 2.020, 2.017, 2.021, 2.019], 0.001)
R = 100.2                                   # standard resistor value [Ohm]
I = V_RStandard / R                         # current [A]
V_RAB = ArrayOfErr([6.167, 6.168, 6.170, 6.160, (6.153, 0.02), (5.894, 0.01)], 0.002)
R_AB = V_RAB / I
logR_AB = ApplyUfuncToErr(R_AB, log10)      # This means log10(R_AB)
print PrimeVals(logR_AB)
print MinVals(logR_AB)
print MaxVals(logR_AB)

Enjoy,
Gary Ruben

--

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm

Gmane