-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_generator.py
31 lines (22 loc) · 1.02 KB
/
test_generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import inspect
import os
import sys
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import utilities as ut
def main(args):
# Argument parsing
parser = ut.ArgParser(description='Generate a random array and save it to a file.')
parser.add_argument('rows', type=int, help='Number of rows for the array')
parser.add_argument('cols', type=int, help='Number of columns for the array')
parser.add_argument('output_file', type=str, help='Path to the output file')
parser.add_argument('output_mask_file', type=str, help='Path to the output mask file')
parsed_args = parser.parse_args(args)
# Apply the function to create the new array
array, mask = ut.create_test_array(parsed_args.rows, parsed_args.cols)
# Save the output
ut.save_array_to_file(array, parsed_args.output_file)
ut.save_array_to_file(mask, parsed_args.output_mask_file)
if __name__ == "__main__":
main(sys.argv[1:])