diff COBRAxy/ras_generator.py @ 147:3fca9b568faf draft

Uploaded
author bimib
date Wed, 06 Nov 2024 13:57:24 +0000
parents 7e703e546998
children
line wrap: on
line diff
--- a/COBRAxy/ras_generator.py	Wed Nov 06 10:12:52 2024 +0000
+++ b/COBRAxy/ras_generator.py	Wed Nov 06 13:57:24 2024 +0000
@@ -12,7 +12,7 @@
 ERRORS = []
 ########################## argparse ##########################################
 ARGS :argparse.Namespace
-def process_args() -> argparse.Namespace:
+def process_args(args:List[str] = None) -> argparse.Namespace:
     """
     Processes command-line arguments.
 
@@ -61,8 +61,9 @@
         '-ra', '--ras_output',
         type = str,
         required = True, help = 'ras output')
+
     
-    return parser.parse_args()
+    return parser.parse_args(args)
 
 ############################ dataset input ####################################
 def read_dataset(data :str, name :str) -> pd.DataFrame:
@@ -647,7 +648,7 @@
     # csv rules need to be parsed, those in a pickle format are taken to be pre-parsed.
     return { line[0] : ruleUtils.parseRuleToNestedList(line[1]) for line in utils.readCsv(datFilePath) }
 
-def main() -> None:
+def main(args:List[str] = None) -> None:
     """
     Initializes everything and sets the program in motion based on the fronted input arguments.
     
@@ -656,7 +657,7 @@
     """
     # get args from frontend (related xml)
     global ARGS
-    ARGS = process_args()
+    ARGS = process_args(args)
     print(ARGS.rules_selector)
     # read dataset
     dataset = read_dataset(ARGS.input, "dataset")