docs for rdm_utils
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-"""
-Collection of helper methods for rdm module
+"""Collection of helper methods for rdm module
+
batch_to_vectors: batch squareform() to vectors
batch_to_matrices: batch squareform() to matrices
@author: baihan
+
"""
import numpy as np
@@ -13,19 +14,18 @@ from scipy.spatial.distance import squareform
def batch_to_vectors(x):
- """
- converts a *stack* of RDMs in vector or matrix form into vector form
+ """converts a *stack* of RDMs in vector or matrix form into vector form
Args:
x: stack of RDMs
Returns:
- v(np.ndarray):
- 2D, vector form of the stack of RDMs
- n_rdm(int):
- number of rdms
- n_cond(int)
- number of conditions
+ tuple: **v** (np.ndarray): 2D, vector form of the stack of RDMs
+
+ **n_rdm** (int): number of rdms
+
+ **n_cond** (int): number of conditions
+
"""
if x.ndim == 2:
v = x
@@ -42,19 +42,18 @@ def batch_to_vectors(x):
def batch_to_matrices(x):
- """
- converts a *stack* of RDMs in vector or matrix form into matrix form
+ """converts a *stack* of RDMs in vector or matrix form into matrix form
Args:
x: stack of RDMs
Returns:
- v(np.ndarray):
- 3D, matrix form of the stack of RDMs
- n_rdm(int):
- number of rdms
- n_cond(int):
- number of conditions
+ tuple: **v** (np.ndarray): 3D, matrix form of the stack of RDMs
+
+ **n_rdm** (int): number of rdms
+
+ **n_cond** (int): number of conditions
+
"""
if x.ndim == 2:
v = x
