Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ENH: Add support for something like lazy_xp_function for classes #488

Copy link
Copy link
@steppi

Description

@steppi
Issue body actions

lazy_xp_function is quite effective for testing functions with backends that support lazy behavior. SciPy uses it within make_xp_pytest_marks which generates the pytest marks for which backends to run tests on.

The PR scipy/scipy#23135 attempts to adapt SciPy's strategy for testing functions against alternative Python Array API standard compatible backends to some classes, including PPoly, and things almost work out of the box, with the exception of testing on lazy backends. This is because on dask lazy_xp_function wraps its input with _dask_wrap, which replaces the class with a function (something similar happens with JAX and jax_autojit) This resulted in the mysterious error here, scipy/scipy#23135 (comment).

For the time being, I think it's fine to just skip testing classes and their methods against lazy backends in SciPy, but longer term, it would be good to think about what should be done here. lazy_xp_class if it existed, could call _dask_wrap individually on methods. There's a question of whether you'd want separate CountingDaskSchedulers per method, or one shared one per class or instance. I don't have strong opinions about how exactly things are done and haven't thought about it closely. I'm mainly making this issue to give somewhere to point to explain why classes in SciPy aren't being tested for lazy behavior, even if everything actually works, and to raise awareness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.