Merged
Conversation
- Remove ag.OperateDeflections from Tracer inheritance (tracer.py) - Update abstract.py: magnifications_at_positions uses OperateDeflections.from_tracer (removes deflections_func property; multi-plane selection is done inside from_tracer) - Update shape_solver.py and point_solver.py: type annotations use Tracer; _filter_low_magnification uses OperateDeflections.from_mass_obj(tracer) - Clean up NullTracer in mock.py (remove dead magnification_2d_via_hessian_from override) - Fix MockTracerPoint.deflections_yx_2d_from signature (grid, xp=np) and remove dead magnification_2d_via_hessian_from override (mock_tracer.py) - Update tests to new composition API; assertion numerical values left for manual update Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update import in autolens/__init__.py - tracer_util.py uses ag.LensCalc.from_mass_obj for fermat_potential_from - Update point/fit/abstract.py and point/solver/shape_solver.py - Update tests and docs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors how lensing calculations are performed in the codebase, consolidating operations previously handled by
OperateDeflectionsinto a new class,LensCalc. The changes update class inheritance, function signatures, and usages throughout the codebase and tests to useLensCalcfor lensing calculations such as magnification and deflections. Additionally, the pull request simplifies and clarifies the handling of multi-plane lensing and updates test fixtures and expectations accordingly.Refactoring and API changes:
OperateDeflectionswithLensCalcacross the codebase, including imports, class inheritance, and function signatures [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12].LensCalcmethods, including intracer_util.py, point fitting, and solver logic [1] [2] [3] [4].Multi-plane lensing and magnification:
LensCalc.from_tracerwith explicituse_multi_planeandplane_jarguments, removing the confusingdeflections_funcproperty and related logic [1] [2] [3] [4].Test and fixture updates:
LensCalc-based API, including changes to expected results due to the refactor and improvements in calculation accuracy [1] [2] [3] [4] [5].Cleanup and documentation:
LensCalcclass [1] [2] [3].These changes modernize and clarify the codebase's approach to lensing calculations, making the API more explicit and maintainable.