quast_decisiontree.problems.input_parser
quast_decisiontree.problems.input_parser
logger
module-attribute
logger = logging.getLogger('dt_logger')
discover_types
discover_types(refresh=False)
discovers all available problem types - subclasses of OptimizationProblem
The result is cached after the first call. Pass refresh=True to force a rescan, e.g. when problem classes are registered after the initial import.
Returns a list of classes implementing specific optimization problem types.
Source code in src/quast_decisiontree/problems/input_parser.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
import_problem_classes
import_problem_classes()
Import all concrete problem modules so their classes register as OptimizationProblem subclasses.
Lazy-loaded packages do not execute their submodules on package import, so each submodule must be imported explicitly.
Source code in src/quast_decisiontree/problems/input_parser.py
48 49 50 51 52 53 54 55 56 | |
from_json
from_json(file)
attempts to create an optimization problem instance with the data specified in the given json
file: Any specification compatible with the json.loads() method (str, bytes or bytearray containing a JSON file)
Returns: OptimizationProblem: An instance of the appropriate OptimizationProblem class.
Source code in src/quast_decisiontree/problems/input_parser.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
from_dict
from_dict(problem_dict)
attempts to create an optimization problem instance with the data specified in the given dict
InvalidProblemDictError: If problem_class is missing, not a string, or cannot be matched with an existing OptimizationProblem child class.
Returns: OptimizationProblem: A problem instance of the appropriate OptimizationProblem class
Source code in src/quast_decisiontree/problems/input_parser.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
save_problem_instance
save_problem_instance(
instance, folder, filename="problem_instance.json"
)
Source code in src/quast_decisiontree/problems/input_parser.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |