Coverage for uqmodels / check.py: 88%
8 statements
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-09 08:15 +0000
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-09 08:15 +0000
1def dim_1d_check(y):
2 """Reshape (n,1) 2D array to (n) 1D array else do nothing"""
3 if not isinstance(y, type(None)):
4 if not isinstance(y, tuple):
5 if len(y.shape) == 2:
6 if y.shape[1] == 1:
7 return y.reshape(-1)
8 else:
9 return (dim_1d_check(y[0]), dim_1d_check(y[1]))
10 return y