Skip to content
Mark T. Holder edited this page Sep 14, 2014 · 3 revisions

PhyloSchema

This class (importable from peyotl.nexson_syntax) provides a simple container for holding the set of variables needed to convert from one format to another (with error checking).

The primary motivation for this class is to:

  1. generate type conversion errors up front when some one requests a particular coercion. For example, this allows the phylesystem api to raise an error before it fetches the data in cases in which the user is requesting a format/content combination is not currently supported (or not possible)
  2. allow that agreed-upon coercion to be done later with a simple call to convert or serialize. So the class acts like a closure that can transform any nexson to the desired format (if NexSON has the necessary content)
Clone this wiki locally