Joe Harrington | 1 Mar 01:32
Picon

Re: NumPy in Teaching

Hi Steve,

I have taught Astronomical Data Analysis twice at Cornell using IDL,
and I will be teaching it next Fall at UCF using NumPy.  Though I've
been active here in the recent past, I'm actually not a regular NumPy
user myself yet (I used Numeric experimentally for about 6 months in
1997), so I'm a bit nervous.  There isn't the kind of documentation
and how-to support for Numpy that there is for IDL, though our web
site is a start in that direction.  One thought I've had in making the
transition easier is to put up a syntax and function concordance,
similar to that available for MATLAB.  I thought this existed.  Maybe
Perry can point me to it.  Just adding a column to the MATLAB one
would be fine.

My syllabi (there are undergrad and grad versions) are at:

Cornell courses (undergrad only):
http://physics.ucf.edu/~jh/ast/ast234-2003/
http://physics.ucf.edu/~jh/ast/ast234-2004/

UCF course (4xxx is undergrad, 5xxx is grad, numbers not yet assigned):
http://physics.ucf.edu/~jh/ast/dacourse/

The goal of the course is for students to go out and do research with
faculty as soon as they're done, and be useful enough to be included
on papers.  Rather than the usual (and failing) "just do what I do"
model, in which physics students learn to program badly and in
FORTRAN77 from their professors, I teach programming from a CS point
of view, focusing on good top-down design and bottom-up construction
(indentation, documentation, sensible naming, testing, etc.).  I teach
(Continue reading)

Frank Palazzolo | 1 Mar 03:00
Picon

Robert Kern's pyCA

Hello,

Has anyone tried to port Robert Kern's pyCA (Geometric Algebra) code to 
use the new NumPy?  It uses a combination of Numeric and NumPy at 
present - as seen here:

http://mail.python.org/pipermail/python-list/2000-August/050443.html

I might have a go at it myself...just thought I'd find out if someone 
did it already.  And I noticed that Robert posts here :)

I wonder if there is interest in having this as part of SciPy?

Thanks,
Frank
Steven H. Rogers | 1 Mar 05:14
Favicon

Re: NumPy in Teaching

Hi Joe:

Thanks for the comprehensive response.  I'll post the results to the 
lists when I've compiled them. 

# Steve
Robert Kern | 1 Mar 05:20
Picon
Gravatar

Re: Robert Kern's pyCA

Frank Palazzolo wrote:
> Hello,
> 
> Has anyone tried to port Robert Kern's pyCA (Geometric Algebra) code to 
> use the new NumPy?

I made an initial pass at it:

  http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/clifford/

That's a Mercurial repository[1], so after installing Mercurial, you can make a
local branch like so:

  $ hg clone http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/clifford/

[1] http://www.selenic.com/mercurial/wiki

--

-- 
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
Steven H. Rogers | 1 Mar 05:30
Favicon

Re: NumPy in Teaching

Thanks Ryan.  Matlab  _is_ rather pervasive in engineering, but I expect 
NumPy/SciPy to make inroads as the rough edges are smoothed out. 

Regards,
Steve
Joachim Dahl | 1 Mar 08:38
Picon

Re: scipy and cvxopt



On 2/28/07, Travis Oliphant <oliphant <at> ee.byu.edu> wrote:
Emin.shopper Martinian.shopper wrote:

> Dear Experts,
>
> I need to solve some quadratic programs (and potentially other
> nonlinear programs). While scipy.optimize.fmin_cobyla seems like it
> can do this, it seems orders of magnitude slower than cvxopt. Are
> there plans to merge/include cvxopt in scipy or otherwise improve
> scipy's quadratic/nonlinear constrained optimization routines?


Yes, eventually.  I have talked to the author of CVXOPT at NIPS 2006.
The plan is to move NumPy's matrix object into C and move CVXOPTs
implementation over to use it, possibly integrating the cvxopt
algorithms into at least a scikits library (of GPL code).

That would be great!  We're considering different a license also.

Porting CVXOPT to Numpy/Scipy would require sparse matrices also - preferably
implemented so that there's not much difference between dense and sparse matrices from the user's perspective.  The sparse matrix class in SciPy looks nice,  but it appears to
"behave" different from a dense matrix wrt. to indexing, assignments, creation etc;
although it's not essential, it would make a CVXOPT port easier if some of the differences between dense and sparse matrices were also ironed out when Travis revamps the
Numpy matrix object.

Please let me know if there's anything I can do to help in process.

Joachim
 

But, I won't have time for that until April or May.

-Travis

_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user

_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user
Michael Williams | 1 Mar 11:45
Picon
Picon

Re: NumPy in Teaching

On Tue, Feb 27, 2007 at 09:05:58PM -0700, Steven H. Rogers wrote:
> I'm doing an informal survey on the use of Array Programming Languages 
> for teaching.  If you're using NumPy in this manner I'd like to hear 
> from you.  What subject was/is taught, academic level, results, lessons 
> learned, etc.

If Numeric counts, I used that back in 2002 as part of an introductory
programming course I wrote for the Department of Physics at Oxford. We
really only used to to provide an element-wise array method.

Brief introduction: http://pentangle.net/python/pyzine.php

The course (aka "Handbook") and report on the course's successes and
failures: http://pentangle.net/python/

-- Mike
Nils Wagner | 1 Mar 12:59
Picon
Favicon

fmin_cobyla

Hi all,

Is it possible to obtain more return values wrt to fmin_cobyla ?
The output is currently limited to the minimum (if any exists).

I am interested in

      fopt -- the value of f(xopt).
      func_calls -- the number of function_calls.
      allvecs  --  if retall then this vector of the iterates is returned

Nils
Gary Ruben | 1 Mar 14:07
Picon

Re: NumPy in Teaching

Hi Steven,

Last year I helped out in teaching some basic programming with no 
prerequisites to 3rd year undergrad physics students at Monash 
University. It was really a 1st or 2nd year level course, but we had a 
wide spectrum of background experience levels - from no programming 
experience to proficient in C++. To deal with this variation in 
experience, we created some basic and some more advanced teaching labs. 
We divided the subject in half, giving a single C lecture first, 
followed by a few C labs, then a single Python lecture followed by a few 
Python labs; a deliberately chosen order and obviously very ambitious.

Our department is fairly IDL-centric, but Python's advantage of being 
free and its greater general applicability/flexibility was accepted by 
the course coordinator as sufficient reason to teach it. The hope is to 
get continuing 4th year honours students comfortable with a language for 
their 4th year physics projects.

We took the view - shared by colleagues in the Computer Science dept. - 
that getting the students to struggle with pointers and see the C-syntax 
would be good for their character :-) and that numpy would allow much 
higher level tasks to be attempted at an early stage and would get them 
used to using an array-processing mindset. I think that, since some of 
the students had prior C experience, they were able to help each other a 
bit more in the C labs. We found that we were busier answering questions 
in the Python labs as a result.

We had them create arrays in C, populating them with sinc functions to 
get them to deal with division by zero etc. and repeat the exercise in 
Python with numpy. We had them do some file i/o in both languages - I 
used scipy.io read_array and write_array to read data printf'ed by their 
C code. We did some fft-based filtering with Python and used pylab to 
view the results. We used Enthought Python with "ipython -pylab" shells 
and Idle as the editor. One lesson learned is that I tried to be a bit 
too ambitious with Python - they struggled with trying to figure out how 
to use functions. The labs were written as a mixture of "modify this 
example" code and "find the function which does this" - they found the 
latter too hard because the number of functions in numpy/scipy is a bit 
overwhelming and not easily navigable for the uninitiated.

We'll be re-running this course in a few weeks and perhaps introducing a 
physics modelling/numerical methods subject (perhaps language-neutral) 
later in the year. It may also be a prerequisite for some of the 3rd 
year astronomical data processing labs currently being written.

Gary R.

Steven H. Rogers wrote:
> I'm doing an informal survey on the use of Array Programming Languages 
> for teaching.  If you're using NumPy in this manner I'd like to hear 
> from you.  What subject was/is taught, academic level, results, lessons 
> learned, etc.
> 
> Regards,
> Steve
Alexander Michael | 1 Mar 14:19
Picon

Re: Using SciPy/NumPy optimization THANKS!

On 2/28/07, Brandon Nuttall <bnuttall <at> uky.edu> wrote:
> Folks,
>
> Thanks to Alok Singhal and Robert Kern I have not only learned a great deal
> about SciPy and NumPy, but I have code that works. Thanks for the tip on
> not looping; it does make cleaner code. I have two issues: 1) there must be
> a better way to convert a list of data pairs to two arrays, 2) I'm not sure
> of a graceful way to transition from one plot to the next and then close.
>

To add to the cacophony of coding and style suggestions. The <>
operator is likely to be removed in the future, so you should use
'!='. My personal preference would be to move the plotting
functionality to a method so that initializing the data is separate
from acting on the data. I find this to be a helpful distinction as I
usually don't want to plot at the time of construction, but your
mileage may vary. Lastly, you can wrap the non-plotting portion of the
test function into a doctest
(<http://www.python.org/doc/lib/module-doctest.html>) which would then
both serve as an example in the code and as a correctness test which
is easy to check when other things change, like upgrades to numpy and
scipy. I find this to be immensely helpful.

Have fun!
Alex

Gmane