Convert output value of a previous call to `validate_coerce` into a form suitable to be returned to the user on upon property access. Note: The value returned by present must be either immutable or an instance of BasePlotlyType, otherwise the value could be
(self, v)
| 360 | raise NotImplementedError() |
| 361 | |
| 362 | def present(self, v): |
| 363 | """ |
| 364 | Convert output value of a previous call to `validate_coerce` into a |
| 365 | form suitable to be returned to the user on upon property |
| 366 | access. |
| 367 | |
| 368 | Note: The value returned by present must be either immutable or an |
| 369 | instance of BasePlotlyType, otherwise the value could be mutated by |
| 370 | the user and we wouldn't get notified about the change. |
| 371 | |
| 372 | Parameters |
| 373 | ---------- |
| 374 | v |
| 375 | A value that was the ouput of a previous call the |
| 376 | `validate_coerce` method on the same object |
| 377 | |
| 378 | Returns |
| 379 | ------- |
| 380 | |
| 381 | """ |
| 382 | if is_homogeneous_array(v): |
| 383 | # Note: numpy array was already coerced into read-only form so |
| 384 | # we don't need to copy it here. |
| 385 | return v |
| 386 | elif is_simple_array(v): |
| 387 | return tuple(v) |
| 388 | else: |
| 389 | return v |
| 390 | |
| 391 | |
| 392 | class DataArrayValidator(BaseValidator): |