diff --git a/.travis.yml b/.travis.yml index 500bede7..1132696b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,18 +4,18 @@ os: linux jobs: include: - - dist: bionic - python: "3.6" - dist: bionic python: "3.7" - dist: bionic python: "3.8" - - dist: xenial - python: "3.6" + - dist: bionic + python: "3.9" - dist: xenial python: "3.7" - dist: xenial python: "3.8" + - dist: xenial + python: "3.9" services: - postgresql diff --git a/machado/loaders/common.py b/machado/loaders/common.py index 3899aaf2..555654db 100644 --- a/machado/loaders/common.py +++ b/machado/loaders/common.py @@ -162,7 +162,7 @@ def retrieve_feature_id(accession: str, soterm: str) -> int: # feature.name try: return Feature.objects.get( - name=accession, type__cv__name="sequence", type__name=soterm + name__iexact=accession, type__cv__name="sequence", type__name=soterm ).feature_id except (MultipleObjectsReturned, ObjectDoesNotExist): pass @@ -170,14 +170,23 @@ def retrieve_feature_id(accession: str, soterm: str) -> int: # feature.dbxref.accession try: return Feature.objects.get( - dbxref__accession=accession, type__cv__name="sequence", type__name=soterm + dbxref__accession__iexact=accession, + type__cv__name="sequence", + type__name=soterm, ).feature_id except (MultipleObjectsReturned, ObjectDoesNotExist): pass # featuredbxref.dbxref.accession - return FeatureDbxref.objects.get( - dbxref__accession=accession, - feature__type__cv__name="sequence", - feature__type__name=soterm, - ).feature_id + try: + return FeatureDbxref.objects.get( + dbxref__accession__iexact=accession, + feature__type__cv__name="sequence", + feature__type__name=soterm, + ).feature_id + except ObjectDoesNotExist: + raise ObjectDoesNotExist("{} {} does not exist".format(soterm, accession)) + except MultipleObjectsReturned: + raise MultipleObjectsReturned( + "{} {} matches multiple features".format(soterm, accession) + ) diff --git a/setup.py b/setup.py index 1990670a..32fe1136 100644 --- a/setup.py +++ b/setup.py @@ -30,10 +30,11 @@ ], scripts=["bin/fixChadoModel.py"], install_requires=[ - "django==3.1.8", + "numpy>=1.19", + "django==3.1.12", "psycopg2-binary==2.8.6", - "biopython==1.78", - "obonet==0.2.6", + "obonet==0.3.0", + "biopython==1.79", "tqdm==4.47.0", "typing==3.7.4.3", "bibtexparser==1.2.0",