Skip to content

Commit

Permalink
Merge pull request #246 from cokelaer/fix_uniprot_failedids
Browse files Browse the repository at this point in the history
Fix regression in uniprot module
  • Loading branch information
cokelaer authored Jan 2, 2023
2 parents 07577b6 + 8f96aff commit 4b05921
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ recursive-exclude doc *
recursive-exclude * __pycache__
recursive-exclude * *pyc
recursive-exclude .github *
recursive-exclude src/bioservices/attic *

2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ Changelog
========= ====================================================================
Version Description
========= ====================================================================
1.11.1 * Fix regression i uniprot.mapping
(https://github.com/cokelaer/bioservices/issues/245)
1.11.0 * Fix uniprot limitation of 25 results only (
* For developers: all services are now refactorised to use services
as an attribute rather than a parent class.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

_MAJOR = 1
_MINOR = 11
_MICRO = 0
_MICRO = 1
version = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
release = '%d.%d' % (_MAJOR, _MINOR)

Expand Down
2 changes: 1 addition & 1 deletion src/bioservices/intact.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def search(self, query, frmt="json", facets=None, first=None, number=None, filte
"""
self.devtools.check_param_in_list(frmt, ["pandas", "json"])
self.services.devtools.check_param_in_list(frmt, ["pandas", "json"])

# note that code format to be json, which is the only option so
# we can use pandas as a frmt without addition code.
Expand Down
4 changes: 2 additions & 2 deletions src/bioservices/uniprot.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,14 @@ def mapping(
if results != 500 and "results" in results:
total = int(self.services.last_response.headers["X-Total-Results"])
batches = results["results"]
fails = results["failedIds"]
fails = results.get("failedIds", [])

size = 25
for x in tqdm.tqdm(range(size, total, size), disable=not progress):
link = self._get_next_link(self.services.last_response.headers)
batch = self.services.http_get(link, frmt="json")
batches += batch["results"]
fails += results["failedIds"]
fails += results.get("failedIds", [])
return {"results": batches, "failedIds": fails}

else: # pragma: no cover
Expand Down
1 change: 1 addition & 0 deletions test/webservices/test_panther.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from bioservices.panther import Panther


Expand Down
5 changes: 5 additions & 0 deletions test/webservices/test_uniprot.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,8 @@ def test_get_df(uniprot):

def test_fasta(uniprot):
"Q9Y617" in uniprot.get_fasta(["Q9Y617-1"])


#https://github.com/cokelaer/bioservices/issues/245
def test_mapping_regression(uniprot):
uniprot.mapping("UniProtKB_AC-ID", "KEGG", "P43403,P123456")

0 comments on commit 4b05921

Please sign in to comment.