Skip to content

Conversation

@connoraird
Copy link
Contributor

@connoraird connoraird commented Dec 18, 2025

Description

Ports functions in galaxies.py which mutate arrays to now use xpx.at... so they support jax.

Closes: #903

Changelog entry

Added: jax support for glass.galaxies.redshifts_from_nz and glass.galaxies.galaxy_shear .

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)?

@connoraird connoraird self-assigned this Dec 18, 2025
@connoraird connoraird added array-api Work is related to the Array API jax-porting Removing mutation to make the code JAX compatible labels Dec 18, 2025
@connoraird
Copy link
Contributor Author

  1. Coveralls reduction I assume is because of the removal of array-api-strict
  2. I believe this could be a genuine regression in performance

@connoraird connoraird requested review from ntessore and paddyroddy and removed request for ntessore December 23, 2025 09:41
@connoraird connoraird added the needs-2-reviewers Could be considered "controversial" so worth a second pair of eyes label Dec 23, 2025
@paddyroddy paddyroddy requested a review from ntessore December 23, 2025 11:04
Copy link
Member

@paddyroddy paddyroddy left a comment

Choose a reason for hiding this comment

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

Looks good. How do we know it's a genuine reduction this time?

@connoraird
Copy link
Contributor Author

connoraird commented Dec 23, 2025

Looks good. How do we know it's a genuine reduction this time?

I'm assuming it is, as the only tests which seem to regularly show up as regressed is test_galaxy_shear which is exactly what I've updated.

@paddyroddy
Copy link
Member

That would make sense. Thankfully not a huge regression.

Performance has regressed:
	test_galaxy_shear[numpy-True] (0001_f906eb0) - Field 'mean' has failed PercentageRegressionCheck: 9.996939723 > 5.000000000
	test_galaxy_shear[numpy-False] (0001_f906eb0) - Field 'mean' has failed PercentageRegressionCheck: 8.899524405 > 5.000000000

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 jax-porting Removing mutation to make the code JAX compatible needs-2-reviewers Could be considered "controversial" so worth a second pair of eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port functions in galaxies.py which contain mutations

3 participants