Skip to content

Conversation

crusaderky
Copy link
Contributor

@crusaderky crusaderky commented Feb 20, 2025

Various generic improvements backported from #141 and #86

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran pixi update. Notably this bumps dask to 2025.2.0.

report.exclude_also = [
'\.\.\.',
'if TYPE_CHECKING:',
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caused large sections of code to be incorrectly skipped

"""
if xp is None:
xp = _compat.array_namespace(x1, x2)
xp = array_namespace(x1, x2)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this causes coverage to fail, as this line isn't covered by unit tests

# To be changed to a Protocol later (see data-apis/array-api#589)
Array = Any # type: ignore[no-any-explicit]
Device = Any # type: ignore[no-any-explicit]
DType = Any # type: ignore[no-any-explicit]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used by both #86 and #141

Comment on lines +134 to +142
@pytest.fixture(params=[Backend.DASK]) # Can select the test with `pytest -k dask`
def da(
request: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatch
) -> ModuleType: # numpydoc ignore=PR01,RT01
"""Variant of the `xp` fixture that only yields dask.array."""
xp = pytest.importorskip("dask.array")
xp = array_namespace(xp.empty(0))
patch_lazy_xp_functions(request, monkeypatch, xp=xp)
return xp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used by both #86 and #141

Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@lucascolley lucascolley added this to the 0.6.1 milestone Feb 20, 2025
@lucascolley lucascolley added the maintenance general maintenance label Feb 20, 2025
@lucascolley lucascolley merged commit 6e4aba6 into data-apis:main Feb 20, 2025
8 of 10 checks passed
@crusaderky crusaderky deleted the backports branch February 20, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance general maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants