diff --git a/api-spec.yaml b/api-spec.yaml index debe488..d46c27d 100644 --- a/api-spec.yaml +++ b/api-spec.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: ARD Reduction description: Reduce to ARD Level - version: "0.9.0" + version: "0.9.1" servers: - url: 'http://localhost:8080' tags: diff --git a/pyard/__init__.py b/pyard/__init__.py index 1df241a..7842b85 100644 --- a/pyard/__init__.py +++ b/pyard/__init__.py @@ -25,4 +25,4 @@ from .blender import blender as dr_blender __author__ = """NMDP Bioinformatics""" -__version__ = "0.9.0" +__version__ = "0.9.1" diff --git a/pyard/data_repository.py b/pyard/data_repository.py index 1a4afe6..289f854 100644 --- a/pyard/data_repository.py +++ b/pyard/data_repository.py @@ -20,10 +20,13 @@ # > http://www.fsf.org/licensing/licenses/lgpl.html # > http://www.opensource.org/licenses/lgpl-license.php # +import sys import copy from collections import namedtuple import functools import sqlite3 +from urllib.error import HTTPError + import pandas as pd from . import db @@ -334,10 +337,21 @@ def generate_alleles_and_xx_codes_and_who( if imgt_version == "Latest": allele_list_url = f"{IMGT_HLA_URL}Latest/Allelelist.txt" else: + if imgt_version == "3130": + # 3130 was renamed to 3131 for Allelelist file only 🤷🏾‍ + imgt_version = "3131" allele_list_url = ( f"{IMGT_HLA_URL}Latest/allelelist/Allelelist.{imgt_version}.txt" ) - allele_df = pd.read_csv(allele_list_url, header=6, usecols=["Allele"]) + + try: + allele_df = pd.read_csv(allele_list_url, header=6, usecols=["Allele"]) + except HTTPError as e: + print( + f"Failed importing alleles for version {imgt_version} from {allele_list_url}", + file=sys.stderr, + ) + sys.exit(1) # Create a set of valid alleles # All 2-field, 3-field and the original Alleles are considered valid alleles diff --git a/setup.cfg b/setup.cfg index d9e5227..8acf945 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.9.0 +current_version = 0.9.1 commit = True tag = True @@ -19,10 +19,4 @@ replace = version: "{new_version}" universal = 1 [flake8] -exclude = - venv, - .git, - __pycache__, - build, - dist, - docs +exclude = venv, .git, __pycache__, build, dist, docs diff --git a/setup.py b/setup.py index 3277fa9..2643ade 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ setup( name="py-ard", - version="0.9.0", + version="0.9.1", description="ARD reduction for HLA with Python", long_description=readme + "\n\n" + history, long_description_content_type="text/markdown",