We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b451a8a commit c14de9aCopy full SHA for c14de9a
1 file changed
inflammation/models.py
@@ -46,8 +46,12 @@ def daily_min(data):
46
47
def patient_normalise(data):
48
"""Normalise patient data from a 2D inflammation data array."""
49
+ if not isinstance(data, np.ndarray):
50
+ raise TypeError('data input should be ndarray')
51
+ if len(data.shape) != 2:
52
+ raise ValueError('inflammation array should be 2-dimensional')
53
if np.any(data < 0):
- raise ValueError('Inflammation values should not be negative')
54
+ raise ValueError('inflammation values should be non-negative')
55
max = np.nanmax(data, axis=1)
56
with np.errstate(invalid='ignore', divide='ignore'):
57
normalised = data / max[:, np.newaxis]
0 commit comments