Skip to content

Commit 82a944e

Browse files
committed
Support for Python 3.12
- Upgrade Pandas to 2.2.2 - Update other dependencies to the latest - Fix API change with the new pandas version - Fix unit tests (override addDuration)
1 parent 3fd5319 commit 82a944e

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

pyard/data_repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def generate_ard_mapping(db_connection: sqlite3.Connection, imgt_version) -> ARS
9898
# filter out the mg with count > 1, leaving only duplicates
9999
# take the index from the 2d version the data frame, make that a column
100100
# and turn that into a list
101-
multiple_g_list = mg[mg > 1].reset_index()["index"].to_list()
101+
multiple_g_list = mg[mg > 1].index.to_list()
102102

103103
# Keep only the alleles that have more than 1 mapping
104104
dup_g = (
@@ -111,7 +111,7 @@ def generate_ard_mapping(db_connection: sqlite3.Connection, imgt_version) -> ARS
111111

112112
# multiple lgx
113113
mlgx = df_g_group.drop_duplicates(["2d", "lgx"])["2d"].value_counts()
114-
multiple_lgx_list = mlgx[mlgx > 1].reset_index()["index"].to_list()
114+
multiple_lgx_list = mlgx[mlgx > 1].index.to_list()
115115

116116
# Keep only the alleles that have more than 1 mapping
117117
dup_lgx = (

requirements-dev.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
allure-behave==2.9.45
2-
flake8==4.0.1
1+
allure-behave==2.13.5
2+
flake8==7.0.0
33
bump2version==1.0.1
4-
coverage==6.3.2
5-
wheel==0.38.1
6-
pre-commit==2.18.1
4+
coverage==7.5.3
5+
wheel==0.43.0
6+
pre-commit==3.7.1

requirements-tests.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
behave==1.2.6
2-
PyHamcrest==2.0.2
3-
pytest==7.1.2
2+
PyHamcrest==2.1.0
3+
pytest==8.2.2

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
toml==0.10.2
2-
numpy==1.24.3
3-
pandas==1.5.3
2+
pandas==2.2.2

tests/test_pyard.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def setUpClass(cls) -> None:
4747
cls.db_version = "3440"
4848
cls.ard = pyard.init(cls.db_version, data_dir="/tmp/py-ard")
4949

50+
def addDuration(self, test, elapsed): # Required for Python >= 3.12
51+
pass
52+
5053
def test_no_mac(self):
5154
self.assertEqual(self.ard.redux("A*01:01:01", "G"), "A*01:01:01G")
5255
self.assertEqual(self.ard.redux("A*01:01:01", "lg"), "A*01:01g")

tests/test_smart_sort.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class TestSmartSort(unittest.TestCase):
2828
def setUp(self) -> None:
2929
super().setUp()
3030

31+
def addDuration(self, test, elapsed): # Required for Python >= 3.12
32+
pass
33+
3134
def test_same_comparator(self):
3235
allele = "HLA-A*01:01"
3336
self.assertEqual(smart_sort_comparator(allele, allele), 0)

0 commit comments

Comments
 (0)