Skip to content

Conversation

@paddyroddy
Copy link
Member

@paddyroddy paddyroddy commented Jan 12, 2026

Description

As part of the work towards #413, I'm working on #947. As part of the work I was porting the individual functions to the Array API, but it makes sense to do this in one step first.

Closes: #958, #907

Changelog entry

Changed: Make positions_from_delta Array API compatible

Checks

  • Is your code passing linting?
  • Is your code passing tests?
  • Have you added additional tests (if required)?
  • Have you modified/extended the documentation (if required)?
  • Have you added a one-liner changelog entry above (if required)?

@paddyroddy paddyroddy self-assigned this Jan 12, 2026
@paddyroddy paddyroddy added the array-api Work is related to the Array API label Jan 12, 2026
np.testing.assert_array_less(actual, desired)

@staticmethod
def assert_equal(actual: AnyArray, desired: AnyArray) -> None:
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing this as I tried to use it when I meant to use assert_array_equal


pos = benchmark(function_to_benchmark)

lon, lat, cnt = data_transformer.catpos(pos, xp=np)
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed this as it looks rude

nside,
ipix,
lonlat=True,
rng=_utils.rng_dispatcher(xp=np),
Copy link
Member Author

Choose a reason for hiding this comment

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

randang internally uses numpy which means we have read-only issues. This change means we can get around it (but still rely on NumPy). We could move this to it's own module for healpix-changes

Copy link
Member Author

Choose a reason for hiding this comment

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

Alternatively, @ntessore could randang be changed to accept random seeds?

@paddyroddy paddyroddy requested a review from connoraird January 12, 2026 13:03
@paddyroddy paddyroddy requested a review from connoraird January 12, 2026 17:54
@paddyroddy paddyroddy linked an issue Jan 14, 2026 that may be closed by this pull request
2 tasks
@paddyroddy paddyroddy merged commit bee3e55 into main Jan 14, 2026
23 checks passed
@paddyroddy paddyroddy deleted the paddy/issue-958 branch January 14, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

array-api Work is related to the Array API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make positions_from_delta Array API compatible Port functions in points.py which contain mutations

3 participants