Skip to content

Commit

Permalink
test config disables relocate_pix_border by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammy2211 committed Dec 20, 2023
1 parent 298b862 commit 6fd8e7a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
5 changes: 2 additions & 3 deletions test_autolens/analysis/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test__tracer_for_instance__subhalo_redshift_rescale_used(analysis_imaging_7x
assert tracer.galaxies[1].mass.centre == pytest.approx((-0.19959, -0.39919), 1.0e-4)


def test__use_border__determines_if_border_pixel_relocation_is_used(masked_imaging_7x7):
def test__relocate_pix_border__determines_if_border_pixel_relocation_is_used(masked_imaging_7x7):
pixelization = al.Pixelization(
mesh=al.mesh.Rectangular(shape=(3, 3)),
regularization=al.reg.Constant(coefficient=1.0),
Expand All @@ -99,7 +99,7 @@ def test__use_border__determines_if_border_pixel_relocation_is_used(masked_imagi

analysis = al.AnalysisImaging(
dataset=masked_imaging_7x7,
settings_pixelization=al.SettingsPixelization(use_border=True),
settings_inversion=al.SettingsInversion(relocate_pix_border=True),
)

analysis.dataset.grid_pixelization[4] = np.array([[500.0, 0.0]])
Expand All @@ -119,7 +119,6 @@ def test__use_border__determines_if_border_pixel_relocation_is_used(masked_imagi

analysis = al.AnalysisImaging(
dataset=masked_imaging_7x7,
settings_pixelization=al.SettingsPixelization(use_border=False),
)

analysis.dataset.grid_pixelization[4] = np.array([300.0, 0.0])
Expand Down
1 change: 1 addition & 0 deletions test_autolens/config/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ inversion:
use_positive_only_solver: false # If True, inversion's use a positive-only linear algebra solver by default, which is slower but prevents unphysical negative values in the reconstructed solutuion.
no_regularization_add_to_curvature_diag_value: 1.0e-8 # The default value added to the curvature matrix's diagonal when regularization is not applied to a linear object, which prevents inversion's failing due to the matrix being singular.
positive_only_uses_p_initial: false # If True, the positive-only solver of an inversion's uses an initial guess of the reconstructed data's values as which values should be positive, speeding up the solver.
relocate_pix_border: false # If True, by default a pixelization's border is used to relocate all pixels outside its border to the border.
model:
ignore_prior_limits: true
numba:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def test__perfect_fit__chi_squared_0():
fit = al.FitInterferometer(
dataset=dataset,
tracer=tracer,
settings_pixelization=al.SettingsPixelization(use_border=False),
settings_inversion=al.SettingsInversion(use_w_tilde=False),
)

Expand All @@ -95,7 +94,6 @@ def test__perfect_fit__chi_squared_0():
fit = al.FitInterferometer(
dataset=dataset,
tracer=tracer,
settings_pixelization=al.SettingsPixelization(use_border=False),
settings_inversion=al.SettingsInversion(use_w_tilde=False),
)
assert abs(fit.chi_squared) < 1.0e-4
Expand Down Expand Up @@ -194,7 +192,6 @@ def test__simulate_interferometer_data_and_fit__linear_light_profiles_agree_with
fit = al.FitInterferometer(
dataset=dataset,
tracer=tracer,
settings_pixelization=al.SettingsPixelization(use_border=False),
settings_inversion=al.SettingsInversion(use_w_tilde=False),
)

Expand All @@ -217,7 +214,6 @@ def test__simulate_interferometer_data_and_fit__linear_light_profiles_agree_with
fit_linear = al.FitInterferometer(
dataset=dataset,
tracer=tracer_linear,
settings_pixelization=al.SettingsPixelization(use_border=False),
settings_inversion=al.SettingsInversion(use_w_tilde=False),
)

Expand Down Expand Up @@ -324,7 +320,6 @@ def test__simulate_interferometer_data_and_fit__linear_light_profiles_and_pixeli
fit_linear = al.FitInterferometer(
dataset=dataset,
tracer=tracer_linear,
settings_pixelization=al.SettingsPixelization(use_border=False),
settings_inversion=al.SettingsInversion(use_w_tilde=False),
)

Expand Down
4 changes: 0 additions & 4 deletions test_autolens/lens/test_to_inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ def test__inversion_imaging_from(sub_grid_2d_7x7, masked_imaging_7x7):
data=masked_imaging_7x7.data,
noise_map=masked_imaging_7x7.noise_map,
w_tilde=masked_imaging_7x7.w_tilde,
settings_pixelization=al.SettingsPixelization(use_border=False),
settings_inversion=al.SettingsInversion(use_w_tilde=False),
)

Expand All @@ -471,7 +470,6 @@ def test__inversion_imaging_from(sub_grid_2d_7x7, masked_imaging_7x7):
data=masked_imaging_7x7.data,
noise_map=masked_imaging_7x7.noise_map,
w_tilde=masked_imaging_7x7.w_tilde,
settings_pixelization=al.SettingsPixelization(use_border=False),
settings_inversion=al.SettingsInversion(use_w_tilde=False),
)

Expand All @@ -495,7 +493,6 @@ def test__inversion_interferometer_from(sub_grid_2d_7x7, interferometer_7):
data=interferometer_7.visibilities,
noise_map=interferometer_7.noise_map,
w_tilde=None,
settings_pixelization=al.SettingsPixelization(use_border=False),
settings_inversion=al.SettingsInversion(use_w_tilde=False),
)

Expand All @@ -518,7 +515,6 @@ def test__inversion_interferometer_from(sub_grid_2d_7x7, interferometer_7):
data=interferometer_7.visibilities,
noise_map=interferometer_7.noise_map,
w_tilde=None,
settings_pixelization=al.SettingsPixelization(use_border=False),
settings_inversion=al.SettingsInversion(use_w_tilde=False),
)

Expand Down

0 comments on commit 6fd8e7a

Please sign in to comment.