LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Classes | |
class | TaskRunner |
Run a command-line task, using multiprocessing if requested. More... | |
class | ButlerInitializedTaskRunner |
A TaskRunner for CmdLineTasks that require a 'butler' keyword argument to be passed to their constructor. More... | |
class | CmdLineTask |
Base class for command-line tasks: tasks that may be executed from the command line. More... | |
Functions | |
def | _poolFunctionWrapper |
def | _runPool |
def | profile |
Context manager for profiling with cProfile. More... | |
Variables | |
list | __all__ = ["CmdLineTask", "TaskRunner", "ButlerInitializedTaskRunner"] |
|
private |
Wrapper around function to catch exceptions that don't inherit from Exception Such exceptions aren't caught by multiprocessing, which causes the slave process to crash and you end up hitting the timeout.
Definition at line 37 of file cmdLineTask.py.
|
private |
Wrapper around pool.map_async, to handle timeout This is required so as to trigger an immediate interrupt on the KeyboardInterrupt (Ctrl-C); see http://stackoverflow.com/questions/1408356/keyboard-interrupts-with-pythons-multiprocessing-pool Further wraps the function in _poolFunctionWrapper to catch exceptions that don't inherit from Exception.
Definition at line 54 of file cmdLineTask.py.
def lsst.pipe.base.cmdLineTask.profile | ( | filename, | |
log = None |
|||
) |
Context manager for profiling with cProfile.
filename | filename to which to write profile (profiling disabled if None or empty) |
log | log object for logging the profile operations |
If profiling is enabled, the context manager returns the cProfile.Profile object (otherwise it returns None), which allows additional control over profiling. You can obtain this using the "as" clause, e.g.:
with profile(filename) as prof: runYourCodeHere()
The output cumulative profile can be printed with a command-line like:
python -c 'import pstats; pstats.Stats("<filename>").sort_stats("cumtime").print_stats(30)'
Definition at line 66 of file cmdLineTask.py.
list lsst.pipe.base.cmdLineTask.__all__ = ["CmdLineTask", "TaskRunner", "ButlerInitializedTaskRunner"] |
Definition at line 35 of file cmdLineTask.py.