This module provides a variety of utilities that are useful when working with Cyclopts.
Provides some useful tools for working with Cyclopts, including reporting output.
author: | Matthew Gidden <matthew.gidden _at_ gmail.com> |
---|
A simple helper class to increment a value
Parameters: | start : int, optional
|
---|
A composable configuration class for cyclopts. Unlike argparse.Namespace, this keeps the object dictionary (__dict__) separate from the run control attributes dictionary (_dict). Modified from xdress’ run control in xdress/utils.py
Parameters: | kwargs : optional
|
---|
Collects all instids as specified.
If rc and instids is None, all ids found in the h5file’s path are collected. Otherwise, instids provided by the instid listing and the paramater space defined by the run control inst_queries parameter are collected.
Parameters: | h5file : PyTables File object
path : str
rc : RunControl object, optional
instids : collection of uuids
colname : str
|
---|
Combines two or more databases with identical layout, writing their output into a new file or appending to the first in the list.
Parameters: | files : iterator
new_file : str, optional
clean : bool, optional
|
---|
return a list of persistable members per the Cyclopts style guide.
A function equivalent to the Python 2.x execfile statement. Taken from xdress/utils.py
Parameters: | x : list of lists of arguments |
---|---|
Returns: | args : generator
|
Get an object of certain kind, e.g. species or family. Both the rc and args argument will be searched for attributes named <kind>_package, <kind>_module, and <kind>_cname. The package/module is then imported and an instance of the cname is returned. The CLI is searched before the rcs.
Parameters: | kind : str
rcs : list of RunControl objects or single object, optional
args : argparse args, optional
|
---|
Parameters: | x : dict, list, or other iter_keys : a list of keys atomic values should be iterables, optional recurse : bool, whether to recurse at the lowest level |
---|---|
Returns: | n : int
|
Get information about an importable object
Parameters: | kind : str
rcs : list of RunControl objects or single object, optional
args : argparse args, optional
|
---|
Parse a list of rc files.
Parameters: | files : list or str
|
---|---|
Returns: | rc : RunControl |
Tests an ssh connection and returns success or failure thereof.
Parameters: | client : paramiko SSH client host : str user : str keyfile : str, optional auth : bool, optional
|
---|