0039 - Several values per element are written with their shape
Status: accepted
Context
A property of the package can hold more than one value per element: a matrix per
node (the cube of an azimuthal resistivity tool holds [81, 81] per station), a
vector, a tensor. The standard says it in ValueCountPerIndexableElement, a list
of counts, slowest first, and in LabelPerComponent for the names of the
components (RESQML TRG 2.2 section 7.1 p. 222). The note of the figure p. 221 gives
the order of the dataset: the elements first, then the dimensions of one element, and
time slowest of all when the property is a series.
Until now the one writer of a ContinuousProperty wrote [1] and a flat array.
A property derived from such a cube (the ratio of two directions, the difference of
two passes) would have lost its shape, and a reader would have taken a matrix per
node for a long scalar column.
Decision
property::write_shapedis the one writer, andwrite_timedis a call to it with a scalar shape. There is no second function that writes a property.- The shape is the one of the domain (
ElementShape): its dimensions are written asValueCountPerIndexableElement, its labels, when it has some, asLabelPerComponent; without labels the field is absent, never an empty list. - The dataset is
[elements, d1, d2, ...], or[steps, elements, d1, ...]for a series: time the slowest dimension, the elements, then the shape of one element. - A scalar writes what it always wrote:
[1]and a flat array, the same bytes as before. A test holds it. - The nodes are counted in elements, not in values: a representation of three
nodes does not take eight values of a shape
[2, 2], and the refusal names both counts. A number of values that is not a whole number of elements is refused, never truncated. CountPerValuestays 1. The common TRG 2.3 does not define it for a floating point array (section 6.19 p. 95 names the attribute forBooleanExternalArraywithout a note); the shape is said byValueCountPerIndexableElementand by the dimensions of the dataset. TODO(verify): a statement of the standard onCountPerValueof a floating point external array.- The shape is not a parameter of the activity. It is in the object written, the
template of
propertydeclares no slot of shape. The operationcombine, which writes a derived property, asks for the shape of its parents (valuesPerElementandcomponentLabels) because a plan reads no object but the ones it is given.
Consequences
- A derived property keeps the shape of its parents, and the readers that already
understand
ValueCountPerIndexableElementread it back without a change. - A caller that states a shape different from the parents’ writes a property of that shape: the operation checks the number of values against it, not against the parents’ own declaration, which it is not given.
- The question of
CountPerValuestays open until the standard answers it; the value 1 is the one every writer of the workspace has written.