Elpee Logo

elpee.json_handler

Note

The functionalities of this module are moved to the elpee.data_handler module. Check elpee.data_handler for its implementation.

A module for reading & writing LP problem configurations with json files.

Import

from elpee import json_handler

Methods

read_json(json_path: str) StandardProblem

Read the standardized problem configuration from the json file

Parameters

  • json_pathstr

    File path to the json file containing LP problem to be read

Return

elpee.StandardProblem object of the LP problem in the json file

Example Code

from elpee import json_handler

json_handler.read_json("file/path/to/elpee/problem.json")
write_json(problem: StandardProblem, json_path: str)

Save the standardized problem configurations to json file

Parameters

  • problemelpee.StandardProblem

    Standardized LP problem to be saved into json file

  • json_pathstr

    File path of json file to be written

Example Code

from elpee import json_handler

# let lp_solution be the solution obtained from an elpee problem

json_handler.write(lp_solution, "file/path/to/save/solution.json")

A function to print the elpee.StandardProblem from the json

Parameters

  • json_pathstr

    File path to the json file containing LP problem to be read

  • show_interpreterbool (default = True)

    Provides interpretation of values in simplex table when True

Example Code

from elpee import json_handler

# let lp_solution be the solution obtained from an elpee problem

json_handler.print_lp_problem_from_json("file/path/to/save/solution.json")