From 6d177868559cf33531f38849f8eb9afded3cc4b8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:49:54 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.8.0 → 24.10.0](https://github.com/psf/black/compare/24.8.0...24.10.0) - [github.com/psf/black: 24.8.0 → 24.10.0](https://github.com/psf/black/compare/24.8.0...24.10.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 121ee6a..1adce72 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ ci: repos: - repo: https://github.com/psf/black - rev: 24.8.0 + rev: 24.10.0 hooks: - id: black # It is recommended to specify the latest version of Python @@ -19,7 +19,7 @@ repos: # https://pre-commit.com/#top_level-default_language_version language_version: python3 - repo: https://github.com/psf/black - rev: 24.8.0 + rev: 24.10.0 hooks: - id: black-jupyter language_version: python3 From 2fab0d08e833048922a76cb39f5091ba1d05ba17 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:50:05 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- hierarc/Diagnostics/goodness_of_fit.py | 5 +++-- hierarc/Likelihood/LensLikelihood/double_source_plane.py | 3 +-- hierarc/Likelihood/cosmo_likelihood.py | 3 +-- hierarc/Likelihood/hierarchy_likelihood.py | 3 +-- hierarc/Likelihood/kin_scaling.py | 5 ++++- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hierarc/Diagnostics/goodness_of_fit.py b/hierarc/Diagnostics/goodness_of_fit.py index 6be1af9..e4c8199 100644 --- a/hierarc/Diagnostics/goodness_of_fit.py +++ b/hierarc/Diagnostics/goodness_of_fit.py @@ -24,8 +24,9 @@ def __init__(self, kwargs_likelihood_list, kwargs_model): def reduced_chi2(self, cosmo, kwargs_lens, kwargs_kin): """Reduced chi^2 of fit.""" - logL = self._sample_likelihood.log_likelihood(cosmo=cosmo, kwargs_lens=kwargs_lens, kwargs_kin=kwargs_kin, - verbose=False) + logL = self._sample_likelihood.log_likelihood( + cosmo=cosmo, kwargs_lens=kwargs_lens, kwargs_kin=kwargs_kin, verbose=False + ) num_data = self._sample_likelihood.num_data() return -logL * 2 / num_data diff --git a/hierarc/Likelihood/LensLikelihood/double_source_plane.py b/hierarc/Likelihood/LensLikelihood/double_source_plane.py index de991e6..44737e1 100644 --- a/hierarc/Likelihood/LensLikelihood/double_source_plane.py +++ b/hierarc/Likelihood/LensLikelihood/double_source_plane.py @@ -51,8 +51,7 @@ def num_data(self): def beta_double_source_plane(z_lens, z_source_1, z_source_2, cosmo): - """Model prediction of ratio of scaled - deflection angles. + """Model prediction of ratio of scaled deflection angles. :param z_lens: lens redshift :param z_source_1: source_1 redshift diff --git a/hierarc/Likelihood/cosmo_likelihood.py b/hierarc/Likelihood/cosmo_likelihood.py index 42d2e26..c0f921b 100644 --- a/hierarc/Likelihood/cosmo_likelihood.py +++ b/hierarc/Likelihood/cosmo_likelihood.py @@ -217,8 +217,7 @@ def cosmo_instance(self, kwargs_cosmo): return cosmo def info(self): - """ - prints information about the likelihood object + """Prints information about the likelihood object. :return: print statements """ diff --git a/hierarc/Likelihood/hierarchy_likelihood.py b/hierarc/Likelihood/hierarchy_likelihood.py index a0c5c5c..6572617 100644 --- a/hierarc/Likelihood/hierarchy_likelihood.py +++ b/hierarc/Likelihood/hierarchy_likelihood.py @@ -169,8 +169,7 @@ def __init__( self._prior = PriorLikelihood(prior_list=prior_list) def info(self): - """ - information about the lens + """Information about the lens. :return: print statement """ diff --git a/hierarc/Likelihood/kin_scaling.py b/hierarc/Likelihood/kin_scaling.py index c8bfd1c..1b4d9ba 100644 --- a/hierarc/Likelihood/kin_scaling.py +++ b/hierarc/Likelihood/kin_scaling.py @@ -84,7 +84,10 @@ def __init__(self, param_grid_axes, j_kin_scaling_grid): if self._dim_scaling == 1: self._f_ani = interp1d( - param_grid_axes[0], j_kin_scaling_grid, kind="linear", fill_value="extrapolate" + param_grid_axes[0], + j_kin_scaling_grid, + kind="linear", + fill_value="extrapolate", ) elif self._dim_scaling == 2: self._f_ani = interp2d(