Commit 10571cba authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[cmd] get_transitions_from_model_file also returns the parser

parent f37629d5
......@@ -756,7 +756,7 @@ if __name__ == "__main__":
exit()
process_solutions(load_solutions(LOG_DIR + "../run/Whole NCI-PID database translated into CADBIOM formalism(and)_SRP9_cam_complete.txt"),
get_transitions_from_model_file(BIO_MOLDELS_DIR + "Whole NCI-PID database translated into CADBIOM formalism(and).bcx"))
get_transitions_from_model_file(BIO_MOLDELS_DIR + "Whole NCI-PID database translated into CADBIOM formalism(and).bcx")[0])
exit()
......@@ -776,17 +776,17 @@ if __name__ == "__main__":
# exit()
convert_solutions_to_json(load_solutions(LOG_DIR + "../run/pid_and_clock_no_perm_p21corrected_start_SRP9_complete.txt"),
get_transitions_from_model_file(BIO_MOLDELS_DIR + "Whole NCI-PID database translated into CADBIOM formalism(and).bcx"))
get_transitions_from_model_file(BIO_MOLDELS_DIR + "Whole NCI-PID database translated into CADBIOM formalism(and).bcx")[0])
exit()
convert_solutions_to_json(load_solutions(LOG_DIR + "sols_new_solver.txt"),
get_transitions_from_model_file(BIO_MOLDELS_DIR + "mini_test_publi.bcx"))
get_transitions_from_model_file(BIO_MOLDELS_DIR + "mini_test_publi.bcx")[0])
exit()
process_solutions(load_solutions(LOG_DIR + "sols_new_solver.txt"),
get_transitions_from_model_file(BIO_MOLDELS_DIR + "mini_test_publi.bcx"))
get_transitions_from_model_file(BIO_MOLDELS_DIR + "mini_test_publi.bcx")[0])
exit()
# build_graph(load_solutions(LOG_DIR + "../run/pid_and_clock_SRP9_cam_complete_o.txt"),
# get_transitions_from_model_file(BIO_MOLDELS_DIR + "pid_and_clock.bcx"))
# get_transitions_from_model_file(BIO_MOLDELS_DIR + "pid_and_clock.bcx")[0])
process_solutions(load_solutions(LOG_DIR + "../run/pid_and_clock_SRP9_cam_complete.txt"),
get_transitions_from_model_file(BIO_MOLDELS_DIR + "pid_and_clock.bcx"))
get_transitions_from_model_file(BIO_MOLDELS_DIR + "pid_and_clock.bcx")[0])
......@@ -203,7 +203,7 @@ def solutions_2_json(output_dir, model_file, path, conditions=True):
assert os.path.isfile(path) or os.path.isdir(path)
# Get transitions from the model
model_transitions = get_transitions_from_model_file(model_file)
model_transitions, _ = get_transitions_from_model_file(model_file)
if os.path.isfile(path):
# The given path is a solution file
......@@ -257,7 +257,7 @@ def solutions_2_graphs(output_dir, model_file, path):
assert os.path.isfile(path) or os.path.isdir(path)
# Get transitions from the model
model_transitions = get_transitions_from_model_file(model_file)
model_transitions, _ = get_transitions_from_model_file(model_file)
if os.path.isfile(path):
# The given path is a solution file
......@@ -463,7 +463,7 @@ def queries_2_common_graph(output_dir, model_file, path,
assert os.path.isfile(path) or os.path.isdir(path)
# Get transitions from the model
model_transitions = get_transitions_from_model_file(model_file)
model_transitions, parser = get_transitions_from_model_file(model_file)
if make_csv:
......
......@@ -72,16 +72,16 @@ class Reporter(object):
def get_transitions_from_model_file(model_file):
"""Get all transitions from a model file (bcx format).
"""Get all transitions and parser from a model file (bcx format).
:param: bcx file.
:type: <str>
:return: Transitions (see get_transitions()).
:rtype: <dict>
:return: Transitions (see get_transitions()) and the Parser for the model.
:rtype: <dict>, <MakeModelFromXmlFile>
"""
parser = MakeModelFromXmlFile(model_file)
return get_transitions(parser)
return get_transitions(parser), parser
def get_transitions(parser):
......
Supports Markdown
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