Update scripts with division factor
Signed-off-by: Rafael Ravedutti <rafaelravedutti@gmail.com>
This commit is contained in:
parent
98257b746c
commit
d151b9b3e4
@ -1,15 +1,16 @@
|
|||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
if len(sys.argv) != 5:
|
if len(sys.argv) != 6:
|
||||||
print("Usage: python preds.py <iaca> <mca> <osaca> <uica>")
|
print("Usage: python preds.py <iaca> <mca> <osaca> <uica> <div_factor>")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
iaca_pred = float(sys.argv[1])
|
iaca_pred = float(sys.argv[1])
|
||||||
mca_pred = float(sys.argv[2])
|
mca_pred = float(sys.argv[2])
|
||||||
osaca_pred = float(sys.argv[3])
|
osaca_pred = float(sys.argv[3])
|
||||||
uica_pred = float(sys.argv[4])
|
uica_pred = float(sys.argv[4])
|
||||||
preds = [iaca_pred, mca_pred, osaca_pred, uica_pred]
|
div_factor = float(sys.argv[5])
|
||||||
|
preds = [x / div_factor for x in [iaca_pred, mca_pred, osaca_pred, uica_pred]]
|
||||||
|
|
||||||
start = -4.0
|
start = -4.0
|
||||||
end = 36.0
|
end = 36.0
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 3:
|
||||||
print("Usage: python string_to_agr.py input_filename")
|
print("Usage: python string_to_agr.py <input_filename> <div_factor>")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
input_filename = sys.argv[1]
|
input_filename = sys.argv[1]
|
||||||
|
div_factor = float(sys.argv[2])
|
||||||
result_list = []
|
result_list = []
|
||||||
|
|
||||||
with open(input_filename, 'r') as file:
|
with open(input_filename, 'r') as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
numbers = re.findall(r'\d+\.\d+', line)
|
numbers = re.findall(r'\d+\.\d+', line)
|
||||||
divided_numbers = [float(number) / 8 for number in numbers]
|
divided_numbers = [float(number) / div_factor for number in numbers]
|
||||||
result_list.append(divided_numbers)
|
result_list.append(divided_numbers)
|
||||||
|
|
||||||
start = -2.5
|
start = -2.5
|
||||||
|
Loading…
Reference in New Issue
Block a user