Skip to content

Add support for passing sets to Entrez.efetch() - #1697

Closed
austinv11 wants to merge 3 commits into
biopython:masterfrom
Celmatix:master
Closed

austinv11 wants to merge 3 commits into
biopython:masterfrom
Celmatix:master

Conversation

@austinv11

Copy link
Copy Markdown
Contributor

I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.

I have read the CONTRIBUTING.rst file and understand that AppVeyor and
TravisCI will be used to confirm the Biopython unit tests and flake8 style
checks pass with these changes.

I have added my name to the alphabetical contributors listings in the files
NEWS.rst and CONTRIB.rst as part of this pull request, am listed
already, or do not wish to be listed. (This acknowledgement is optional.)

@austinv11
austinv11 requested a review from mdehoon as a code owner June 27, 2018 16:12
@codecov

codecov Bot commented Jun 27, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #1697 into master will increase coverage by 0.03%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1697      +/-   ##
=========================================
+ Coverage   85.57%   85.6%   +0.03%     
=========================================
  Files         327     331       +4     
  Lines       50056   50092      +36     
=========================================
+ Hits        42833   42879      +46     
+ Misses       7223    7213      -10
Impacted Files Coverage Δ
Bio/Entrez/__init__.py 49.26% <0%> (-0.37%) ⬇️
Bio/Phylo/PAML/yn00.py 87.34% <0%> (-0.97%) ⬇️
Bio/Align/__init__.py 84.57% <0%> (-0.88%) ⬇️
Bio/Phylo/PAML/codeml.py 89.71% <0%> (-0.76%) ⬇️
Bio/Phylo/PAML/baseml.py 86.27% <0%> (-0.73%) ⬇️
Bio/SeqIO/InsdcIO.py 94.61% <0%> (-0.1%) ⬇️
Bio/Pathway/Rep/__init__.py 100% <0%> (ø) ⬆️
Bio/SwissProt/__init__.py 92.66% <0%> (ø) ⬆️
Bio/Sequencing/Applications/_samtools.py 100% <0%> (ø) ⬆️
Bio/PDB/PDBList.py 16.66% <0%> (ø) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 109604b...5172c44. Read the comment docs.

@peterjc

peterjc commented Jun 29, 2018

Copy link
Copy Markdown
Member

Accepting a set seems like a bad idea to me in that you have no control over the order the records will be requested in. Does this not matter in your use case? Should we sort the set entries for reproducibility?

Separately, could you add a test for this (maybe modify one of the existing tests using a list to use a set instead)?

Note that TravisCI/AppVeyor are setup to skip the online only tests, so will not be checking your work here.

@mdehoon

mdehoon commented Jun 30, 2018

Copy link
Copy Markdown
Contributor

I'm OK with this, but we could generalize it further, as in

    try:
         ids = ",".join(ids)
    except TypeError:
         if isinstance(ids, int):
            ids = str(ids)

@austinv11

Copy link
Copy Markdown
Contributor Author

Sorry, I was away.

@peterjc Providing a set implies that the user doesn't care about the order. So I don't think it matters.

But I will be add the test and @mdehoon's suggestion when I get a chance

@peterjc

peterjc commented Jul 9, 2018

Copy link
Copy Markdown
Member

I'm happy - over to @mdehoon

P.S. @austinv11 are you happy to be named in NEWS.rst for the next release too?

@austinv11

Copy link
Copy Markdown
Contributor Author

Sure I would be happy to be named in the NEWS.rst file.

@mdehoon

mdehoon commented Jul 10, 2018

Copy link
Copy Markdown
Contributor

@austinv11 We still need to raise an exception if ids is not an int.

@austinv11

Copy link
Copy Markdown
Contributor Author

@mdehoon So do you want me to convert strings to ints and back to strings again to ensure that they are ints?

@mdehoon

mdehoon commented Jul 18, 2018

Copy link
Copy Markdown
Contributor

@austinv11 No, but in the section

    try:
        ids = variables["id"]
    except KeyError:
        pass
    else:
        try:
            ids = ",".join(ids)
        except TypeError:
            if isinstance(ids, int):
                ids = str(ids)

we need an else clause, like this:

    try:
        ids = variables["id"]
    except KeyError:
        pass
    else:
        try:
            ids = ",".join(ids)
        except TypeError:
            if isinstance(ids, int):
                ids = str(ids)
            else:
                # raise an exception

@austinv11

Copy link
Copy Markdown
Contributor Author

@mdehoon I have made the requested changes

@peterjc

peterjc commented Aug 15, 2018

Copy link
Copy Markdown
Member

@mdehoon are you happy so merge this? Does it need anything in the docstring about the lack of any explicit set-order and thus the results order?

@peterjc

peterjc commented Jan 24, 2020

Copy link
Copy Markdown
Member

I'll rebase this and merge it outside of GitHub (can't update this branch).

peterjc added a commit that referenced this pull request Jan 24, 2020
Previous commits from pull request #1697.
@peterjc

peterjc commented Jan 24, 2020

Copy link
Copy Markdown
Member

Changes applied, thank you!

@peterjc peterjc closed this Jan 24, 2020
@peterjc peterjc mentioned this pull request Jan 24, 2020
3 tasks done
@MarkusPiotrowski MarkusPiotrowski mentioned this pull request Feb 18, 2020
3 tasks done
peterjc added a commit to peterjc/biopython that referenced this pull request Jul 30, 2020
peterjc added a commit to peterjc/biopython that referenced this pull request Jul 30, 2020
peterjc added a commit that referenced this pull request Aug 23, 2020
Original author Jeffrey Chang, named copyright holders,
and other contributors tracked with version control have
all agreed:

 - Andrew Dalke (@adalke)
   http://mailman.open-bio.org/pipermail/biopython-dev/2013-August/019941.html
 - Austin Varela (@austinv11)
   #1697
 - Carlos Pena (@carlosp420)
   #898 (comment)
 - chrismit (@Chris7)
   #898 (comment)
 - Christian Brueffer (@cbrueffer)
   #898 (comment)
 - Connor T. Skennerton (@ctSkennerton)
   #898 (comment)
 - Edward Liaw (@edliaw)
   #898 (comment)
 - Eric Rasche (@erasche)
   #898 (comment)
 - Francesco Gastaldello (@Gasta88)
   #1063
 - Francisco Pina-Martins (@StuntsPT)
   #583 (comment)
 - Jacek Śmietański (@dadoskawina)
   #898 (comment)
 - jchang (@jefftc)
   #898 (comment)
 - João D Ferreira (@jdferreira)
   #898 (comment)
 - Mark Amery (@ExplodingCabbage)
   #2165
 - Markus Piotrowski (@MarkusPiotrowski)
   #898 (comment)
 - Michiel de Hoon (@mdehoon)
   #898 (comment)
 - Peter Cock (@peterjc)
   #898 (comment)
 - Sergei Lebedev (@superbobry)
   #898 (comment)
 - Sergio Valqui (@svalqui)
   #1749
 - Sujan Dulal (@Dsujan)
   #2430
 - Travis Wrightsman (@twrightsman)
   #898 (comment)
 - Yi Hsiao (@hsiaoyi0504)
   #1869
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants