Skip to content

Commit a0821b9

Browse files
authored
Merge pull request #315 from pbashyal-nmdp/default_redux_is_lgx
Default to `lgx` redux
2 parents 69edffd + 17690fa commit a0821b9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pyard/ard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def _sorted_unique_gl(self, gls: List[str], delim: str) -> str:
363363
)
364364

365365
@functools.lru_cache(maxsize=DEFAULT_CACHE_SIZE)
366-
def redux(self, glstring: str, redux_type: VALID_REDUCTION_TYPES) -> str:
366+
def redux(self, glstring: str, redux_type: VALID_REDUCTION_TYPES = "lgx") -> str:
367367
"""
368368
Does ARD reduction with gl string and reduction type
369369

tests/test_pyard.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,17 @@ def test_is_null(self):
206206
self.ard.is_null(allele), msg="MACs shouldn't be called as Nulls"
207207
)
208208

209+
210+
def test_default_redux_is_lgx(self):
211+
allele = "A*24:BKKPV+A*26:03^B*15:BKNTS+B*15:07"
212+
lgx_redux = self.ard.redux(allele, "lgx")
213+
default_redux = self.ard.redux(allele)
214+
self.assertEqual(lgx_redux, default_redux, msg="Default redux should be lgx")
215+
216+
209217
def test_mac_is_reversible(self):
210218
mac_code = "A*68:AJEBX"
211219
expanded_mac = self.ard.expand_mac(mac_code)
212220
lookup_mac = self.ard.lookup_mac(expanded_mac)
213221
self.assertEqual(mac_code, lookup_mac, msg="MACs should be reversible")
222+

0 commit comments

Comments
 (0)