rthor._validation
Input validation functions for RTHOR analyses.
| FUNCTION | DESCRIPTION |
|---|---|
validate_correlation_matrix |
Validate that a matrix is a valid correlation matrix. |
validate_order |
Validate and process order specification. |
validate_labels |
Validate and process matrix labels. |
validate_filepath |
Validate filepath exists and is readable. |
validate_dataframe_list |
Validate list of DataFrames for RTHOR analysis. |
validate_correlation_matrices_3d |
Validate 3D array of correlation matrices. |
validate_correlation_matrix
Validate that a matrix is a valid correlation matrix.
| PARAMETER | DESCRIPTION |
|---|---|
matrix
|
Matrix to validate
TYPE:
|
matrix_id
|
Matrix identifier for error messages
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If matrix is not a valid correlation matrix |
Source code in src/rthor/_validation.py
validate_order
Validate and process order specification.
| PARAMETER | DESCRIPTION |
|---|---|
order
|
Order specification. Can be:
|
n_variables
|
Number of variables in correlation matrices
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
order_array
|
Processed order array (int32)
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If order specification is invalid |
Source code in src/rthor/_validation.py
validate_labels
Validate and process matrix labels.
| PARAMETER | DESCRIPTION |
|---|---|
labels
|
Matrix labels, or None to auto-generate |
n_matrices
|
Number of matrices
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
labels
|
Processed labels (auto-generated if input was None) |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If number of labels doesn't match number of matrices |
Source code in src/rthor/_validation.py
validate_filepath
Validate filepath exists and is readable.
| PARAMETER | DESCRIPTION |
|---|---|
filepath
|
Path to file |
| RETURNS | DESCRIPTION |
|---|---|
path
|
Validated Path object
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
FileNotFoundError
|
If file doesn't exist |
ValueError
|
If path is not a file |
Source code in src/rthor/_validation.py
validate_dataframe_list
Validate list of DataFrames for RTHOR analysis.
| PARAMETER | DESCRIPTION |
|---|---|
df_list
|
List of DataFrames
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If DataFrames are invalid or inconsistent |
Source code in src/rthor/_validation.py
validate_correlation_matrices_3d
Validate 3D array of correlation matrices.
| PARAMETER | DESCRIPTION |
|---|---|
matrices
|
3D array of shape (n, n, n_matrices)
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If array is invalid |
Source code in src/rthor/_validation.py
:::