Skip to content

[BUG] "ValueError: Cell is empty" during closure variable lookup #913

@c0d1f1ed

Description

@c0d1f1ed

Bug Description

After 195f774 there are ValueError: Cell is empty errors when running the Newton test suite.

It happens while trying to resolve _Specialised.TILE_N_RESIDUALS. _Specialised is found in adj.func.__code__.co_freevars, but the corresponding adj.func.__closure__[idx].cell_contents has value empty. This produces a ValueError when trying to access it. Thus reverting to the previous exception handling would prevent the test failures.

Note that __closure__ is undocumented. We should instead consider using inspect.getclosurevars.

System Information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions