API for Developers¶
Here you will find the API provide for developers.
Solver Data¶
Class and functions related to storing the solver’s results.
Classes¶
perprof.solver_data.SolverData
¶
Store data from one solver.
Attributes:
-
algname
(
str
) –Name of the algorithm
-
data
(
pandas.DataFrame
) –DataFrame with columns
- “name”: The problem name.
- “exit”: Exit flag to determine successful termination.
- “time”: Elapsed time for the algorithm.
- “fval”: Function value at the solution.
- “primal”: Primal residual at the solution.
- “dual”: Dual residual at the solution.
-
success
(
list[str]
) –List of strings used to define what is a successful termination.
Source code in perprof/solver_data.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
Functions¶
__init__(algname, data, success=None, read_csv_args=None)
¶
Parameters:
-
algname
(
str
) –Name of the algorithm.
-
data
(
Union[str, Path, pandas.DataFrame]
) –File name of csv to read or DataFrame.
-
success
(
list[str]
) –Vector of flags considered as success.
-
read_csv_args
(
dict
) –Arguments to be passed to
pandas.read_csv
ifdata
is a file name.
Raises:
-
TypeError
–If the data is not a str, Path, or pandas.DataFrame.
Source code in perprof/solver_data.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
Functions¶
perprof.solver_data.read_table(filename)
¶
Read a table file as described in the documentation section File Format.
Parameters:
-
filename
(
str
) –Name of the table file.
Returns:
-
solver(
SolverData
) –Parsed data
Source code in perprof/solver_data.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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
Profile Data¶
Class to store the profile configuration and data.
Classes¶
perprof.profile_data.ProfileData
¶
Computes and stores the performance profile.
This class will store and compute the performance profile of given solvers. This is only the most basic profile choice, it only uses the time and the convergence status.
Attributes:
-
solvers
(
list[SolverData]
) –List of solver_data.SolverData objects associated with this performance profile.
-
subset
(
list[str]
) –If not None, used to restrict the problems in which the profile is created.
-
ratio
(
numpy.array
) –Ratio matrix computed using the best time for each problem.
-
breakpoints
(
numpy.array
) –Array of breakpoints obtained from the ratio matrix.
-
cumulative
(
numpy.array
) –Matrix of the cumulative distribution of problems. Dimensions and len(breakpoints) by len(solvers).
Source code in perprof/profile_data.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 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 |
|
Functions¶
__init__(*solvers, subset=None)
¶
Parameters:
-
*solvers
(
Union[str, Path, SolverData]
) –Arguments of type str/Path to be read through solver_data.read_table or of type solver_data.SolverData. At least 2 arguments are required
-
subset
(
list[str]
) –If not None, restricts the solvers data to only these problems.
Source code in perprof/profile_data.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
process()
¶
Process the solver data.
If the solvers argument is updated, this should be called again. This returns the internal values and returns nothing.
Source code in perprof/profile_data.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 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 |
|