Tollan Documentation¶
The tollan package includes various utility routines that are shared
across the python packages developed for the TolTEC project.
Reference/API¶
tollan Package¶
tollan.utils Package¶
Functions¶
  | 
Get attribute recursively.  | 
  | 
Return python object specified by   | 
Return the package data path.  | 
|
  | 
Return an ordered dict from list.  | 
  | 
Return a decorator that replace attribute with decorated item.  | 
  | 
Return a map and sum generator.  | 
  | 
Return a typed object from string   | 
  | 
Return a dict from matching   | 
  | 
Return a   | 
  | 
Return a new string with prefix   | 
  | 
Return the sum of two objects.  | 
  | 
Update dict recursively.  | 
  | 
Load module from filepath.  | 
Execute   | 
|
  | 
Reload module recursively.  | 
  | 
Return a map and reduce generator.  | 
Classes¶
  | 
A context manager that allow inject code to object’s method.  | 
  | 
A simple structure to hold file location info.  | 
Class Inheritance Diagram¶
tollan.utils.cli.click_helpers Module¶
Functions¶
  | 
Create positional argument that are of variable length.  | 
  | 
A context manager that hook the make context function to reuse context object.  | 
  | 
Return True if context object should not be recreated.  | 
tollan.utils.cli.multi_action_argparser Module¶
Classes¶
  | 
This class wraps the   | 
Class Inheritance Diagram¶
tollan.utils.db Package¶
Classes¶
A class that holds definitions to a table.  | 
|
  | 
|
A class that provide access to database related entities similar to that of   | 
Class Inheritance Diagram¶
tollan.utils.db.conventions Module¶
This module defines a set of helpers for defining database with some column naming conventions.
Functions¶
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
Class Inheritance Diagram¶
tollan.utils.env Module¶
Classes¶
A registry class that helps work with env vars.  | 
Class Inheritance Diagram¶
tollan.utils.fmt Module¶
Functions¶
  | 
|
  | 
|
  | 
|
  | 
Return info of python object.  | 
  | 
|
tollan.utils.log Package¶
Functions¶
  | 
Initialize logging with some sensible presets.  | 
  | 
Return a logger named   | 
Classes¶
  | 
Context decorator that logs the execution time of the decorated item.  | 
  | 
Decorator that logs the execution of the decorated item.  | 
Class Inheritance Diagram¶
tollan.utils.mpl Module¶
Some matplotlib helpers.
Functions¶
  | 
Save figure or show plot, depending on the last sys.argv  | 
tollan.utils.namespace Module¶
Functions¶
  | 
Construct a   | 
  | 
Return a dict composed from object’s attributes.  | 
Classes¶
A convenient class that manages a set of attributes.  | 
Class Inheritance Diagram¶
tollan.utils.nc Package¶
Functions¶
  | 
Return a context manager to open netCDF file.  | 
  | 
Return a pretty formatted string for netCDF4 dataset.  | 
Classes¶
  | 
A adaptor class that accesses netCDF4 dataset with a custom name map.  | 
Class Inheritance Diagram¶
tollan.utils.np Module¶
Functions¶
  | 
Reshape an array with possible trimming of extraneous items.  | 
tollan.utils.registry Module¶
Functions¶
  | 
Register the decorated item with key.  | 
Class Inheritance Diagram¶
tollan.utils.slice Module¶
Functions¶
  | 
Return a bounded slice given length   | 
  | 
Return a slice object from string.  | 
Classes¶
  | 
A chain of slices, with known array size.  | 
  | 
A chain of slices.  | 
  | 
This provides a interface similar to that of pandas   | 
Class Inheritance Diagram¶
tollan.utils.dirconf Module¶
Classes¶
Raise when errors occur in   | 
|
A mix-in class for managing configuration files stored in a directory.  | 
Class Inheritance Diagram¶
tollan.utils.sys Module¶
Functions¶
Same as the shell command   | 
|
  | 
Same as the shell command   | 
tollan.utils.schema Module¶
Functions¶
  | 
Return validator to validate a relative path.  | 
Return a schema that has optional defaults computed from nested schema.  |