replace ndarray.__str__ temporarily
(s)
| 689 | |
| 690 | @contextmanager |
| 691 | def inject_str(s): |
| 692 | """ replace ndarray.__str__ temporarily """ |
| 693 | set_printoptions(formatter={"all": lambda x: s}) |
| 694 | try: |
| 695 | yield |
| 696 | finally: |
| 697 | set_printoptions() |
| 698 | |
| 699 | a1d = np.array(['test']) |
| 700 | a0d = np.array('done') |
nothing calls this directly
no test coverage detected