diff --git a/src/awkward/_namedaxis.py b/src/awkward/_namedaxis.py index 9d224791b2..f71f94a179 100644 --- a/src/awkward/_namedaxis.py +++ b/src/awkward/_namedaxis.py @@ -70,18 +70,6 @@ def _get_named_axis( return {} -def _supports_named_axis(ctx: MaybeSupportsNamedAxis | AttrsNamedAxisMapping) -> bool: - """Check if the given ctx supports named axis. - - Args: - ctx (SupportsNamedAxis or AttrsNamedAxisMapping): The ctx to check. - - Returns: - bool: True if the ctx supports named axis, False otherwise. - """ - return bool(_get_named_axis(ctx)) - - def _make_positional_axis_tuple(n: int) -> tuple[int, ...]: """ Generates a positional axis tuple of length n. @@ -112,8 +100,6 @@ def _is_valid_named_axis(axis: AxisName) -> bool: Examples: >>> _is_valid_named_axis("x") True - >>> _is_valid_named_axis(NamedAxisMarker()) - True >>> _is_valid_named_axis(1) False """ @@ -288,9 +274,6 @@ def _set_named_axis_to_attrs( # - "remove one" (_remove_named_axis): Remove the named axis from the output array, e.g.: `ak.sum` # - "add one" (_add_named_axis): Add a new named axis to the output array, e.g.: `ak.concatenate, ak.singletons` (not clear yet...) # - "unify" (_unify_named_axis): Unify the named axis in the output array given two input arrays, e.g.: `__add__` -# - "collapse" (_collapse_named_axis): Collapse multiple named axis to None in the output array, e.g.: `ak.flatten` -# - "permute" (_permute_named_axis): Permute the named axis in the output array, e.g.: `ak.transpose` (does this exist?) -# - "contract" (_contract_named_axis): Contract the named axis in the output array, e.g.: `matmul` (does this exist?) def _keep_named_axis( @@ -525,13 +508,6 @@ def _add_named_axis( return out -def _permute_named_axis( - axis: int, - named_axis: AxisTuple, -) -> AxisTuple: - raise NotImplementedError() - - def _unify_named_axis( named_axis1: AxisMapping, named_axis2: AxisMapping, @@ -602,24 +578,6 @@ def _get_axis_name( return unified_named_axis -def _collapse_named_axis( - named_axis: AxisMapping, - axis: tuple[int, ...] | int | None, -) -> AxisMapping: - """ - Determines the new named axis after collapsing the specified axis. This is useful, for example, - when applying a flatten operation along an axis. - - Args: - axis (tuple[int, ...] | int | None): The index of the axis to collapse. If None, all axes are collapsed. - named_axis (AxisMapping): The current named axis. - - Returns: - AxisMapping: The new named axis after collapsing the specified axis. - """ - raise NotImplementedError() - - class Slicer: """ Provides a more convenient syntax for slicing. diff --git a/src/awkward/operations/ak_with_named_axis.py b/src/awkward/operations/ak_with_named_axis.py index 0d6b50efad..c9e5cf0505 100644 --- a/src/awkward/operations/ak_with_named_axis.py +++ b/src/awkward/operations/ak_with_named_axis.py @@ -41,15 +41,7 @@ def with_named_axis( Returns an #ak.Array or #ak.Record (or low-level equivalent, if `highlevel=False`) with a new name. This function does not change the - array in-place. If the new name is None, then an array without a name is - returned. - - The records or tuples may be nested within multiple levels of nested lists. - If records are nested within records, only the outermost are affected. - - Setting the `"__record__"` parameter makes it possible to add behaviors - to the data; see #ak.Array and #ak.behavior for a more complete - description. + array in-place. If the new name is None, then the array is returned as it is. """ # Dispatch yield (array,) diff --git a/src/awkward/operations/ak_without_named_axis.py b/src/awkward/operations/ak_without_named_axis.py index f1d3b70bf8..b19883bf97 100644 --- a/src/awkward/operations/ak_without_named_axis.py +++ b/src/awkward/operations/ak_without_named_axis.py @@ -25,8 +25,6 @@ def without_named_axis( """ Args: array: Array-like data (anything #ak.to_layout recognizes). - named_axis: AxisTuple | AxisMapping: Names to give to the array axis; this assigns - the `"__named_axis__"` attr. If None, any existing name is unset. highlevel (bool): If True, return an #ak.Array; otherwise, return a low-level #ak.contents.Content subclass. behavior (None or dict): Custom #ak.behavior for the output array, if @@ -35,16 +33,8 @@ def without_named_axis( high-level. Returns an #ak.Array or #ak.Record (or low-level equivalent, if - `highlevel=False`) with a new name. This function does not change the - array in-place. If the new name is None, then an array without a name is - returned. - - The records or tuples may be nested within multiple levels of nested lists. - If records are nested within records, only the outermost are affected. - - Setting the `"__record__"` parameter makes it possible to add behaviors - to the data; see #ak.Array and #ak.behavior for a more complete - description. + `highlevel=False`) without named axes. This function does not change the + array in-place. """ # Dispatch yield (array,)