psytest.critval.critval_parameters module#

psytest.critval.critval_parameters#

This module contains the framework for checking the available parameters for the tabulated critical values. The tabulated critical values are stored in the data directory of the package and named according to the parameters used to calculate them. The parameters are extracted from the file names and stored in a dictionary for easy access. The module also provides functions to list all available tables and check if a given set of parameters is available.

class psytest.critval.critval_parameters.CritValParameterName(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

Enum for the critical value parameter names.

R0 = 'r0'#
RSTEP = 'rstep'#
NREPS = 'nreps'#
NOBS = 'nobs'#
KMAX = 'kmax'#
class psytest.critval.critval_parameters.CritValParameterInfo(kmax: int, r0: float, rstep: float, nreps: int, nobs: int)[source]#

Bases: NamedTuple

Named tuple for the critical value parameters.

kmax: int#

Alias for field number 0

r0: float#

Alias for field number 1

rstep: float#

Alias for field number 2

nreps: int#

Alias for field number 3

nobs: int#

Alias for field number 4

psytest.critval.critval_parameters.traversable_to_string(traversable: Traversable) str[source]#

Convert a Traversable object to a string representation.

Parameters:

traversable (Traversable) – The Traversable object to convert.

Returns:

string – The string representation of the Traversable object.

Return type:

str

psytest.critval.critval_parameters.extract_parameters_from_tablenames(fname: str) dict[str, int | float][source]#

Retrieve the parameters from the file name of a critical value table.

Parameters:

fname (str) – Name of the table file

Returns:

parameters – a dictionary with the parameters and their values

Return type:

dict[str, int | float]

psytest.critval.critval_parameters.list_critval_tables() list[str][source]#

Lists all critical value tables in the data/ directory.

Returns:

cval_list – A list of file names of the critical value tables.

Return type:

list[str]

psytest.critval.critval_parameters.list_available_tables() list[str][source]#

Lists all available critical value tables in the data/ directory.

Returns:

table_list – A list of file names of the available critical value tables.

Return type:

list[str]

psytest.critval.critval_parameters.list_available_parameters() dict[str, CritValParameterInfo][source]#

Retrieves the parameters used to calculate the critical values from the available tables.

Returns:

param_list – A dictionary with the parameters and their values.

Return type:

list[str, ParamInfo]

psytest.critval.critval_parameters.is_available_param(kmax: int, r0: float) bool[source]#

Checks if the given parameters are available in the critical value tables.

Parameters:
Returns:

available – True if the parameters are available, False otherwise.

Return type:

bool