config Package
environment
Environment related checks or operations are to be defined here.
-
class tvb.basic.config.environment.Environment[source]
Bases: builtins.object
-
PYTHON_FOLDER = 'python3.7'
-
append_to_path(*paths)[source]
Set PATH
:param paths: list of absolute folder paths to join and add BEFORE the current PATH
-
get_library_folder(default_mac)[source]
Return top level library folder. Will be use for setting paths
-
static is_distribution()[source]
Return True when TVB_Distribution package, False when used from a GitHub clone, Pypi, Conda or Docker
-
is_framework_present()[source]
Returns: | True when framework classes are present and can be imported. |
-
is_linux()[source]
-
is_linux_deployment()[source]
Return True if current run is not development and is running on Linux.
-
static is_mac()[source]
-
is_mac_deployment()[source]
Return True if current run is not development and is running on Mac OS X
-
static is_windows()[source]
-
is_windows_deployment()[source]
Return True if current run is not development and is running on Windows.
-
setup_python_path(*paths)[source]
Set PYTHONPATH
:param paths: list of absolute folder paths to join.
-
setup_tk_tcl_environ(root_folder)[source]
Given a root folder to look in, find the required configuration files for TCL/TK and set the proper
environmental variables so everything works fine in the distribution package.
Parameters: | root_folder – the top folder from which to start looking for the required configuration files |
profile_settings
Prepare TVB settings to be grouped under various profile classes.
-
class tvb.basic.config.profile_settings.BaseSettingsProfile[source]
Bases: builtins.object
-
ACCESS_MODE_TVB_FILES = 484
-
BIN_FOLDER[source]
Return path towards tvb_bin location. It will be used in some environment for determining the starting point
-
DEFAULT_STORAGE = '/home/tvb_user/TVB/'
-
FIRST_RUN_STORAGE = '/home/tvb_user/.tvb-temp'
-
LOGGER_CONFIG_FILE_NAME = 'logger_config.conf'
-
MAGIC_NUMBER = 9
-
PYTHON_INTERPRETER_PATH[source]
Get Python path, based on current environment.
-
TVB_CONFIG_FILE = '/home/tvb_user/.tvb.configuration'
-
TVB_USER_HOME = '/home/tvb_user'
-
initialize_for_deployment()[source]
-
initialize_profile()[source]
Make sure tvb folders are created.
-
prepare_for_operation_mode()[source]
Overwrite PostgreSQL number of connections when executed in the context of a node.
-
class tvb.basic.config.profile_settings.LibrarySettingsProfile[source]
Bases: tvb.basic.config.profile_settings.BaseSettingsProfile
Profile used when scientific library is used without storage and without web UI.
-
LOGGER_CONFIG_FILE_NAME = 'library_logger.conf'
-
TVB_STORAGE = '/root/TVB/'
-
class tvb.basic.config.profile_settings.MATLABLibraryProfile[source]
Bases: tvb.basic.config.profile_settings.LibrarySettingsProfile
Profile use library use from MATLAB.
-
LOGGER_CONFIG_FILE_NAME = None
-
class tvb.basic.config.profile_settings.TestLibraryProfile[source]
Bases: tvb.basic.config.profile_settings.LibrarySettingsProfile
Profile for library unit-tests.
-
LOGGER_CONFIG_FILE_NAME = 'library_logger_test.conf'
settings
TVB Raw Settings are defined here, grouped by their category of usage (e.g. cluster related, web related, etc).
Do not instantiate these classes directly, but rather use them through TvpProfile.current instance.
-
class tvb.basic.config.settings.ClusterSettings(manager)[source]
Bases: builtins.object
Cluster related settings.
-
CLUSTER_NODE_NAME[source]
- :return the name of the cluster on which TVB code is executed.
- If code is executed on a normal machine (not cluster node) returns None
-
IN_OPERATION_EXECUTION_PROCESS = False
-
IS_RUNNING_ON_CLUSTER_NODE[source]
Returns True if current execution happens on cluster node.
Even when IS_DEPLOY is True, this call will return False for the web machine.
-
JOB_ID_STRING[source]
-
NODE_ENV[source]
-
SCHEDULER_OAR = 'oar'
-
SCHEDULER_SLURM = 'slurm'
-
SCHEDULE_COMMAND[source]
-
STATUS_COMMAND[source]
-
STOP_COMMAND[source]
-
class tvb.basic.config.settings.DBSettings(manager, default_storage, current_storage)[source]
Bases: builtins.object
-
ALLOW_NESTED_TRANSACTIONS = False
-
MAX_ASYNC_CONNECTIONS = 2
-
MAX_CONNECTIONS = 20
-
class tvb.basic.config.settings.HPCSettings(manager)[source]
Bases: builtins.object
HPC related specifications
-
CAN_RUN_HPC = True
-
CRYPT_BUFFER_SIZE = 65536
-
CRYPT_PASS_SIZE = 64
-
HPC_LAUNCHER_SH_SCRIPT = 'hpcLauncher'
-
IN_OPERATION_EXECUTION_PROCESS = False
-
JOB_MOUNT_POINT_KEY = 'mountPoint'
-
JOB_STATUS_KEY = 'status'
-
UNICORE_ARGS_KEY = 'Arguments'
-
UNICORE_EXE_KEY = 'Executable'
-
UNICORE_RESOURCER_KEY = 'Resources'
-
class tvb.basic.config.settings.VersionSettings(manager, bin_folder)[source]
Bases: builtins.object
Gather settings related to various version numbers of TVB application
-
BASE_VERSION = '2.1a1'
-
DATA_VERSION = 5
-
DATA_VERSION_ATTRIBUTE = 'Data_version'
-
DB_STRUCTURE_VERSION = 18
-
PROJECT_VERSION = 3
-
SVN_VERSION[source]
-
static parse_svn_version(version_string)[source]
-
class tvb.basic.config.settings.WebAdminSettings(manager)[source]
Bases: builtins.object
Setting related to the default users of web-tvb
-
ADMINISTRATOR_BLANK_PWD = 'pass'
-
DEFAULT_ADMIN_EMAIL = 'jira.tvb@gmail.com'
-
SYSTEM_USER_NAME = 'TVB system'
-
class tvb.basic.config.settings.WebSettings(manager)[source]
Bases: builtins.object
Web related specifications
-
LOCALHOST = 'localhost'
-
RENDER_HTML = True
-
VISUALIZERS_ROOT = 'tvb.interfaces.web.templates.jinja2.visualizers'
stored
Manages reading and writing settings in file
-
class tvb.basic.config.stored.SettingsManager(config_file_location)[source]
Bases: builtins.object
-
add_entries_to_config_file(input_data)[source]
Add to the dictionary of settings already existent in the settings file.
Parameters: | input_data – A dictionary of pairs that need to be added to the config file. |
-
delete_entries_from_config_file(data_to_be_deleted)[source]
Delete from the dictionary of settings existent in the settings file.
Parameters: | data_to_be_deleted – A list of attributes that need to be deleted from the config file. |
-
get_attribute(key, default=None, dtype=<class 'str'>)[source]
Get a cfg attribute that could also be found in the settings file.
-
is_first_run()[source]
-
write_config_data(config_dict)[source]
Overwrite anything already existent in the config file
utils
Helper tools, for the configuration area.
-
class tvb.basic.config.utils.EnhancedDictionary[source]
Bases: builtins.dict
A dictionary like class that provides easy access to configuration values.