Skip to content

fix: raise on image views#239

Merged
beckermr merged 14 commits into
mainfrom
no-views
May 12, 2026
Merged

fix: raise on image views#239
beckermr merged 14 commits into
mainfrom
no-views

Conversation

@beckermr

@beckermr beckermr commented May 12, 2026

Copy link
Copy Markdown
Collaborator

JAX does not allow true array views, so we should not allow folks to use the Image.view method. Instead, I have extended the syntax of the Image.copy method to allow things about the image to be changed while making a copy.

TODO:

  • make sure all doc strings are up to date and fully descriptive
  • For tests that use views, but are not testing view, implement a jax-specific test or modify GalSim test suite so they run.
    • tests/GalSim/tests/test_image.py::test_complex_image
    • tests/GalSim/tests/test_image.py::test_undefined_image
    • tests/GalSim/tests/test_image.py::test_Image_basic
    • tests/GalSim/tests/test_hsm.py::test_moments_basic
    • tests/GalSim/tests/test_image.py::test_Image_view

@codspeed-hq

codspeed-hq Bot commented May 12, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 67.7%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 35 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_benchmark_moffat_init[run] 97.2 µs 58 µs +67.7%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing no-views (6b13a69) with main (7b6aecc)

Open in CodSpeed

@beckermr beckermr marked this pull request as ready for review May 12, 2026 22:08
@beckermr beckermr enabled auto-merge (squash) May 12, 2026 22:08
@beckermr beckermr merged commit da949d7 into main May 12, 2026
9 checks passed
@beckermr beckermr deleted the no-views branch May 12, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant