Posted
by
kdawsonon Friday June 25, 2010 @11:39AM
from the snakes-on-a-filing dept.

jcasman sends along this clip from PCWorld: "ActiveState has added three open source mathematics libraries to its ActivePython Python distribution that might interest financial and scientific computing markets, the company announced Thursday. The packages are being added, in part, to anticipate the demand that may arise from new proposed rules for the US financial community brought about by the US Securities and Exchange Commission. ... In April, the government agency posted a set of proposed rules for handling asset-backed securities that called for financial firms to disclose, along with their prospectus filings, the source code of the programs that generated the filings, as rendered in Python. The government agency will be accepting input about the proposed rule until August 2. The three libraries that are being added to the ActivePython package are NumPy, SciPy, and matplotlib."

Oops - that's embarassing. I just realized that the Python program must be those used to produce the actual filings. So the programs' fitness to purpose must have been already established. Presumably they don't loop forever, or at least only do so after producing the filings.

It is only irrelevant if all the computations you are performing are done by the libraries. I tried using python for data processing tasks, and it was unbearably slow despite the use of scipy. I think it was due in large part to poor I/O and bit-twiddling performance while reading/writing data files but I'm not sure. Anyway with the amount of time I spent optimizing code, I could have just written the damn thing in C to begin with. I just don't understand python's poor performance. All it's high level language features were implemented in LISP and ML decades ago with good performance, but python just can't seem to get it right

I don't think you understand. These things are used as any other python code. The magic is that C is the backend that actually crunches the numbers. You don't even have to know or care that C is used. All you know is you call the foo method in the bar module.

TFA and TFS fail to mention that SciPy, Numpy and Matplotlib have been added only to the Business, Enterprise, and OEM Editions of ActivePython. The Community Edition (the only one that's free) doesn't contain these libraries.

I use those packages on Windows without ActiveState... they are free downloads from their respective websites.http://www.scipy.org/Download --- NumPy and SciPyhttp://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/ --- MatPlotLibhttp://www.python.org/download/ --- Python

but while I was programming an important app, I accidently hit the space bar just before tabbing. Since this error wasn't visible on printouts or screen views, [...]

What, the glaring "IndentationError" exception that gets thrown as soon as you import the file didn't tip you off?

The situation you describe can never happen silently. I call bull$!7. Theoretically, it is possible to construct a situation where you would get a silent inconsistency, but this isn't it. I've programmed extensively in Python since '97 and never experienced problems due to indentation. In real life, this just isn't a problem.

But you can't blame them, I mean what sort of idiot language has whitespace signify blocks of code?

Well.... all of them do. How else would you find the blocks in a program? I know that many languages also use special tokens like { and } or "begin" and "end", but programmers still use the indentation to identify blocks even when it contradicts the tokens. The canonical example is something like:

if (some_test())....i = foo();....bar(i);
baz();

Perfectly valid code, so no compiler errors etc., but most programmers will read it as a an if-statement with a true-block containing two statements... (I had to use dots to get indentation since pre-tags do not seem to be understood...?!)

All the linux distributions I have used so far (SuSE, Mandriva, PCLInuxos, Ubuntu), all, have Numpy in their ready made packages. All you have to do is click to install it. To install SciPy, you download it, and run as installer. I don't know about matplotlib, but I suspect it as easy as SciPy.Thus, they are free.
But if you want to fund python related staff, then fine.

2 things
1) If random internet poster makes you not want to evaluate a tech you seriously need to grow a thicker skin
2) Auto indenting in python after the code is written is not particularly safe. In python Indentation serves the same function as { } in PHP or c, etc.
That being said, Emacs works reasonably well.
3) You would have found this out if you had googled python indentation:)

Grandparent thought you were joking because one of the special features of python is that it doesn't use brackets for statement grouping and instead uses indenting. Thus all working python programs must be properly indented. I guess you could still complain if someone doesn't use the number of indent spaces you like for each block, but I assume your big issue is the confusion of various indenting styles rather than just the size of the indent.

Is there any python IDE with this built in... anything that mimics the 'desktop' of Matlab?

Why not have a look at Geany [geany.org]? It's small, free and sweet (i.e. very usable), and it assists with editing code in a lot of programming languages.By the way, the key sequence you gave as example nicely increases indent one level in Geany. For Python, Geany will auto-indent some obvious things: indent after a line ending with ':', dedent after 'return', etc.