Represents computing configuration objects.
The ComputingConfiguration class provides a computing configuration object
that is an in memory representation of a divvy
computing configuration
file. This object has various functions to allow a user to activate, modify,
and retrieve computing configuration files, and use these values to populate
job submission script templates.
Parameters:
config_file
-- str
: YAML file specifying computing package data (TheDIVCFG
file).no_env_error
-- type
: type of exception to raise if divvysettings can't be established, optional; if null (the default), a warning message will be logged, and no exception will be raised.no_compute_exception
-- type
: type of exception to raise if computesettings can't be established, optional; if null (the default), a warning message will be logged, and no exception will be raised.Environment variable through which to access compute settings.
def compute_env_var(self)
Returns:
list[str]
: names of candidate environment variables, for whichvalue may be path to compute settings file; first found is used.
Path to default compute environment settings file.
def default_config_file(self)
Returns:
str
: Path to default compute settings file
Get the currently active submission template.
def template(self)
Returns:
str
: submission script content template for current state
Path to folder with default submission templates.
def templates_folder(self)
Returns:
str
: path to folder with default submission templates
Write a submission script by populating a template with data.
def write_submit_script(fp, content, data)
Parameters:
fp
-- str
: Path to the file to which to create/write submissions script.content
-- str
: Template for submission script, defining keys thatwill be filled by given datadata
-- Mapping
: a "pool" from which values are available to replacekeys in the templateReturns:
str
: Path to the submission script