TreeDict

A fast and full-featured dict-like tree container to make parameter, variable and data bookkeeping easy
Download

TreeDict Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Hoyt Koepke
  • Publisher web site:
  • http://www.stat.washington.edu/~hoytak/

TreeDict Tags


TreeDict Description

A fast and full-featured dict-like tree container to make parameter, variable and data bookkeeping easy TreeDict is a dictionary-like, hierarcical python container to simplify the bookkeeping surrounding parameters, variables and data. It aims to be fast, lightweight, intuitive, feature-rich and stable.While intended for general python development, it includes a number of features particularly useful for scientific programming. TreeDict is similar in basic functionality to MATLAB structures in terms of concise syntax and implicit branch creation. In addition, though, TreeDict implements all the methods of regular dictionaries, pickling, fast non-intersecting hashing for efficient caching, manipulations on the tree structure, and a system for forward referencing branches to make lists of parameters more readable.Short Example:A brief example to wet the appetite:t = TreeDict()# Action specified at top for clarityt.action = t.action_definitions.make_apple_stroudel # dangling branch# Now specify definitionst.action_definitions.make_apple_stroudel.action = "puree"t.action_definitions.make_apple_stroudel.ingredients = # And so on... Here are some key features of "TreeDict": · A design emphasis on concise, immediately readable and intuitive syntax and functionality. · All dictionary operations and methods are implemented, allowing TreeDict to be a drop-in replacement for a dictionary in many cases (The limitation is that branch and value names must be strings following python variable/attribute naming conventions). · An optional, central lookup of “registered” trees (similar to loggers in the python logging module) to ease global parameter setting and bookkeeping. · Manipulations on the tree structure, including attaching, detaching, copying, updating (merging), hashing, freezing and equality testing are supported and optimized. · A method that takes non-intersecting hashes over all or parts of the tree to facilitate testing, caching and indexing. · Implicit creation of branches to allow for more natural and readable ordering when defining parameters (see example below). · TreeDict API is well documented and covered by unit tests. · Written in cython for speed and stability. · Close-matching key retrieval to aid in offering helpful error messages. · Licensed under the liberal BSD open source license. Requirements: · Python


TreeDict Related Software