[DBG] minor style fix
@@ -17,7 +17,7 @@ def batch_to_vectors(x):
if x.ndim == 2:
v = x
n_rdm = x.shape[0]
- n_cond = int(np.ceil(np.sqrt(x.shape[1] * 2)))
+ n_cond = get_n_from_reduced_vectors(x)
elif x.ndim == 3:
m = x
n_rdm = x.shape[0]
@@ -32,7 +32,7 @@ def batch_to_matrices(x):
if x.ndim == 2:
v = x
n_rdm = x.shape[0]
- n_cond = int(np.ceil(np.sqrt(x.shape[1] * 2)))
+ n_cond = get_n_from_reduced_vectors(x)
m = np.ndarray((n_rdm, n_cond, n_cond))
for idx in np.arange(n_rdm):
m[idx, :, :] = squareform(v[idx, :])
@@ -41,3 +41,7 @@ def batch_to_matrices(x):
n_rdm = x.shape[0]
n_cond = x.shape[1]
return m, n_rdm, n_cond
+
+
+def get_n_from_reduced_vectors(x):
+ return int(np.ceil(np.sqrt(x.shape[1] * 2)))
