(a, b)
| 3 | |
| 4 | |
| 5 | def check_data(a, b): |
| 6 | if not isinstance(a, np.ndarray): |
| 7 | a = np.array(a) |
| 8 | |
| 9 | if not isinstance(b, np.ndarray): |
| 10 | b = np.array(b) |
| 11 | |
| 12 | if type(a) != type(b): |
| 13 | raise ValueError("Type mismatch: %s and %s" % (type(a), type(b))) |
| 14 | |
| 15 | if a.size != b.size: |
| 16 | raise ValueError("Arrays must be equal in length.") |
| 17 | return a, b |
| 18 | |
| 19 | |
| 20 | def validate_input(function): |
no outgoing calls