|
75 | 75 | 'statesp.remove_useless_states': False, |
76 | 76 | 'statesp.latex_num_format': '.3g', |
77 | 77 | 'statesp.latex_repr_type': 'partitioned', |
| 78 | + 'statesp.latex_maxsize': 10, |
78 | 79 | } |
79 | 80 |
|
80 | 81 |
|
@@ -526,19 +527,26 @@ def _latex_dt(self): |
526 | 527 | def _repr_latex_(self): |
527 | 528 | """LaTeX representation of state-space model |
528 | 529 |
|
529 | | - Output is controlled by config options statesp.latex_repr_type |
530 | | - and statesp.latex_num_format. |
| 530 | + Output is controlled by config options statesp.latex_repr_type, |
| 531 | + statesp.latex_num_format, and statesp.latex_maxsize. |
531 | 532 |
|
532 | 533 | The output is primarily intended for Jupyter notebooks, which |
533 | 534 | use MathJax to render the LaTeX, and the results may look odd |
534 | 535 | when processed by a 'conventional' LaTeX system. |
535 | 536 |
|
| 537 | +
|
536 | 538 | Returns |
537 | 539 | ------- |
538 | | - s : string with LaTeX representation of model |
| 540 | +
|
| 541 | + s : string with LaTeX representation of model, or None if |
| 542 | + either matrix dimension is greater than |
| 543 | + statesp.latex_maxsize |
539 | 544 |
|
540 | 545 | """ |
541 | | - if config.defaults['statesp.latex_repr_type'] == 'partitioned': |
| 546 | + syssize = self.nstates + max(self.noutputs, self.ninputs) |
| 547 | + if syssize > config.defaults['statesp.latex_maxsize']: |
| 548 | + return None |
| 549 | + elif config.defaults['statesp.latex_repr_type'] == 'partitioned': |
542 | 550 | return self._latex_partitioned() |
543 | 551 | elif config.defaults['statesp.latex_repr_type'] == 'separate': |
544 | 552 | return self._latex_separate() |
|
0 commit comments