@@ -3708,7 +3708,12 @@ def weights(
37083708 weights_axes.discard(xaxis)
37093709 weights_axes.discard(yaxis)
37103710 if not Weights.cell_measure(
3711- self, "area", comp, weights_axes, methods=methods
3711+ self,
3712+ "area",
3713+ comp,
3714+ weights_axes,
3715+ methods=methods,
3716+ auto=True,
37123717 ):
37133718 Weights.area_XY(
37143719 self,
@@ -4919,7 +4924,6 @@ def collapse(
49194924 scale=None,
49204925 radius="earth",
49214926 great_circle=False,
4922- cell_measures=True,
49234927 verbose=None,
49244928 remove_vertical_crs=True,
49254929 _create_zero_size_cell_bounds=False,
@@ -5477,14 +5481,12 @@ def collapse(
54775481 the field construct's `weights` method:
54785482 ``f.weights(weights, components=True, axes=axes,
54795483 measure=measure, scale=scale, radius=radius,
5480- great_circle=great_circle,
5481- cell_measures=cell_measures)``.
5484+ great_circle=great_circle)``.
54825485
5483- See the *axes*, *measure*, *scale*, *radius*,
5484- *great_circle*, and *cell_measures* parameters, and
5485- `cf.Field.weights` for details; and note that the
5486- value of *scale* may be modified depending on the
5487- value of *measure*.
5486+ See the cf.Field.weights` and the *axes*, *measure*,
5487+ *scale*, *radius*, and *great_circle* parameters for
5488+ details; and note that the value of *scale* may be
5489+ modified depending on the value of *measure*.
54885490
54895491 .. warning:: By default *weights* is `None`, resulting
54905492 in **unweighted calculations**.
@@ -5500,9 +5502,10 @@ def collapse(
55005502 units of the weights are not combined with
55015503 the field's units in the collapsed field.
55025504
5503- .. note:: A pre-calculated weights array may also be
5504- provided as the *weights* parameter. See
5505- `cf.Field.weights` for details
5505+ .. note:: A pre-calculated weights array or dictionary
5506+ may also be provided as the *weights*
5507+ parameter. See `cf.Field.weights` for
5508+ details
55065509
55075510 If the collapse method and axes have been provided as
55085511 a CF cell methods-like string via the *method*
@@ -5619,15 +5622,6 @@ def collapse(
56195622
56205623 .. versionadded:: 3.2.0
56215624
5622- cell_measures: `bool`, optional
5623- If True, the default, then area and volume cell
5624- measure constructs are considered for weights creation
5625- when *weights* is `True`, ``'area'``, or
5626- ``'volume'``. If False then cell measure constructs
5627- are ignored for these *weights*.
5628-
5629- .. versionadded:: NEXTVERSION
5630-
56315625 squeeze: `bool`, optional
56325626 If True then size 1 collapsed axes are removed from the
56335627 output data array. By default the axes which are collapsed
@@ -6733,7 +6727,6 @@ def collapse(
67336727 measure=measure,
67346728 radius=radius,
67356729 great_circle=great_circle,
6736- cell_measures=cell_measures,
67376730 )
67386731 if g_weights:
67396732 # For grouped collapses, bring the weights
@@ -6768,7 +6761,6 @@ def collapse(
67686761 group_by=group_by,
67696762 axis_in=axes_in[0],
67706763 verbose=verbose,
6771- cell_measures=cell_measures,
67726764 )
67736765
67746766 if regroup:
@@ -6839,7 +6831,6 @@ def collapse(
68396831 measure=measure,
68406832 radius=radius,
68416833 great_circle=great_circle,
6842- cell_measures=cell_measures,
68436834 )
68446835 if d_weights:
68456836 d_kwargs["weights"] = d_weights
@@ -7113,7 +7104,6 @@ def _collapse_grouped(
71137104 coordinate=None,
71147105 measure=False,
71157106 weights=None,
7116- cell_measures=True,
71177107 squeeze=None,
71187108 group_by=None,
71197109 axis_in=None,
0 commit comments