Commit 11279d39 authored by sparonuz's avatar sparonuz
Browse files

[Issue#85]: Changed .working_precision to .wp everywhere

parent 3aa34115
# New way of setting the proper working precision in all the libraries
import AutoRPE.UtilsRPE.VariablePrecision as VariablePrecision
VariablePrecision.working_precision = "single"
VariablePrecision.wp = "single"
from AutoRPE.UtilsRPE.Functions import in_which_block, remove_comments, load_vault, \
replace_variable_exact_match, find_call_arguments, \
......
......@@ -28,7 +28,7 @@ def get_command_line_arguments():
help="Whether or not you are going to track dependency")
parser.add_argument("-g", "--export-graph", default=False, action="store_true",
help="Whether or not you want to store the created graph")
parser.add_argument("-s", "--input-source", default=None,
parser.add_argument("-i", "--input-source", default=None,
help="Path to input fortran files")
args = parser.parse_args()
......@@ -51,7 +51,7 @@ if __name__ == "__main__":
track = args.omit_tracking
# Set the proper working precision
VariablePrecision.working_precision = VariablePrecision.precisions[wp]
VariablePrecision.wp = VariablePrecision.precisions[wp]
print("Creating a database from sources found in:\n %s\n\n" % path_to_input_sources)
# In case no vault has been provided it will create it from the sources in the input sources folder
......
......@@ -44,7 +44,7 @@ list_filename, source_path, vault_path, target_precision, working_precision = ge
# Setting the working precision
import AutoRPE.UtilsRPE.VariablePrecision as VariablePrecision
VariablePrecision.working_precision = working_precision
VariablePrecision.wp = working_precision
# Calling to the change_code function
from AutoRPE.UtilsRPE.CodeTools import change_code
......
......@@ -468,7 +468,7 @@ def is_a_number(string):
if string.isdigit():
return "integer"
else:
return working
return VariablePrecision.wp
except ValueError:
return False
......@@ -1039,7 +1039,7 @@ def type_of_contents(contents, routine=None, vault=None):
if fun_name == "real":
return type_of_real_cast(string=contents)
return working
return VariablePrecision.wp
elif fun_name in ["cmplx"]:
return "complex"
elif fun_name in ["trim", "ctime", "adjustl"]:
......@@ -1083,7 +1083,7 @@ def type_of_contents(contents, routine=None, vault=None):
contents = clean_contents(contents, vault)
if re.match("^" + pattern_exp_DPE_notation + "$", contents):
return working
return VariablePrecision.wp
if contents.find("nf90_") == 0:
return "integer"
......@@ -1353,7 +1353,7 @@ def type_of_derived_type_element(contents, routine=None, derived_type=None, vaul
struct = contents[:contents.find("%")]
var = contents[contents.find("%") + 1:]
if var == "val":
return working
return VariablePrecision.wp
if not derived_type:
derived_type = type_of_contents(struct, routine=routine, vault=vault)
......@@ -1367,7 +1367,7 @@ def type_of_derived_type_element(contents, routine=None, derived_type=None, vaul
derived_type = type_of_derived_type_element(struct, routine=routine, derived_type=derived_type, vault=vault)
var = var[var.find("%") + 1:]
if var == "val":
return working
return VariablePrecision.wp
dt = vault.get_derived_type(derived_type)
try:
v = dt.get_variable(var)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment