model_ensembler
Top-level package for model_ensembler.
batcher
extra_ctx = contextvars.ContextVar('extra')
module-attribute
Main ensembler module with execution core code
BatchExecutor
Bases: object
Create an executor for a ensemble configuration.
The purpose of this is act as the extensible master executor for the ensemble configuration provided. It handles the event loop and should be used to contain and control the execution overall.
Source code in model_ensembler/batcher.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
__init__(cfg, backend='slurm', extra_vars=[])
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
object
|
EnsembleConfig ensemble configuration. |
required |
backend
|
str
|
Backend to execute on, should be one of {'dummy'|'slurm'}. |
'slurm'
|
extra_vars
|
list
|
Additional variables. |
[]
|
Source code in model_ensembler/batcher.py
run(loop=None)
Run the executor.
This will establish the event loop, run the preprocessing actions for the ensemble, cycle through executing the batches and then run postprocessing actions. Exceptions will be caught and the event loop closed, currently with no specific handling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loop
|
object
|
Event loop. |
None
|
Source code in model_ensembler/batcher.py
do_batch_execution(loop, batch, repeat=False)
Execute a batch configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loop
|
object
|
Event loop. |
required |
batch
|
object
|
Batch configuration. |
required |
repeat
|
number
|
Loop n times. |
False
|
Returns:
| Type | Description |
|---|---|
str
|
Prints "Success" on completion. |
Raises:
| Type | Description |
|---|---|
ProcessingException
|
If there is pre or post_batch processing error. |
Source code in model_ensembler/batcher.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
run_batch_item(run)
async
Execute a run configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run
|
object
|
Specific run configuration. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
job_id |
int
|
Job id number. |
run |
object
|
Specific run configuration. |
Raises:
| Type | Description |
|---|---|
TemplatingError
|
If a job cannot be templated. |
ProcessingException
|
If an individual run failure is caught. |
Source code in model_ensembler/batcher.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
cli
check()
CLI native sanity checking Contains pre-set sanity check configuration, combines them with the user's CLI arguments in a list (e.g. dummy/slurm), which is passed to main().
Allow checking of successful installation.
Source code in model_ensembler/cli.py
main(args=None)
CLI entry point.
Source code in model_ensembler/cli.py
parse_args(args_list=None)
Parse command line parameters.
Returns:
| Type | Description |
|---|---|
object
|
Arguments(), immutable instance from |
Source code in model_ensembler/cli.py
parse_extra_vars(arg)
Method for processing extra var arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg
|
tuple
|
Collection of extra var arguments. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
Name and value for the argument to be overridden. |
Raises: argparse.ArgumentTypeError: If arguments do not match.
Source code in model_ensembler/cli.py
parse_indexes(argv)
Method for ensuring a CSV string of integers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argv
|
list
|
expecting delimited integer list. |
required |
Returns:
| Type | Description |
|---|---|
list
|
Matched integer values. |
Raises:
| Type | Description |
|---|---|
ArgumentTypeError
|
If argv is not CSV delimited integer list. |
Source code in model_ensembler/cli.py
cluster
dummy
current_jobs(ctx, match)
async
Dummy method to find current jobs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Context object for retrieving configuration. |
required |
match
|
str
|
Jobs to match the job list with. |
required |
Returns:
| Type | Description |
|---|---|
list
|
Current jobs. |
Source code in model_ensembler/cluster/dummy.py
find_id(job_id)
async
Dummy method to find local job id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
int
|
Local job identifier. |
required |
Returns:
| Type | Description |
|---|---|
int
|
job id. |
Raises:
| Type | Description |
|---|---|
LookupError
|
If job id not found. |
Source code in model_ensembler/cluster/dummy.py
submit_job(ctx, script=None)
async
Dummy method to submit job locally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Context object for retrieving configuration. |
required |
script
|
str
|
Script name to submit. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Job ID. |
Source code in model_ensembler/cluster/dummy.py
threaded_job(run_dir, script)
Dummy method to set off local job
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_dir
|
str
|
Directory script is running in. |
required |
script
|
str
|
Name of script to run. |
required |
Source code in model_ensembler/cluster/dummy.py
slurm
current_jobs(ctx, match)
async
Method to get list of current jobs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Context object for retrieving configuration. |
required |
match
|
str
|
Jobs to match the job list with. |
required |
Returns:
| Type | Description |
|---|---|
list
|
Filtered jobs. |
Source code in model_ensembler/cluster/slurm.py
find_id(job_id)
async
Method to find SLURM job by ID.
This method provides an interface to the squeue SLURM queue utility to identify a job and return it along with it's state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
int
|
SLURM job identifier. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
jobs |
list
|
Job objects including name and state. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If cannot retrieve job from list. |
Source code in model_ensembler/cluster/slurm.py
submit_job(ctx, script=None)
async
Method to submit jobs to SLURM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Context object for retrieving configuration. |
required |
script
|
str
|
Script name to submit. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Job ID. |
Source code in model_ensembler/cluster/slurm.py
config
Batch
Bases: BatchSpec, TaskArrayMixin
Class to represent the entirety of the ensembler configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pre_batch
|
object
|
TaskArray configuration setup. |
None
|
pre_run
|
object
|
TaskArray configuration setup. |
None
|
post_run
|
object
|
TaskArray configuration setup. |
None
|
post_batch
|
object
|
TaskArray configuration setup. |
None
|
**kwargs
|
tuple
|
Keyword arguments for BatchSpec instance. |
{}
|
Source code in model_ensembler/config.py
post_batch
property
Property decorator managing post batch tasks.
Returns:
| Type | Description |
|---|---|
list
|
Post batch tasks. |
post_run
property
Property decorator managing post run tasks.
Returns:
| Type | Description |
|---|---|
list
|
Post run tasks. |
pre_batch
property
Property decorator managing pre batch tasks.
Returns:
| Type | Description |
|---|---|
list
|
Pre batch tasks. |
pre_run
property
Property decorator managing pre run tasks.
Returns:
| Type | Description |
|---|---|
list
|
Pre run tasks. |
EnsembleConfig
Bases: YAMLConfig, TaskArrayMixin
Class to represent the entirety of the ensembler configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
tuple
|
See |
()
|
**kwargs
|
tuple
|
arbitrary keyword arguments. |
{}
|
Source code in model_ensembler/config.py
batches
property
Property decorator managing batches contained in ensemble config.
Returns:
| Type | Description |
|---|---|
list
|
Batches contained in the ensemble configuration. |
post_process
property
Property decorator managing postprocessing attributes.
Returns:
| Type | Description |
|---|---|
list
|
Postprocessing Tasks. |
pre_process
property
Property decorator managing preprocessing attributes.
Returns:
| Type | Description |
|---|---|
list
|
Preprocessing Tasks. |
vars
property
Property decorator managing vars from the ensemble configuration.
Returns:
| Type | Description |
|---|---|
dict
|
vars from ensemble configuration. |
Task
TaskArrayMixin
Generates sets of Task objects from Batch object members
Source code in model_ensembler/config.py
task_array(attr)
Yields Tasks from a configuration instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attr
|
str
|
Name of the member property in the configuration that defines the list of Task objects. |
required |
Yields:
| Type | Description |
|---|---|
object
|
Task object |
Source code in model_ensembler/config.py
YAMLConfig
Configuration processor for model-ensemble YAML-based configurations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
configuration
|
str
|
Name of the YAML configuration to load. |
required |
Source code in model_ensembler/config.py
validate(json_schema, yaml_file)
staticmethod
Validate a YAML configuration against a JSON schema.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json_schema
|
str
|
Name of schema to validate against. |
required |
yaml_file
|
str
|
Name of the configuration to validate. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
contains JSON schema, YAML data. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If "name" and "basedir" are specified in "batch_config:" instead of "batches:". |
Source code in model_ensembler/config.py
exceptions
runners
run_check(func, check)
async
Run a check configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
callable
|
Async check method. |
required |
check
|
dict
|
Check configuration. |
required |
Raises:
| Type | Description |
|---|---|
CheckException
|
Any exception from the called check. |
Source code in model_ensembler/runners.py
run_runner(limit, tasks)
async
Runs a list of tasks asynchronously.
Given a particular limit, establish a semaphore and run up to limit tasks. Once the list of tasks is complete, return.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Context object for retrieving configuration. |
required |
tasks
|
list
|
Tasks and checks. |
required |
Returns:
| Type | Description |
|---|---|
list
|
Completed tasks. |
Source code in model_ensembler/runners.py
run_task(func, task)
async
Run a task configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_ctx
|
object
|
Context object for retrieving configuration. |
required |
task
|
dict
|
Task configuration. |
required |
Raises:
| Type | Description |
|---|---|
TaskException
|
Any exception from the called task. |
Returns:
| Type | Description |
|---|---|
bool
|
True if task runs without exception. |
Source code in model_ensembler/runners.py
run_task_items(items)
async
Run a set of task and checks.
Run the list of tasks and check items, the configuration references the
model_ensemble.tasks method to use and the context/configuration
provides the arguments. TaskException and CheckException are trapped and
rethrown as ProcessingException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
items
|
list
|
Tasks and checks. |
required |
Raises:
| Type | Description |
|---|---|
ProcessingException
|
A common exception thrown for failures in the individual tasks. |
Source code in model_ensembler/runners.py
tasks
CheckException
Bases: EnsembleException
For check failures
ProcessingException
Bases: EnsembleException
For general processing failures
TaskException
Bases: EnsembleException
For task processing failures
check(ctx, cmd, cwd=None, log=False, fail=False, shell=None)
async
Check: Call arbitrary command as a check.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
cmd
|
str
|
See |
required |
cwd
|
str
|
See |
None
|
log
|
bool
|
See |
False
|
fail
|
bool
|
If true, then the check returning nonzero will raise an error rather than return false, meaning run abandonment rather than recheck will take place. |
False
|
shell
|
str
|
See |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if return code is zero, false otherwise. |
Raises:
| Type | Description |
|---|---|
FailureNotToleratedError
|
Error when fail is true and the check returns a nonzero code. |
Source code in model_ensembler/tasks/sys.py
execute(ctx, cmd, cwd=None, log=False, shell=None)
async
Process: Call arbitrary command as a processing task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
cmd
|
str
|
See |
required |
cwd
|
str
|
See |
None
|
log
|
bool
|
See |
False
|
shell
|
str
|
See |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if return code is zero, false otherwise. |
Source code in model_ensembler/tasks/sys.py
jobs(ctx, limit, match)
async
Check: Assert whether number of jobs in SLURM is under limit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
limit
|
int
|
Number of jobs to check for. |
required |
match
|
str
|
Prefix to match jobs by. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if number of jobs is less than limit, otherwise false. |
Source code in model_ensembler/tasks/hpc.py
move(ctx, dest, include=None, exclude=None, cwd=None)
async
Process: rsync current working directory contents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
dest
|
str
|
Path to copy ctx.id named directory to. |
required |
include
|
List[str]
|
rsync include specifiers. |
None
|
exclude
|
List[str]
|
rsync exclude specifiers, defaults to "*" when calling rsync if include specifiers are given and no exclude specifiers are provided. |
None
|
cwd
|
str
|
See |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
true if return code is zero, false otherwise. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If did not provide necessary context attribute for using this processing task. |
Source code in model_ensembler/tasks/sys.py
quota(ctx, atleast, mnt=None)
async
Check: Make sure quota is sufficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
atleast
|
int
|
Amount in kB. |
required |
mnt
|
str
|
Path for mount to check quota on if explicitly required. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if available space is less than atleast, false otherwise. |
Raises:
| Type | Description |
|---|---|
IndexError / TypeError
|
If quota cannot be determined. |
Source code in model_ensembler/tasks/hpc.py
remove(ctx, directory=None)
async
Process: Remove directory using shutil.rmtree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
directory
|
str
|
Specify the directory to remove, otherwise this will use the path specified by ctx.dir. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if return code is zero, false otherwise. |
Raises:
| Type | Description |
|---|---|
OSError
|
If directory cannot be removed. |
Source code in model_ensembler/tasks/sys.py
submit(ctx, script=None)
async
Process: Submit a new job to SLURM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
script
|
str
|
Slurm submission script for sbatch. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Job identifier. |
Source code in model_ensembler/tasks/hpc.py
exceptions
Task Exceptions
Exceptions relating to tasks
CheckException
Bases: EnsembleException
For check failures
EnsembleException
FailureNotToleratedError
ProcessingException
Bases: EnsembleException
For general processing failures
TaskException
Bases: EnsembleException
For task processing failures
hpc
init_hpc_backend(backend)
Initialise cluster backend to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backend
|
str
|
Cluster backed to use. |
required |
Raises:
| Type | Description |
|---|---|
ImportError / ModuleNotFoundError
|
If cluster backend cannot be imported. |
Source code in model_ensembler/tasks/hpc.py
jobs(ctx, limit, match)
async
Check: Assert whether number of jobs in SLURM is under limit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
limit
|
int
|
Number of jobs to check for. |
required |
match
|
str
|
Prefix to match jobs by. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if number of jobs is less than limit, otherwise false. |
Source code in model_ensembler/tasks/hpc.py
quota(ctx, atleast, mnt=None)
async
Check: Make sure quota is sufficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
atleast
|
int
|
Amount in kB. |
required |
mnt
|
str
|
Path for mount to check quota on if explicitly required. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if available space is less than atleast, false otherwise. |
Raises:
| Type | Description |
|---|---|
IndexError / TypeError
|
If quota cannot be determined. |
Source code in model_ensembler/tasks/hpc.py
submit(ctx, script=None)
async
Process: Submit a new job to SLURM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
script
|
str
|
Slurm submission script for sbatch. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Job identifier. |
Source code in model_ensembler/tasks/hpc.py
sys
check(ctx, cmd, cwd=None, log=False, fail=False, shell=None)
async
Check: Call arbitrary command as a check.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
cmd
|
str
|
See |
required |
cwd
|
str
|
See |
None
|
log
|
bool
|
See |
False
|
fail
|
bool
|
If true, then the check returning nonzero will raise an error rather than return false, meaning run abandonment rather than recheck will take place. |
False
|
shell
|
str
|
See |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if return code is zero, false otherwise. |
Raises:
| Type | Description |
|---|---|
FailureNotToleratedError
|
Error when fail is true and the check returns a nonzero code. |
Source code in model_ensembler/tasks/sys.py
execute(ctx, cmd, cwd=None, log=False, shell=None)
async
Process: Call arbitrary command as a processing task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
cmd
|
str
|
See |
required |
cwd
|
str
|
See |
None
|
log
|
bool
|
See |
False
|
shell
|
str
|
See |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if return code is zero, false otherwise. |
Source code in model_ensembler/tasks/sys.py
move(ctx, dest, include=None, exclude=None, cwd=None)
async
Process: rsync current working directory contents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
dest
|
str
|
Path to copy ctx.id named directory to. |
required |
include
|
List[str]
|
rsync include specifiers. |
None
|
exclude
|
List[str]
|
rsync exclude specifiers, defaults to "*" when calling rsync if include specifiers are given and no exclude specifiers are provided. |
None
|
cwd
|
str
|
See |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
true if return code is zero, false otherwise. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If did not provide necessary context attribute for using this processing task. |
Source code in model_ensembler/tasks/sys.py
remove(ctx, directory=None)
async
Process: Remove directory using shutil.rmtree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
object
|
Contextual configuration. |
required |
directory
|
str
|
Specify the directory to remove, otherwise this will use the path specified by ctx.dir. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if return code is zero, false otherwise. |
Raises:
| Type | Description |
|---|---|
OSError
|
If directory cannot be removed. |
Source code in model_ensembler/tasks/sys.py
utils
execute_command(cmd, cwd=None, log=False, shell=None)
async
Standard handling for calling external command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmd
|
str
|
The relative path of the command being called to cwd. |
required |
cwd
|
str
|
The current working directory to call the cmd from, passed to subprocess. |
None
|
log
|
bool
|
If true, output stdout/stderr to logfile in cwd. |
False
|
shell
|
str
|
Which shell to ask subprocess to invoke when processing the command, will default to bash internally. |
None
|
Returns:
| Type | Description |
|---|---|
object
|
Namespace containing the returncode, stdout and stderr from the process that was invoked. |
Source code in model_ensembler/tasks/utils.py
flight_task(func, check=True)
Decorator for making func as a task, providing context preprocessing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
callable
|
Callable to wrap with context. |
required |
check
|
bool
|
Determine whether the func is to be treated as a check or another type of action (checks can be skipped). |
True
|
Returns:
| Type | Description |
|---|---|
func
|
The wrapped function that can process the context provided appropriately. |
Source code in model_ensembler/tasks/utils.py
templates
prepare_run_directory(batch, run)
async
Preparing directory for each run from batch templates
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
batch
|
object
|
Whole batch configuration. |
required |
run
|
object
|
Specific run configuration. |
required |
Raises:
| Type | Description |
|---|---|
TemplatingError
|
If template directory cannot be moved from source to destination. |
Source code in model_ensembler/templates.py
process_templates(run, template_list)
Render templates based on provided context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run
|
object
|
Specific run configuration. |
required |
template_list
|
list
|
Paths to template sources. |
required |
Raises:
| Type | Description |
|---|---|
TemplatingError
|
If cannot template using the provided format. |
Source code in model_ensembler/templates.py
utils
Arguments
Bases: object
Singleton implementation of the arguments as an immutable object
Source code in model_ensembler/utils.py
background_fork(double=False)
Allows for the calling process to fork into the background.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
double
|
bool
|
If true, we'll fork again as to allow the parent of the first child to kill it, leaving the daemon process. |
False
|
Raises:
| Type | Description |
|---|---|
OSError
|
If fork fails. |
Source code in model_ensembler/utils.py
setup_logging(name='', level=logging.INFO, verbose=False, logdir=os.path.join('logs'), logformat='[%(asctime)-20s :%(levelname)-8s] - %(message)s')
Sets up logging library for output with user friendly options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
string
|
A string indicating the name of the caller. |
''
|
level
|
int
|
|
INFO
|
verbose
|
bool
|
Shorthand for setting level to |
False
|
logdir
|
string
|
If logging to a file, allow directory destination. |
join('logs')
|
logformat
|
string
|
Allow specification of |
'[%(asctime)-20s :%(levelname)-8s] - %(message)s'
|