[BioPython] Solved BioPython & Zope problem and a Bug?
Cristian S. Rocha
crocha at dc.uba.ar
Tue May 11 12:58:15 EDT 2004
Brad,
I tried to use the biopython in the cvs on zope but I had found my first
problem:
I'm working in Linux with Debian distribution, and the Zope deb
package is compiled for python2.2. That the reason I had choose to
compile Biopython with python2.2, but it's fail on tests! The Biopython
tests are using "enumerate" function but it's only work on python2.3. I
had to write the "enumerate" function to jump the problem. Can you
append these function to the CVS? I'm attaching my code in the email.
That's not the only problem with python2.2 compatibility, exists
other tests as test_Registry.py who use the "in" operator between
strings to check if exists substrings on assert functions. I had to
replace a lot of asserts to make it compatible with python2.2. For
example:
def t_embl(self):
"""Retrieval of EMBL records from various sources.
"""
embl_db = db["embl"]
for embl_location in embl_db.objs:
#if embl_location.name.find("xembl") == -1:
handle = embl_location[self.embl_id]
first_line = handle.read(40)
# ---
# assert self.embl_id in first_line, \
# (embl_location.name, first_line)
assert not first_line.find(self.embl_id) == -1, \
(embl_location.name, first_line)
I had a Warning about the "yield" keyword. Can you check it? That's
the warning line:
/biopython/build/lib.linux-i686-2.2/Bio/PDB/StructureAlignment.py:84:
Warning: 'yield' will become a reserved keyword in the future
I feel I will find more problems. I would like to submit my changes
to the cvs if you want. else, I must to check how to use Zope in
python2.3... ;)
Thanks,
Cristian.
El mar, 04-05-2004 a las 13:55, Brad Chapman escribió:
> Hi Cristian;
>
> > I could solve my problem with BioPython in Zope.
>
> Thanks for your work on this. I suspect there are not many people
> out there (myself included) working with Zope and Biopython, so I
> appreciate your work treading into unknown territory.
>
> > The main problem was
> > Zope can't import some functions defined in some modules. These modules
> > have other modules with relative imports and Zope can't import them.
>
> Okay, I guess the problem is that both Zope and Biopython are
> probably playing around with import hooks. I don't know enough about
> all of what Zope does to fix all of the problems, but I guess the
> best way is trial and error.
>
> > Bio.config.FormatRegistry.py have the following relative import:
> >
> > import _support
> >
> > I change it to:
> >
> > from Bio.config import _support
>
> Fixed.
>
> > I do the same with FormatIO.py with ReseekFile import.
>
> Where specifically are these problems and I can add the relevant
> full import? Do all relative imports need to be removed?
>
> > The second problem IS """Bio.MultiProc.copen""". I really don't know
> > why, but Zope begin an infinity loop when I ask for the symbol table of
> > the module. To solve these problem I commented the import on the
> > Bio.config._support module.
>
> Okay, I moved this import into the __call__ function where it is
> used. Hopefully that'll fix the import loops.
>
> Both of those changes are in CVS -- please let me know if that fixes
> things or if other changes are needed.
>
> Thanks again for the work!
> Brad
> _______________________________________________
> BioPython mailing list - BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython
--
Lic. Cristian S. Rocha.
<crocha at dc.uba.ar>
Departamento de Computacin. FCEyN. UBA.
Pabellon I. Cuarto 9.
Ciudad Universitaria.
(1428) Buenos Aires. Argentina.
Tel: +54-11-4576-3390/96 int 714
Tel/Fax: +54-11-4576-3359
Cel: 15-5-607-9192
More information about the BioPython
mailing list