Represent a parameter value as a string. Parameters ---------- value : Any The value to represent. str_len : int The maximum length of the string representation. Returns ------- str
(self, value: Any, str_len: int)
| 126 | """ |
| 127 | |
| 128 | def to_string(self, value: Any, str_len: int) -> str: |
| 129 | """Represent a parameter value as a string. |
| 130 | |
| 131 | Parameters |
| 132 | ---------- |
| 133 | value : Any |
| 134 | The value to represent. |
| 135 | |
| 136 | str_len : int |
| 137 | The maximum length of the string representation. |
| 138 | |
| 139 | Returns |
| 140 | ------- |
| 141 | str |
| 142 | """ |
| 143 | s = f"{value:<{str_len}}" |
| 144 | |
| 145 | if len(s) > str_len: |
| 146 | return s[: str_len - 3] + "..." |
| 147 | return s |
| 148 | |
| 149 | @property |
| 150 | @abc.abstractmethod |