SBART.utils.UserConfigs

SBART.utils.UserConfigs#

Classes

Constraint

DefaultValues

Holds all of the user parameters that SBART has available for any given object.

InternalParameters

IterableMustHave

UserParam

ValueFromDtype

ValueFromList

ValueInInterval

class Constraint#

Bases: object

__init__(const_text)#
evaluate(param_name, value)#
apply_to_value(param_name, value)#
Return type:

NoReturn

class ValueInInterval#

Bases: Constraint

__init__(interval, include_edges=False)#
evaluate(param_name, value)#
Return type:

NoReturn

class ValueFromDtype#

Bases: Constraint

__init__(dtype_list)#
evaluate(param_name, value)#
Return type:

NoReturn

class ValueFromList#

Bases: Constraint

__init__(available_options)#
evaluate(param_name, value)#
Return type:

NoReturn

class IterableMustHave#

Bases: Constraint

__init__(available_options, mode='all')#
evaluate(param_name, value)#
Return type:

NoReturn

class UserParam#

Bases: object

__init__(default_value=None, constraint=None, mandatory=False, quiet=False, description=None)#
quiet#
description#
apply_constraints_to_value(param_name, value)#
Return type:

NoReturn

property existing_constraints#
property is_mandatory: bool#
Return type:

bool

property quiet_output: bool#
Return type:

bool

property default_value: Any#
Return type:

Any

get_terminal_output(indent_level=1)#

Generate terminal-formatted text from this UserParam

Parameters:

indent_level (int, optional) – How many tabs to add at the start of each line. Defaults to 1.

Returns:

Formatted message with the Description, mandatory status, default value and constraints

Return type:

str

class InternalParameters#

Bases: object

__init__(name_of_parent, default_params, no_logs=False)#
no_logs#
update_configs_with_values(user_configs)#
receive_user_inputs(user_configs=None)#
text_pretty_description(indent_level)#
Return type:

str

get_user_configs()#
Return type:

Dict[str, Any]

items()#
class DefaultValues#

Bases: object

Holds all of the user parameters that SBART has available for any given object.

__init__(**kwargs)#
update(item, new_value)#

Update the default value of a stored parameter, if it exists. Otherwise, raises an Exception

Parameters:
  • item (str) –

  • new_value (Any) –

items()#
keys()#
values()#