Aggregates and caches metrics for expression trees in self.args. So far metrics include the maximum dimensionality ('max_ndim') and whether all sub-expressions support C++ ('all_support_cpp').
(self)
| 192 | |
| 193 | @perf.compute_once |
| 194 | def _aggregate_metrics(self) -> dict: |
| 195 | """ |
| 196 | Aggregates and caches metrics for expression trees in self.args. So far |
| 197 | metrics include the maximum dimensionality ('max_ndim') and whether |
| 198 | all sub-expressions support C++ ('all_support_cpp'). |
| 199 | |
| 200 | """ |
| 201 | max_ndim = self.ndim |
| 202 | cpp_support = self._supports_cpp() |
| 203 | |
| 204 | for arg in [self._objective] + self._constraints: |
| 205 | max_ndim = max(max_ndim, arg._max_ndim()) |
| 206 | cpp_support = cpp_support and arg._all_support_cpp() |
| 207 | |
| 208 | metrics = { |
| 209 | "max_ndim": max_ndim, |
| 210 | "all_support_cpp": cpp_support |
| 211 | } |
| 212 | return metrics |
| 213 | |
| 214 | @property |
| 215 | def value(self): |
nothing calls this directly
no test coverage detected