[SciPy-dev] help with plot directive in scipy.stats.tutorial

josef.pktd@gmai... josef.pktd@gmai...
Wed Aug 26 14:21:44 CDT 2009

On Tue, Aug 25, 2009 at 9:10 PM, Ralf
Gommers<ralf.gommers@googlemail.com> wrote:
> On Tue, Aug 25, 2009 at 4:39 PM, <josef.pktd@gmail.com> wrote:
>> Since the stats.tutorial has now been merged into svn, I would like to
>> clean up the plot directives. When I wrote this initially, I didn't
>> realize that the plot commands do not have access to previously
>> defined variables.
>> I would like to replace the current code with plot directives using
>> script files instead of the inline plot directive. Because, I'm
>> currently not able or setup to build the docs, I would like to know if
>> this is ok or whether someone can test this.
> Hi Josef, I can't answer your question but if it works it seems like a clean
> solution.
> If you are cleaning up those plot directives would you mind using the
> pep8.py script? I read the stats tutorial before and I like the content, but
> it would be much more readable if the lines were <80 characters and the
> whitespace issues were fixed. I tried it on one of your attached scripts and
> it catches quite a few errors:
> ralf@ralf-desktop:~/Desktop$ python pep8.py --repeat normdiscr_plot2.py
> normdiscr_plot2.py:10:27: E231 missing whitespace after ','
> normdiscr_plot2.py:16:51: E231 missing whitespace after ','
> normdiscr_plot2.py:18:1: W291 trailing whitespace
> normdiscr_plot2.py:23:2: E231 missing whitespace after ','
> normdiscr_plot2.py:24:27: E231 missing whitespace after ','
> normdiscr_plot2.py:25:13: E231 missing whitespace after ','
> normdiscr_plot2.py:26:13: E231 missing whitespace after ','
> normdiscr_plot2.py:27:13: E231 missing whitespace after ','
> normdiscr_plot2.py:28:13: E231 missing whitespace after ','
> normdiscr_plot2.py:29:45: E222 multiple spaces after operator
> normdiscr_plot2.py:39:80: E501 line too long (83 characters)
> normdiscr_plot2.py:39:58: E231 missing whitespace after ','
> normdiscr_plot2.py:43:26: E202 whitespace before ')'
> normdiscr_plot2.py:44:12: E201 whitespace after '('
> There is more that the script does not catch, like whitespace issues around
> '=' and operators, but it definitely helps.
> Thanks,
> Ralf
>> The attached files are my original scripts, I haven't really reviewed
>> it just checked that they work.
>> Thanks,
>> Josef
>> .. plot:: examples/normdiscr_plot1.py
>>   :align: center
>>   :include-source: 0
>> .. plot:: examples/normdiscr_plot2.py
>>   :align: center
>>   :include-source: 0

I fixed some of the whitespace problems and checked it into svn in
revision 5910, and the stats.tutorial is open for editing, corrections
and review.

I finally tried to build the scipy docs again, and it works on Windows
without any problems for html and htmlhelp.

Two steps: I upgraded to the sphinx trunk (of last week), and copied a
generic make.bat (from statsmodels) into the doc directory
and "make html",  "make htmlhelp" and I have new docs.

Thanks to Pauli and whoever else helped getting the numpy/scipy build
process fully integrated with or supported by sphinx.

so revision 5910 is tested for correct build.

However, the only problem that I found so far, is that the two scripts
 examples/normdiscr_plot1.py and  examples/normdiscr_plot2.py  are not
copied to the build version. I don't know what the mechanism is to
copy script files or attachments into the build directories.


BTW: sphinx now also builds qthelp files, if anyone is interested.

More information about the Scipy-dev mailing list