[Biopython-dev] [Bug 2711] GenomeDiagram.py: write() and write_to_string() are inefficient and don't check inputs

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Dec 23 09:58:31 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2711





------- Comment #13 from bsouthey at gmail.com  2008-12-23 04:58 EST -------
(In reply to comment #6)
> (In reply to comment #2)
> > *** Bug 2710 has been marked as a duplicate of this bug. ***
> > 
> 
> (In reply to comment #0)
> > test_GenomeDiagram fails because the renderPM module is not part of standard
> > install of reportlab, at least under Linux. 
> 
> That's odd - renderPM is in the source for ReportLab 2.2.  Are you using an
> up-to-date version?  It seems to install well enough on our 64-bit Linux box
> from the ReportLab source.



I can not check this as I am away from my system. As I recall, the Python code
for accessing this library is provided with the standard install as there is a
renderPM.py file. But that is just a wrapper to some C code found in the
rl_addons directory. So it is a big no that renderPM is available unless you
actually build the C sources or download the binaries (only valid for Windows).

According to the website
http://www.reportlab.org/subversion.html
"
It will create subdirectories for reportlab, which is an importable
python package, and rl_addons which contains the C extensions. The
latter need building with the contained setup script, but can also be
downloaded in pre-built form from our downloads page. They rarely
change.
"

What did you actually install?
In particular where was _renderPM built?
Basically we need to document this as there appears to be different ways to
install reporlab (may also be version or svn related).

> 
> > I consider that the renderPM module should not be required so
> > Graphics/GenomeDiagram/Diagram.py needs to be rewritten to avoid using the
> > renderPM module when it is not available. 
> 
> renderPM is how raster graphics are drawn, so is, I'm afraid, a necessary part
> of GenomeDiagram's functionality.

No problem then, but you must provide a test for the presence and functionality
of it in the actual code as well as the biopython tests.

> 
> I prefer your alternative suggestion of making it a 'dynamic' import, but even
> then I think that the inconvenience of preparing the diagram, only to find out
> at the last possible stage that you can't draw it because you're missing the
> library, is worse than getting the error message upfront.  Not that this should
> be a problem, since renderPM is part of the main ReportLab source, now.  YMMV
> though, and I'm happy for the code to conform to the Biopython house style.
> 
> > The installation documentation needs to include something about needing the
> > renderPM for JPG, BMP, GIF, PNG, TIFF or TIFF outputs.
> > 
> > There must be a test for the presence of the renderPM module.
> 
> I'm not convinced of the value of this, as renderPM is part of the current
> ReportLab source installation.
> 

My understanding is that this statement is not completely true.  But I would
like confirmation either way. There may also be allowance for windows
installations especially non-source ones but I can not check those.


Bruce


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list