Re: OO design

2005-07-20 Thread Florian Diesch
chris <[EMAIL PROTECTED]> wrote: > I've been scripting with python for a while now. Basically writing a few > functions and running in the ipython shell. That's been very useful. But the > more I do this the more I see that I'm doing more or less the same thing > over and over again. So its feels l

Re: OO design

2005-07-20 Thread Terry Hancock
On Wednesday 20 July 2005 07:22 am, chris wrote: > Also minor clarifications:: > > > I'm hoping some of you python > > lamas out there might be able to share some of your wisdom on the subject. > > lama = guru = teacher(not a furry animal, although my dog has certainly > taught me a few trick

Re: OO design

2005-07-20 Thread chris
Extremely grateful for all the responses. I've pasted them all into a document and can now read all your valuable ideas together. Even at a first reading they have already helped clarify my thinking. Also minor clarifications:: > I'm hoping some of you python > lamas out there might be able to sh

Re: OO design

2005-07-19 Thread flupke
Robert Kern wrote: > chris wrote: > >> When I think about what I should do I end up with a class XY that has a >> method for everything I want to do eg. >> >> class XY: >> def read_file >> def scale_data >> def plot_data >> def shelve_data >> >> But somehow that doesn't feel right, especia

Re: OO design

2005-07-19 Thread Terry Hancock
On Tuesday 19 July 2005 05:09 am, chris wrote: > So its feels like I need to get into class programming > with all its attendant benefits. However my biggest problem is a conceptual > one. I just can't get my head around defining suitable classes, how they > aquire data and communicate with each o

Re: OO design

2005-07-19 Thread corey . coughlin
I also have a little trouble with creating megaclasses. Usually I just try to think about what things are a little bit, and how I'm going to be using them. I think somebody else suggested a top down approach, and that makes a certain amount of sense. But at this point, you're probably getting ti

Re: OO design

2005-07-19 Thread Robert Kern
chris wrote: > When I think about what I should do I end up with a class XY that has a > method for everything I want to do eg. > > class XY: > def read_file > def scale_data > def plot_data > def shelve_data > > But somehow that doesn't feel right, especially when I expect the number of

Re: OO design

2005-07-19 Thread Caleb Hattingh
Chris > 1. get arbitrary numerical data (typically large data sets in columnar > format or even via COM from other packages. I generally have to deal with > one or more sets of X,Y data) > 2. manipulate the data (scaling, least squares fitting, means, peaks, > add/subtract one XY set from another

Re: OO design

2005-07-19 Thread Dave Cook
On 2005-07-19, chris <[EMAIL PROTECTED]> wrote: > I've been scripting with python for a while now. Basically writing a few > functions and running in the ipython shell. That's been very useful. But the > more I do this the more I see that I'm doing more or less the same thing > over and over again

Re: OO design

2005-07-19 Thread gene tani
fav DP books: http://www.oreilly.com/catalog/hfdesignpat/ http://www.netobjectives.com/dpexplained/ -- http://mail.python.org/mailman/listinfo/python-list

Re: OO design

2005-07-19 Thread Chris Smith
> "chris" == chris <[EMAIL PROTECTED]> writes: chris> I have no problem writing bits of functional code to do any chris> of the above. But for the life of me I can't see how I can chris> hook them altogether in an OO based framework that I can chris> build and extend (with mo

Re: OO design question / Transform object in place?

2005-05-20 Thread Dave Benjamin
[EMAIL PROTECTED] wrote: > Dave Benjamin wrote: > >>I think it's much better for simplify() to return a new object >>and leave the original object unmodified. You can still write: >>expression2 = expression2.simplify() > > A belated thank-you message for your reply to my posting. I took your > ad

Re: OO design question / Transform object in place?

2005-05-20 Thread andy2O
Dave Benjamin wrote: > [EMAIL PROTECTED] wrote: > > Now suppose I set "expression2 = Sum([a,-a])" and Sum.simplify() > > recognises that the two terms cancel and the Sum has value 0. > > > > Can I make "expression2.simplify()" transform expression2 from an > > instance of Sum to an instance of Numb

Re: OO design question / Transform object in place?

2005-05-11 Thread Dave Benjamin
[EMAIL PROTECTED] wrote: > Now suppose I set "expression2 = Sum([a,-a])" and Sum.simplify() > recognises that the two terms cancel and the Sum has value 0. > > Can I make "expression2.simplify()" transform expression2 from an > instance of Sum to an instance of Number(0) **in place**? Is that > po