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_typedefaults to its unit’s default number type. Every conversion map has the keys ofconversion_map; aLinearMapadds those oflinear_mapand aTableMapthose oftable_map. Every flow-control element has the keys offlow_control_element, and every destination of a jump those ofjump_destination; a destination’srepeat_counthas no default, its absence meaning no limit. Every FlowMap has the keys offlow_mapand every virtual timeline those ofvirtual_timeline; the manifest’sflow_mapsandvirtual_timelineshave no default and are never added. Every named timestamp ofgraphical.timestampshas the keys oftimestamp, a match timestamp (matchstamp: true) those ofmatch_timestampinstead, every alignment anchor of a named MatchStamp those ofalignment_anchor, and every elision ofgraphical.elisionsthose ofelision(itswidthhas none). A resource has no defaults.@context,statementsandprovenancehave no default:completeandminimalneither add nor drop them. The JavaScript package’sDEFAULTSholds the same table, and the schema declares each value as the key’sdefault.
- 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_typeis 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 (ascanonical_orderrespells them), thedisplayof a named timestamp, an alignment anchor and an elision in canonical order, and unknown keys pass through. The JavaScript package’scompletegives 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’sscalarwritten[1, 1]or1.0equals the default1and is left out), after own-axis values are respelled and eachdisplayis put in canonical order.minimal(complete(x))equalsminimal(x)andcomplete(minimal(x))equalscomplete(x). The JavaScript package’sminimalgives the same value.