timetoshare.defaults#

The defaults of a TimeToShare manifest: the complete and the minimal form.

Every key with a default may be left out of a manifest, and a reader supplies the default. The complete form writes every such key, its default included; the minimal form leaves out exactly the keys whose value is the default. Either form reads to the same manifest, and each converts to the other. A key whose default is “absent” (a manifest’s id and graphical, a root’s offset) is never added and never removed. Unknown keys pass through untouched.

timetoshare.defaults.DEFAULTS: dict[str, dict[str, Any]] = {'alignment_anchor': {'display': ['line']}, 'conversion_map': {'name': None}, 'elision': {'display': ['ellipsis', 'name']}, 'flow_control_element': {'label': None, 'meta': {}, 'name': None}, 'flow_map': {'canonical': False, 'name': None}, 'graphical': {'elisions': [], 'matchstamps': [], 'order': {}, 'rules': [], 'styles': {}, 'timestamps': []}, 'group': {'meta': {}, 'name': None}, 'jump_destination': {'determined': True, 'label': None, 'reset': True}, 'linear_map': {'offset': 0, 'scalar': 1}, 'manifest': {'groups': [], 'measure_maps': [], 'meta': {}, 'name': None, 'resources': []}, 'match_timestamp': {'display': ['cross_section'], 'groupstamp': False}, 'measure_map': {'meta': {}, 'name': None}, 'region': {'meta': {}, 'name': None}, 'table_map': {'extrapolate': 'none', 'kind': 'linear'}, 'timeline': {'children': [], 'conversion_maps': [], 'flow_control': [], 'is_segment_line': False, 'locked': False, 'meta': {}, 'name': None, 'regions': []}, 'timestamp': {'display': ['wedge', 'name', 'cross_section'], 'groupstamp': False, 'matchstamp': False}, 'virtual_timeline': {'name': None}}#

The default of every key that has one, by the kind of object holding it.

A timeline’s number_type defaults to its unit’s default number type. Every conversion map has the keys of conversion_map; a LinearMap adds those of linear_map and a TableMap those of table_map. Every flow-control element has the keys of flow_control_element, and every destination of a jump those of jump_destination; a destination’s repeat_count has no default, its absence meaning no limit. Every FlowMap has the keys of flow_map and every virtual timeline those of virtual_timeline; the manifest’s flow_maps and virtual_timelines have no default and are never added. Every named timestamp of graphical.timestamps has the keys of timestamp, a match timestamp (matchstamp: true) those of match_timestamp instead, every alignment anchor of a named MatchStamp those of alignment_anchor, and every elision of graphical.elisions those of elision (its width has none). A resource has no defaults. @context, statements and provenance have no default: complete and minimal neither add nor drop them. The JavaScript package’s DEFAULTS holds the same table, and the schema declares each value as the key’s default.

timetoshare.defaults.complete(value)[source]#

Return a copy of a manifest in the complete form.

Every key with a default that is absent is added with its default, at every depth (a timeline’s number_type is its unit’s default). Keys whose default is “absent” are never added, present keys keep their values, own-axis values respelled as their number type selects (as canonical_order respells them), the display of a named timestamp, an alignment anchor and an elision in canonical order, and unknown keys pass through. The JavaScript package’s complete gives the same value.

timetoshare.defaults.minimal(value)[source]#

Return a copy of a manifest in the minimal form.

The complete form without every key whose value equals its default in value, numbers compared by exact value (a LinearMap’s scalar written [1, 1] or 1.0 equals the default 1 and is left out), after own-axis values are respelled and each display is put in canonical order. minimal(complete(x)) equals minimal(x) and complete(minimal(x)) equals complete(x). The JavaScript package’s minimal gives the same value.