[Biopython-dev] Catching more error conditions in Bio.Entrez
Sean Davis
sdavis2 at mail.nih.gov
Wed Jul 2 11:18:43 UTC 2008
On Wed, Jul 2, 2008 at 6:33 AM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> Hello Michiel et al.,
>
> I've already added a few if statements to the end of
> Bio.Entrez._open() to catch a few errors I'd observed, and I've just
> found another example:
>
>>>> from Bio import Entrez
>>>> Entrez.efetch("nucleotide", id="fiction", rettype="fasta").read()
> '\n'
>>>> Entrez.efetch("nucleotide", id="fiction").read()
> '\n'
>
> This seems to happen for any invalid identifier. Are you happy for me
> to check for this as an error too? Are there any valid reasons to get
> back an empty dataset like this?
If the ability to use history is added, then an empty dataset could be
a valid return after an empty search. For id-based-searches, I'm not
sure I would raise an error for an empty set being returned anyway.
Just my $0.02.
Sean
> Also, I was wondering if we should raise a ValueError rather than
> IOError if we are fairly sure the problem is with the arguments rather
> than the network or the sever being unavailable.
>
> Peter
> _______________________________________________
> Biopython-dev mailing list
> Biopython-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython-dev
>
More information about the Biopython-dev
mailing list