Skip to content

pti over all levels #498

@ax3l

Description

@ax3l

After #497, we could implement a

for pti in pc.iterator(level="all"):
    # ...

Since we cannot yield MFIter without a nested iterator warning in AMReX, we could implement a lightweight iterator wrapper that iterates level by level the per-level iterator for us.

We can forward all properties and methods of the underlying Iterator type like this:

def __getattr__(self, name):
    # For attributes not explicitly defined here, return the
    # attribute of the underlying Iterator
    return getattr(self.pc.Iterator, name)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions