Re: [Numpy-discussion] question about standalone small software and teaching
On Wed, Apr 04, 2007 at 05:07:38PM -0500, Robert Kern wrote: Ah, sorry, I missed the bit where you said you only built inside enthought/traits/. I'd build the whole suite. It'll take a bit, building the extension modules for Kiva, but nothing too bad. I don't know why you'd get the error, though. enthought.traits.api should have HasTraits. Actually if you have problem compiling you can try leaving out kiva, it is not terribly useful for what you are currently doing. To do this comment the config.add_subpackage('kiva') in setup.py. I have found out that kiva is the package that is the hardest to compile. The way I compile the ETS is to use the old ./build_inplace.sh numpy method. IWOMB (it works on my box). Gaël ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
Gael Varoquaux wrote: I have recently started avoided using class attributes when not necessary, I agree. I use class attributes when I need, well, class attributes. That is an attribute that is shared by all the instances of the class. In fact, in the example: class A: x = 4 A_instance = A() A_instance.x = 10 A.x is NOT the class attribute, it is now an instance attribute, which is found before the still existing class attribute A.x. Yes, the class attribute can serve as a default, but, I think, in a situation when you are intending the class attribute to be over-ridden by an instance attribute, then it's clearer to define it as an instance attribute in the first place: class A: def __init___(self, ...) self.x = 4 Even though it's more typing. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
On Thu, 5 Apr 2007, Gael Varoquaux apparently wrote: Actually I do it the other way around nowadays. Except in the tutorial? But anyway, I'm willing to try anything that gets them moving. It is true that avoiding the appearance of complexity can sometimes add complexity. Cheers, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
On Thu, Apr 05, 2007 at 04:24:01PM -0400, Alan G Isaac wrote: On Thu, 5 Apr 2007, Gael Varoquaux apparently wrote: Actually I do it the other way around nowadays. Except in the tutorial? Yes, shame on me, I changed policy after writing it. I guess I should correct it. I'll add this to my TODO list. Gaël ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
Thanks for the reply I will sure try to use it and so some small software. Giorgio ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
Hello Gael (numpy friends), I'd love to use Traits and TraitsUI. It looks like a very promising approach. But why is it so difficult to install? If I download the source from http://code.enthought.com/traits/, and follow the instructions in enthought.traits-1.1.0/README, and then run the code snippet #1 in your tutorial, I get --- begin error message --- /Users/vallis/Desktop/enthought.traits-1.1.0/enthought/pyface/util/python_stc.py:14: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or activly maintained. Please switch to the wx package as soon as possible. from wxPython.wx import * Traceback (most recent call last): File prova.py, line 23, in ? camera.configure_traits() File enthought/traits/has_traits.py, line 1871, in configure_traits File /Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/wx/toolkit.py, line 134, in view_application import view_application File /Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/wx/view_application.py, line 29, in ? from enthought.debug.fbi \ File /Users/vallis/Desktop/enthought.traits-1.1.0/enthought/debug/fbi.py, line 257, in ? auto_size = False File /Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/editors.py, line 196, in TableEditor return toolkit().table_editor( *args, **traits ) File /Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/wx/toolkit.py, line 514, in table_editor return te.ToolkitEditorFactory( *args, **traits ) File /Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/editor_factory.py, line 55, in __init__ HasPrivateTraits.__init__( self, **traits ) File enthought/traits/trait_handlers.py, line 172, in error enthought.traits.trait_errors.TraitError: The 'selection_color' trait of a ToolkitEditorFactory instance must be a wx.Colour instance, an integer which in hex is of the form 0xRRGGBB, where RR is red, GG is green, and BB is blue, but a value of black was specified. --- end error message --- BTW, I'm using Python 2.4.4 on Macintel, with wxPython-2.8.0. If I get the latest SVN of the enthought tool suite, go to enthought/src/lib/enthought/traits, and build with python setup.py build_src build_clib build_ext --inplace as suggested in the enthought wiki, and then add enthought/src/lib to my PYTHONPATH, then your snippet fails with --- begin error message --- Traceback (most recent call last): File prova.py, line 5, in ? class Camera(HasTraits): NameError: name 'HasTraits' is not defined --- end error message --- Last, I see that matplotlib includes some enthought/traits code, but not the ui frontends. Why is that? Is the matplotlib traits usable? As you can see, I'm very confused... if only there was a traits Python egg... Thanks! Michele --- Discussion of Numerical Python numpy-discussion@scipy.org wrote: You can do a script with a GUI front end, as described in the first chapter of my tutorial http://gael-varoquaux.info/computers/traits_tutorial/traits_tutorial.html . You can also build a complete interactive application, as described in the rest of the tutorial, but this is more work. If you have more questions about this approach feal free to ask. Ga�l ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
On Wed, Apr 04, 2007 at 04:36:19PM -0500, Robert Kern wrote: As you can see, I'm very confused... if only there was a traits Python egg... There are, but only binaries for win32 at the moment. Building from source on OS X should be straightforward, though. How about linux eggs ? I had the feeling they had made a lot of progress. Michele, indeed I would say that the weak point of traitsUI is the packaging. It is a great module, but it lacks packaging. I personnaly compile it from svn, but I know this is not an option for everybody. People are working on this issue, and it is making progress, but unfortunatly it seems to me that packaging things on OS X is a bit challenge currently. Regards, Gaël ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
--- Discussion of Numerical Python numpy-discussion@scipy.org wrote: [EMAIL PROTECTED] wrote: BTW, I'm using Python 2.4.4 on Macintel, with wxPython-2.8.0. We require wxPython 2.6 at the moment. Ah, good to know. This could explain the errors I get when compiling in place. If I get the latest SVN of the enthought tool suite, go to enthought/src/lib/enthought/traits, and build with python setup.py build_src build_clib build_ext --inplace as suggested in the enthought wiki, and then add enthought/src/lib to my PYTHONPATH, then your snippet fails with --- begin error message --- Traceback (most recent call last): File prova.py, line 5, in ? class Camera(HasTraits): NameError: name 'HasTraits' is not defined Hmm, it works for me. Are you sure that your build is being correctly picked up? Import enthought, then print enthought.__file__. Yes, it is picking up the right one. I assume I can run the setup.py in enthought/src/lib/enthought/traits to get only traits, right? I'm not installing scipy, or anything else. As you can see, I'm very confused... if only there was a traits Python egg... There are, but only binaries for win32 at the moment. Building from source on OS X should be straightforward, though. https://svn.enthought.com/enthought/wiki/IntelMacPython25 Ok, I'll try tomorrow and let you know. Michele ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
Gael Varoquaux wrote: On Wed, Apr 04, 2007 at 04:36:19PM -0500, Robert Kern wrote: As you can see, I'm very confused... if only there was a traits Python egg... There are, but only binaries for win32 at the moment. Building from source on OS X should be straightforward, though. How about linux eggs ? I had the feeling they had made a lot of progress. There's certainly been progress on making the subpackages independently buildable. I don't think you'll see eggs for Linux, though. Frankly, eggs for Linux are nearly useless except for specific deployment goals. A Fedora Core 4 egg won't work on a Debian box, etc. Building enthought from source is not hard. Certainly easier than scipy or matplotlib. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
[EMAIL PROTECTED] wrote: --- Discussion of Numerical Python numpy-discussion@scipy.org wrote: [EMAIL PROTECTED] wrote: If I get the latest SVN of the enthought tool suite, go to enthought/src/lib/enthought/traits, and build with python setup.py build_src build_clib build_ext --inplace as suggested in the enthought wiki, and then add enthought/src/lib to my PYTHONPATH, then your snippet fails with --- begin error message --- Traceback (most recent call last): File prova.py, line 5, in ? class Camera(HasTraits): NameError: name 'HasTraits' is not defined Hmm, it works for me. Are you sure that your build is being correctly picked up? Import enthought, then print enthought.__file__. Yes, it is picking up the right one. I assume I can run the setup.py in enthought/src/lib/enthought/traits to get only traits, right? I'm not installing scipy, or anything else. Ah, sorry, I missed the bit where you said you only built inside enthought/traits/. I'd build the whole suite. It'll take a bit, building the extension modules for Kiva, but nothing too bad. I don't know why you'd get the error, though. enthought.traits.api should have HasTraits. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
Is enthought now defaulting to numpy ? -Sebastian On 4/4/07, Robert Kern [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: --- Discussion of Numerical Python numpy-discussion@scipy.org wrote: [EMAIL PROTECTED] wrote: If I get the latest SVN of the enthought tool suite, go to enthought/src/lib/enthought/traits, and build with python setup.py build_src build_clib build_ext --inplace as suggested in the enthought wiki, and then add enthought/src/lib to my PYTHONPATH, then your snippet fails with --- begin error message --- Traceback (most recent call last): File prova.py, line 5, in ? class Camera(HasTraits): NameError: name 'HasTraits' is not defined Hmm, it works for me. Are you sure that your build is being correctly picked up? Import enthought, then print enthought.__file__. Yes, it is picking up the right one. I assume I can run the setup.py in enthought/src/lib/enthought/traits to get only traits, right? I'm not installing scipy, or anything else. Ah, sorry, I missed the bit where you said you only built inside enthought/traits/. I'd build the whole suite. It'll take a bit, building the extension modules for Kiva, but nothing too bad. I don't know why you'd get the error, though. enthought.traits.api should have HasTraits. -- Robert Kern ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
Hello Gael, Short question regarding your tutorial -- I'm very intrigued by traits and would like to use them too Why do you define e.g. the Point class like this: class Point(object): 3D Point objects x = 0. y = 0. z = 0. and not like this: class Point(object): 3D Point objects def __init__(self): self.x = 0. self.y = 0. self.z = 0. I thought in the first case, if one did a = Point(); a.x = 6 that from then on ANY new point ( b = Point() ) would be created with b.x being 6 -- because 'x' is a class attribute and nor a instance attribute !? This is obviously a beginners question - and I'm hopefully missing something. Thanks, Sebastian Haase On 4/3/07, Gael Varoquaux [EMAIL PROTECTED] wrote: You can do a script with a GUI front end, as described in the first chapter of my tutorial http://gael-varoquaux.info/computers/traits_tutorial/traits_tutorial.html . You can also build a complete interactive application, as described in the rest of the tutorial, but this is more work. If you have more questions about this approach feal free to ask. Gaël ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
Sebastian Haase wrote: Is enthought now defaulting to numpy ? Still set NUMERIX=numpy for now. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
On 4/4/07, Robert Kern [EMAIL PROTECTED] wrote: Sebastian Haase wrote: Hello Gael, Short question regarding your tutorial -- I'm very intrigued by traits and would like to use them too Why do you define e.g. the Point class like this: class Point(object): 3D Point objects x = 0. y = 0. z = 0. and not like this: class Point(object): 3D Point objects def __init__(self): self.x = 0. self.y = 0. self.z = 0. I thought in the first case, if one did a = Point(); a.x = 6 that from then on ANY new point ( b = Point() ) would be created with b.x being 6 -- because 'x' is a class attribute and nor a instance attribute !? No, setting a.x = 6 will set it on the instance, not the class. OK, but what is wrong with the first way !? I mean, it somehow seems not like it's usually done in Python ? Normally there is always a __init__(self) that sets up everything referring to self -- why is this tutorial doing it differently ? -Sebastian ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about standalone small software and teaching
Ok, I got another hopefully easy question: Why this: class Point(object): ... Instead of the style that's used in the Python tutorial in the 'classes' chapter: class Point: ... --bb On 4/5/07, Robert Kern [EMAIL PROTECTED] wrote: Sebastian Haase wrote: OK, but what is wrong with the first way !? I mean, it somehow seems not like it's usually done in Python ? Normally there is always a __init__(self) that sets up everything referring to self -- why is this tutorial doing it differently ? Because it makes the code more readable for the point it's trying to get across. The __init__ style code would be irrelevant detail detracting from the main point. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] question about standalone small software and teaching
Hello Dear All, I just have a question for all that uses python/numpy/scipy/matplotlib for making science. I use with no problem in my computer python+numpy+scipy+matplotlib and I'm very satisfied with them. I was a matlab user. I still not have unearthed the power ot python but I'm happy to use a programming language and not a metalanguage. When I gave people my software (in matlab) the all ask me if I could compile and create some interface. I tried to use matlab GUIs, succeded in creating, but then I had a lot of problems. Compiling not always worked. after compiling you have not a workspace and so I had to make all output as txt files... and so on. Now that I use python I'm again with the same problem. I create easy routines (for chemometrics) and then people ask me if I can make a standalone program with interface. I used orange and for NN it's surely one of the best, but I'm not good at programming widgets. Then I think about it, searched the web and didn't find anything. What I'm searching is something similar to labview :) At first I thought ... hey why people wat an interface, just use the console, and then after listening to their reason I have to agree. What do I generally do ? I have a matrix in txt, I apply my routines (a SVD, a PCA, a filter etc etc written in python), plot them (using maplotlib) and then I want an output. that's it. I started looking at various Qt etc. etc. but for me it's overhelming, because I think that the most important part should be dedicate to the routines creation and not to making a gui, compiling, etc. etc. I need simple command like people wants. grids, paste and copy, small working plots :) I mean I can get crazy with setting my program, importing etc. etc. but I also have to say that needs and claim about writing simple guis, common paste and copy etc should be considered from someone there (we wait for the help of some guru that makes things easier ;) thanks for reading the mail Giorgio ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion