Commit b272b829 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Fix bug in solutions_2_json: unable to take only one file; add test for valid file/path

parent 0d47bbf3
......@@ -82,8 +82,6 @@ def solutions_2_json(args):
# Module import
import solution_sort
params = args_to_param(args)
params['output'] = params['output'] if params['output'][-1] == '/' \
else params['output'] + '/'
solution_sort.solutions_2_json(
params['output'],
params['chart_file'],
......
......@@ -128,9 +128,12 @@ def solutions_2_json(output_dir, model_file, solution_path, conditions=True):
def write_json_file(decompiled_filename, decomp_solutions):
# Write file
with open(decompiled_filename, 'w') as f_d:
json.dump(decomp_solutions, f_d, sort_keys=True, indent=4)
json.dump(decomp_solutions, f_d, sort_keys=True, indent=2)
# Check valid input file/directory
assert os.path.isfile(solution_path) or os.path.isdir(solution_path)
# Get transitions from the model
model_transitions = get_transitions_from_model_file(model_file)
......
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