Skip to content

Commit 898ca56

Browse files
committed
Add non_strict and verbose modes to pyard CLI.
```python ❯ scripts/pyard --gl "DQB1*03:276" -r lgx Typing Error: DQB1*03:276 is not valid GL String. DQB1*03:276 is not a valid Allele ❯ scripts/pyard --non-strict --gl "DQB1*03:276" -r lgx DQB1*03:01 ❯ scripts/pyard --non-strict --verbose --gl "DQB1*03:276" -r lgx DQB1*03:276 is not valid. Using DQB1*03:276N DQB1*03:01 ```
1 parent 3cd6e48 commit 898ca56

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

pyard/ard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"reduce_shortnull": True,
5555
"ping": False,
5656
"map_drb345_to_drbx": True,
57-
"verbose_log": True,
57+
"verbose_log": False,
5858
"ARS_as_lg": False,
5959
"strict": True,
6060
}

scripts/pyard

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,29 @@ if __name__ == "__main__":
7676
parser.add_argument(
7777
"--lookup-mac", dest="lookup_mac", help="Lookup MAC for an Allele List"
7878
)
79+
parser.add_argument(
80+
"--non-strict",
81+
dest="non_strict",
82+
action="store_true",
83+
help="Use non-strict mode",
84+
)
85+
parser.add_argument(
86+
"--verbose", dest="verbose", action="store_true", help="Use verbose mode"
87+
)
7988

8089
args = parser.parse_args()
8190

8291
imgt_version = get_imgt_version(args.imgt_version)
8392
data_dir = get_data_dir(args.data_dir)
84-
ard = pyard.init(imgt_version=imgt_version, data_dir=data_dir)
93+
94+
new_config = {}
95+
if args.non_strict:
96+
new_config["strict"] = False
97+
98+
if args.verbose:
99+
new_config["verbose_log"] = True
100+
101+
ard = pyard.init(imgt_version=imgt_version, data_dir=data_dir, config=new_config)
85102

86103
if args.version:
87104
version = ard.get_db_version()

0 commit comments

Comments
 (0)