pyworkflow.config module

class pyworkflow.config.Config[source]

Bases: object

Main Config for pyworkflow. It contains the main Scipion configuration variables providing default values or, if present, taking them from the environment. Necessary value is SCIPION_HOME and has to be present in the environment

CONDA_ACTIVATION_CMD = ''

eval “$(/extra/miniconda3/bin/conda shell.bash hook)”

Type

Command to activate/initialize conda itself. Do not confuse it with ‘conda activate’. It should be defined at installation time. It looks like this

NO_COLOR = ''

//no-color.org/ initiative. Set it to something different than ‘’ to deactivate colors in the output.

Type

Comply with https

class Root(root)[source]

Bases: object

Simple helper to return path from a root.

join(*path)[source]
SCIPION_CANCEL_FASTCOPY = None

Cancel fast copy done by shutil (copying files) when it fails. Has happened in GPFS environments.

SCIPION_CONFIG = 'scipion.conf'

Path to the scipion configuration file where all this variables could be defined.

SCIPION_CWD = '/tmp/tmpj31rsto0/ac82247062a4a6a135ccdf9a1d4bf6a7e4b1fe46'

Directory when scipion was launched

SCIPION_DOMAIN = None
SCIPION_FONT_NAME = 'Helvetica'

Name of the font to use in Scipion GUI. Defaults to Helvetica.

SCIPION_FONT_SIZE = 10

Size of the ‘normal’ font to be used in Scipion GUI. Defaults to 10.

SCIPION_GUI_CANCEL_AUTO_REFRESH = 'False'

Set it to True to cancel automatic refresh of the runs.

SCIPION_GUI_REFRESH_INITIAL_WAIT = 5

Seconds to wait after a manual refresh

SCIPION_GUI_REFRESH_IN_THREAD = 'False'

True to refresh the runs graph with a thread. Unstable.

SCIPION_HOME = '/home/buildbot/devel/scipion'

Path where Scipion is installed. Other paths are based on this like SCIPION_SOFTWARE, SCIPION_TESTS,… unless specified

SCIPION_HOSTS = 'hosts.conf'

Path to the host.cof file to allow scipion to use queue engines and run in HPC environments.

SCIPION_LOCAL_CONFIG = '/home/buildbot/.config/scipion/scipion_devel.conf'

Path to an optional/extra/user configuration file meant to overwrite default variables.

SCIPION_LOG = '/home/buildbot/ScipionUserData/logs/scipion.log'

Path to the file where scipion will write GUI logging messages. Defaults to SCIPION_LOGS/scipion.log

SCIPION_LOGS = '/home/buildbot/ScipionUserData/logs'

Path for Scipion logs folder used by the GUI. Defaults to SCIPION_USER_DATA/logs.

SCIPION_LOG_CONFIG = None

Optional. Path to a python logging configuration file fine tune the logging.

SCIPION_LOG_FORMAT = '%(message)s'

//docs.python.org/3/library/logging.html#logrecord-attributes

Type

Format for all the log lines, defaults to %(message)s. To compose the format see https

SCIPION_LOG_LEVEL = 'INFO'

Default logging level. String among CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET. Default value is INFO.

SCIPION_MAIN_COLOR = 'Firebrick'

https://matplotlib.org/stable/gallery/color/named_colors.html

Type

Main color of the GUI. Background will be white, so for better contrast choose a dark color. Probably any name here will work

SCIPION_NOTES_ARGS = None
SCIPION_NOTES_FILE = 'notes.txt'

Name of the file where to write per project notes.

SCIPION_NOTES_PROGRAM = None

Command or program to use to open the notes file. Otherwise system will extension association will take place.

SCIPION_NOTIFY = 'True'

If set to False, Scipion developers will know almost nothing about Scipion usage and will have less information to improve it.

SCIPION_PLUGIN_JSON = 'plugins.json'

Optional. Path to get the json file with all the plugins available for Scipion.

SCIPION_PLUGIN_REPO_URL = 'http://scipion.i2pc.es/getplugins/'

Url from where to get the list of plugins.

SCIPION_PRIORITY_PACKAGE_LIST = None
SCIPION_PROTOCOLS = 'protocols.conf'
SCIPION_SCRATCH = None

Optional. Path to a location mounted in a scratch drive (SSD,…)

SCIPION_SOFTWARE = '/home/buildbot/devel/scipion/software'

Path where Scipion will install the software. Defaults to SCIPION_HOME/software.

SCIPION_STEPS_CHECK_SEC = 5

Number of seconds to wait before checking if new input is available in streamified protocols.

SCIPION_SUPPORT_EMAIL = 'scipion@cnb.csic.es'
SCIPION_TESTS = '/home/buildbot/devel/scipion/data/tests'

Path where to find/download test data. Defaults to SCIPION_HOME/data/tests.

SCIPION_TESTS_CMD = '/home/buildbot/devel/scipion/scipion-pyworkflow/pyworkflow/apps/pw_run_tests.py'
SCIPION_TESTS_OUTPUT = '/home/buildbot/ScipionUserData/Tests'

Path to a folder Where the output of the tests will be written. Defaults to SCIPION_USER_DATA/Tests.

SCIPION_TEST_NOSYNC = 'False'

Set it to 1, True, Yes or y to cancel test dataset synchronization. Needed when updating files in a dataset.

SCIPION_TMP = '/home/buildbot/ScipionUserData/tmp'

General purpose scipion tmp folder. Defaults to SCIPION_USER_DATA/tmp

SCIPION_UPDATE_SET_ATTEMPTS = 3

Number of attempts to modify the protocol output before failing. The default value is 3

SCIPION_UPDATE_SET_ATTEMPT_WAIT = 2

Time in seconds to wait until the next attempt when checking new outputs. The default value is 2 seconds

SCIPION_URL = 'http://scipion.cnb.csic.es/downloads/scipion'
SCIPION_URL_SOFTWARE = 'http://scipion.cnb.csic.es/downloads/scipion/software'
SCIPION_URL_TESTDATA = 'http://scipion.cnb.csic.es/downloads/scipion/data/tests'
SCIPION_USER_DATA = '/home/buildbot/ScipionUserData'

Path where Scipion projects are or will be created. Defaults to ~/ScipionUserData

VIEWERS = {}
WIZARD_MASK_COLOR = '[0.125, 0.909, 0.972]'

Color to use in some wizards.

classmethod colorsInTerminal()[source]

Returns true if colors are allowed. Based on NO_COLOR variable. Undefined or ‘’ colors are enabled

static debugOn()[source]

Returns a True if debug mode (SCIPION_DEBUG variable) is active

static debugSQLOn()[source]
classmethod getActiveColor()[source]

Returns a color lighter than the SCIPION_MAIN_COLOR

classmethod getBindingsFolder()[source]

Folder where bindings must be placed. This folder is added to sys.path at launching time. If the binding depends on a dynamic libraries, those must be placed at cls.getLibFolder() :return: The bindings folder

classmethod getDomain()[source]

Import domain module from path or name defined in SCIPION_DOMAIN.

classmethod getExternalJsonTemplates()[source]
classmethod getLibFolder()[source]
Returns

Folder where libraries must be placed in case a binding needs them

classmethod getLogsFolder()[source]

Folder where scipion logs must be placed. The folder is created

classmethod getPriorityPackageList()[source]
static getPythonLibFolder()[source]
classmethod getStepsCheckSeconds()[source]
classmethod getUpdateSetAttempts()[source]
classmethod getUpdateSetAttemptsWait()[source]
classmethod getVars()[source]

Return a dictionary with all variables defined in this Config.

classmethod getWizardMaskColor()[source]
classmethod printVars()[source]

Print the variables’ dict, mostly for debugging.

classmethod refreshInThreads()[source]
classmethod setDomain(moduleOrNameOrPath)[source]
static toggleDebug()[source]
static toggleDebugSQL()[source]
pyworkflow.config.findResource(filename)[source]
pyworkflow.config.genNotesHeading()[source]
pyworkflow.config.getAppsPath(*paths)[source]
pyworkflow.config.getModuleFolder(moduleName)[source]

Returns the path of a module without importing it

pyworkflow.config.getPwProtMpiRunScript()[source]
pyworkflow.config.getPyworkflowPath()[source]

Returns the path where pyworkflow is

pyworkflow.config.getScheduleScript()[source]
pyworkflow.config.getSyncDataScript()[source]
pyworkflow.config.getTestsScript()[source]
pyworkflow.config.getViewerScript()[source]
pyworkflow.config.join(*paths)[source]

join paths from HOME .