Skip to content

awkward's named axes causes regression in test_notebooks #524

Description

@veprbl

Vector Version

1.5.2

Python Version

3.11 and 3.12

OS / Environment

nixpkgs
NixOS/nixpkgs#354346

Describe the bug

Failure in tests/test_notebooks.py

E           papermill.exceptions.PapermillExecutionError: 
E           ---------------------------------------------------------------------------
E           Exception encountered at "In [96]":
E           ---------------------------------------------------------------------------
E           AttributeError                            Traceback (most recent call last)
E           Cell In[96], line 2
E                 1 (
E           ----> 2     vector.Array(
E                 3         [  # an Awkward Array of vectors
E                 4             [{"x": 1, "y": 1.1}, {"x": 2, "y": 2.2}],
E                 5             [],
E                 6             [{"x": 3, "y": 3.3}],
E                 7             [{"x": 4, "y": 4.4}, {"x": 5, "y": 5.5}],
E                 8         ]
E                 9     )
E                10     + vector.obj(x=10, y=5)  # and a single vector object
E                11 )
E           
E           File /nix/store/yq4a8j78af4l3rcc1m7sf5kqqv3ydnkb-python3.12-awkward-2.7.0/lib/python3.12/site-packages/awkward/_operators.py:54, in _binary_method.<locals>.func(self, other)
E                51 if _disables_array_ufunc(other):
E                52     return NotImplemented
E           ---> 54 return ufunc(self, other)
E           
E           File /nix/store/yq4a8j78af4l3rcc1m7sf5kqqv3ydnkb-python3.12-awkward-2.7.0/lib/python3.12/site-packages/awkward/highlevel.py:1594, in Array.__array_ufunc__(self, ufunc, method, *inputs, **kwargs)
E              1592 name = f"{type(ufunc).__module__}.{ufunc.__name__}.{method!s}"
E              1593 with ak._errors.OperationErrorContext(name, inputs, kwargs):
E           -> 1594     return ak._connect.numpy.array_ufunc(ufunc, method, inputs, kwargs)
E           
E           File /nix/store/yq4a8j78af4l3rcc1m7sf5kqqv3ydnkb-python3.12-awkward-2.7.0/lib/python3.12/site-packages/awkward/_connect/numpy.py:367, in array_ufunc(ufunc, method, inputs, kwargs)
E               364 attrs = attrs_of(*inputs)
E               365 backend = backend_of(*inputs, coerce_to_common=True)
E           --> 367 depth_context, lateral_context = NamedAxesWithDims.prepare_contexts(inputs)
E               369 inputs = _array_ufunc_custom_cast(inputs, behavior, backend)
E               371 def action(inputs, **ignore):
E           
E           File /nix/store/yq4a8j78af4l3rcc1m7sf5kqqv3ydnkb-python3.12-awkward-2.7.0/lib/python3.12/site-packages/awkward/_namedaxis.py:686, in NamedAxesWithDims.prepare_contexts(cls, arrays, unwrap_kwargs)
E               684         layout = ctx.unwrap(array, **_unwrap_kwargs)
E               685     _named_axes.append(_get_named_axis(array))
E           --> 686     _ndims.append(layout.minmax_depth[1])
E               688 depth_context = {NAMED_AXIS_KEY: cls(_named_axes, _ndims)}
E               689 lateral_context = {NAMED_AXIS_KEY: cls(_named_axes, _ndims)}
E           
E           AttributeError: 'VectorObject2D' object has no attribute 'minmax_depth'
E           
E           This error occurred while calling
E           
E               numpy.add.__call__(
E                   <VectorArray2D [[{x: 1, y: 1.1}, {...}], ...] type='4 * var * Vecto...'>
E                   VectorObject2D-instance
E               )

Any additional but relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug (unverified)The problem described would be a bug, but needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions