lsst.utils 
The lsst.utils 
Python API reference 
lsst.utils Package 
Functions 
 
continueClass Re-open the decorated class, adding any new definitions into the original. 
demangleType Demangle a C++ type string. 
deprecate_pybind11 Deprecate a pybind11-wrapped C++ interface function, method or class. 
doImport Import a python object given an importable string and return it. 
doImportType Import a python type given an importable string and return it. 
getPackageDir Find the file system location of the EUPS package. 
get_caller_name Get the name of the caller method. 
inClass Add the decorated function to the given class as a method. 
inheritDoc Extend existing documentation for a method that exists in another class and extend it with any additional documentation defined. 
isEnabled Check that backtrace is enabled. 
suppress_deprecations Suppress warnings generated by deprecated.sphinx.deprecated  
 
 
Classes 
 
TemplateMeta A metaclass for abstract base classes that tie together wrapped C++ template types. 
 
 
Class Inheritance Diagram 
Inheritance diagram of lsst.utils.wrappers.TemplateMeta
  
 
lsst.utils.tests Module 
Functions 
 
init Initialize the memory tester and file descriptor leak tester. 
getTempFilePath Return a path suitable for a temporary file and try to delete the file on success 
assertFloatsAlmostEqual Highly-configurable floating point comparisons for scalars and arrays. 
assertFloatsNotEqual Fail a test if the given floating point values are equal to within the given tolerances. 
assertFloatsEqual Assert that lhs == rhs (both numeric types, whether scalar or array). 
debugger Enter the debugger when there’s an uncaught exception 
classParameters Class decorator for generating unit tests 
methodParameters Iterate over supplied settings to create subtests automatically. 
temporaryDirectory Context manager that creates and destroys a temporary directory. 
 
 
Classes 
 
MemoryTestCase Check for resource leaks. 
ExecutablesTestCase Test that executables can be run and return good status. 
TestCase Subclass of unittest.TestCase that adds some custom assertions for convenience. 
 
 
Class Inheritance Diagram 
Inheritance diagram of lsst.utils.tests.MemoryTestCase, lsst.utils.tests.ExecutablesTestCase, lsst.utils.tests.TestCase
  
 
lsst.utils.logging Module 
Functions 
 
getLogger Get a logger compatible with LSST usage. 
getTraceLogger Get a logger with the appropriate TRACE name. 
trace_set_at Adjust logging level to display messages with the trace number being less than or equal to the provided value. 
 
 
Classes 
 
LsstLogAdapter A special logging adapter to provide log features for LSST code. 
PeriodicLogger Issue log messages if a time threshold has elapsed. 
 
 
Class Inheritance Diagram 
Inheritance diagram of lsst.utils.logging.LsstLogAdapter, lsst.utils.logging.PeriodicLogger
  
 
lsst.utils.iteration Module 
Functions 
 
chunk_iterable Return smaller chunks of an iterable. 
ensure_iterable Ensure that the input is iterable. 
isplit Split a string or bytes by separator returning a generator. 
 
 
 
lsst.utils.classes Module 
Functions 
 
cached_getter Decorate a method to cache the result. 
immutable Decorate a class to simulate a simple form of immutability. 
 
 
Classes 
 
Singleton Metaclass to convert a class to a Singleton. 
 
 
Class Inheritance Diagram 
Inheritance diagram of lsst.utils.classes.Singleton
  
 
lsst.utils.introspection Module 
Functions 
 
get_class_of Given the type name or a type, return the python type. 
get_full_type_name Return full type name of the supplied entity. 
get_instance_of Given the type name or a type, instantiate an object of that type. 
get_caller_name Get the name of the caller method. 
 
 
 
lsst.utils.timer Module 
Functions 
 
profile Profile the enclosed code block and save the result to a file. 
logInfo Log timer information to obj.metadata obj.log  
timeMethod Measure duration of a method. 
time_this Time the enclosed block and issue a log message. 
 
 
 
lsst.utils.packages Module 
Classes 
 
Packages A table of packages and their versions. 
 
 
Class Inheritance Diagram 
Inheritance diagram of lsst.utils.packages.Packages
  
 
lsst.utils.threads Module 
 
lsst.utils.ellipsis Module 
A type-annotation workaround for ... 
This module provides Ellipsis EllipsisType ... typing.TYPE_CHECKING True here ).
Type checkers should recognize enum literals as singletons, making this pair
behave as expected under is 
v :  EllipsisType  |  int 
if  v  is  not  Ellipsis : 
    v  +=  2   # type checker should now see v as a pure int 
This works best when there is a clear boundary between code that needs to be
type-checked and can use  Ellipsis ... typing.Any ...