Skip to content

SymmetricTensor.copy() TypeError: 'NoneType' object is not iterable #35

@wiwu2390

Description

@wiwu2390

SymmetricTensor.copy() crashes with TypeError: 'NoneType' object is not iterable when called on a view whose shape no longer matches the declared symmetric axes:

  whest/src/whest/_symmetric.py:785
  out._symmetric_axes = list(self._symmetric_axes)  # self._symmetric_axes is None

Reproducer:

A = we.symmetrize(we.random.randn(10, 10), group=we.PermutationGroup.symmetric(2,axes=(0,1)))
we.diagonal(A).copy()

we.diagonal returns a 1D view; __array_finalize__ correctly invalidates _symmetric_axes to None for the new shape; but .copy() then tries to list(None).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:p1Ship in the current iteration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions