Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a warning that MultiPlaneConvergence cannot be reused #492

Open
ntessore opened this issue Jan 28, 2025 · 1 comment
Open

Add a warning that MultiPlaneConvergence cannot be reused #492

ntessore opened this issue Jan 28, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@ntessore
Copy link
Collaborator

Which Section of the Documentation Needs Improving?

https://glass.readthedocs.io/stable/reference/lensing.html#glass.MultiPlaneConvergence

What Can be Improved About This Section

We should add a warning to the documentation which states that MultiPlaneConvergence instances cannot be reused across multiple simulations (because the iterative computation tracks state internally).

How to Improve This Section

We could also add a code example, basically https://glass.readthedocs.io/stable/examples/1-basic/lensing.html with everything unrelated blanked out:

# create an instance for iterative lensing
# WARNING: do not reuse for multiple simulations
convergence = glass.MultiPlaneConvergence(cosmo)

# simulation loop
for i, delta in enumerate(matter):

    # add lensing plane from the window function of this shell
    convergence.add_window(delta, shells[i])

    # get convergence map
    kappa = convergence.kappa
@ntessore ntessore added the documentation Improvements or additions to documentation label Jan 28, 2025
@ntessore
Copy link
Collaborator Author

Also warn that convergence.kappa is changed in place, so if users want to keep the map, they currently need to make a copy. This might resolve itself when we re-implement this for JAX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant