DSPRelated.com
Forums

OT: Code Examples

Started by Fred Marshall February 28, 2011
I'm interested in developing Python-based programs, including an 
engineering app. ... re-writing from Fortran and C versions.  One of the 
objectives would to be make reasonable use of the available structure 
(objects, etc.).  So, I'd like to read a couple of good, simple 
scientific-oriented programs that do that kind of thing.

Looking for links, etc.

Fred
On Feb 28, 6:03&#4294967295;pm, Fred Marshall <fmarshallxremove_th...@acm.org>
wrote:
> I'm interested in developing Python-based programs, including an > engineering app. ... re-writing from Fortran and C versions. &#4294967295;One of the > objectives would to be make reasonable use of the available structure > (objects, etc.). &#4294967295;So, I'd like to read a couple of good, simple > scientific-oriented programs that do that kind of thing. > > Looking for links, etc. > > Fred
The best place for you to start: http://numpy.scipy.org/ Numpy manual: http://www.tramy.us/numpybook.pdf
On 2/28/2011 8:14 AM, n00m wrote:
> On Feb 28, 6:03 pm, Fred Marshall<fmarshallxremove_th...@acm.org> > wrote:
> The best place for you to start: http://numpy.scipy.org/ > > Numpy manual: http://www.tramy.us/numpybook.pdf
OK Thanks! Fred
Fred Marshall wrote:

> I'm interested in developing Python-based programs, including an > engineering app. ... re-writing from Fortran and C versions. One of the > objectives would to be make reasonable use of the available structure > (objects, etc.). So, I'd like to read a couple of good, simple > scientific-oriented programs that do that kind of thing.
Why Python? I really can't understand the rush of every man and his dog to Python. Its not that I'm a stick in the mud stuck with C and C++, rather that I used Python for a number of years from 1998 to 2004 and rejected it in favour of strict statically typed functional langauges like Ocaml and Haskell. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
On 01/03/2011 08:43, Erik de Castro Lopo wrote:
> Fred Marshall wrote: > >> I'm interested in developing Python-based programs, including an >> engineering app. ... re-writing from Fortran and C versions. One of the >> objectives would to be make reasonable use of the available structure >> (objects, etc.). So, I'd like to read a couple of good, simple >> scientific-oriented programs that do that kind of thing. > > Why Python? I really can't understand the rush of every man and > his dog to Python. > > Its not that I'm a stick in the mud stuck with C and C++, rather > that I used Python for a number of years from 1998 to 2004 and > rejected it in favour of strict statically typed functional > langauges like Ocaml and Haskell. >
My understanding is/was that Guido originally proposed Python as the replacement for BASIC; i.e. to be the new first language students at school would be exposed to. So rather than compare it to C and C++, I suppose one should, strategically speaking, compare it to Visual Basic and/or Java. The other aspect is purely pragmatic - it has bindings for tk, MIDI and audio (and of course Csound as you know), which adds up to a fairly hefty scripting package complete with GUI design options - great for "knocking up stuff quickly". But - I am ~still~ caught out by the semantic significance of indenting. Looks OK enough on paper, but doing it interactively is another matter. Richard Dobson
Erik de Castro Lopo <erikd@mega-nerd.com> writes:
> Why Python? I really can't understand the rush of every man and > his dog to Python.
Are you trolling? Anyway, try googling "evil mangler" and ask why it wasn't done in Haskell. Same idea.
On Mar 1, 3:03&#4294967295;am, Fred Marshall <fmarshallxremove_th...@acm.org>
wrote:
> I'm interested in developing Python-based programs, including an > engineering app. ... re-writing from Fortran and C versions. &#4294967295;One of the > objectives would to be make reasonable use of the available structure > (objects, etc.). &#4294967295;So, I'd like to read a couple of good, simple > scientific-oriented programs that do that kind of thing. > > Looking for links, etc. > > Fred
you could try searching here http://pypi.python.org/pypi. I had a look for models, but didn't find anything in particular. But would be really useful if anyone does know of some good examples
Paul Rubin wrote:

> Erik de Castro Lopo <erikd@mega-nerd.com> writes: > > Why Python? I really can't understand the rush of every man and > > his dog to Python. > > Are you trolling?
Definitely not. As I said I used Python for a number of years and ditched it in favour of Ocaml and Haskell. The ease of development and high level language features of Python look really good if all you know is C, C++ and Java. The big difference Python and those three languages is that there are a huge number of classes of bugs which are run time errors in Python but compile time errors in C/C++/Java. I will always chose compile time errors over run time errors.
> Anyway, try googling "evil mangler"
I know what the "evil mangler" is. It was called that because it threw away all the principles of good software design in favour of expediency. GHC now has a new LLVM backend which does not depend on the evil mangler and I strongly suspect that the backend which uses the evil mangler will be dumped in the next year or two.
> and ask why it wasn't done in Haskell. Same idea.
Expediency over common sense? Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Paul Rubin wrote:

> Erik de Castro Lopo <erikd@mega-nerd.com> writes: > > Why Python? I really can't understand the rush of every man and > > his dog to Python. > > Are you trolling?
All my responses to this thread are really mean for comp.dsp, not for comp.lang.python. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Am Mon, 28 Feb 2011 08:03:01 -0800 schrieb Fred Marshall:

> I'm interested in developing Python-based programs, including an > engineering app. ... re-writing from Fortran and C versions. One of the > objectives would to be make reasonable use of the available structure > (objects, etc.). So, I'd like to read a couple of good, simple > scientific-oriented programs that do that kind of thing. > > Looking for links, etc. > > Fred
An execellent book in this domain is "Python Scripting for Computational Science" by Hans Petter Langtangen Springer, ISBN 3-450-43508-5 HTH. Martin