cf.Constructs.ordered

Constructs.ordered()[source]

Return the constructs in their predetermined order.

For cell method constructs, the predetermined order is that in which they where added. There is no predetermined ordering for all other construct types, and a exception is raised if any non-cell method constructs are present.

New in version (cfdm): 1.7.0

Returns
collections.OrderedDict

The constructs and their construct keys, in their predetermined order.

Examples:

>>> f = cf.Field()
>>> c = f.constructs
>>> c.ordered()
{}
>>> m1 = cf.CellMethod(axes=['domainaxis1'], method='mean')
>>> c._set_construct(m1, key='cell_method_for_axis_1')
'cell_method_for_axis_1'
>>> m2 = cf.CellMethod(axes=['domainaxis0'], method='minimum')
>>> c._set_construct(m2, key='cell_method_for_axis_0')
'cell_method_for_axis_0'
>>> print(c)
Constructs:
{'cell_method_for_axis_0': <CellMethod: domainaxis0: minimum>,
 'cell_method_for_axis_1': <CellMethod: domainaxis1: mean>}
>>> c.ordered()
OrderedDict([('cell_method_for_axis_1', <CellMethod: domainaxis1: mean>),
             ('cell_method_for_axis_0', <CellMethod: domainaxis0: minimum>)])