diff --git a/examples/cpp/fill-grid-v1.cpp b/examples/cpp/fill-grid-v1.cpp index 024089d8..32cc1154 100644 --- a/examples/cpp/fill-grid-v1.cpp +++ b/examples/cpp/fill-grid-v1.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////// // Exactly the same as `fill-grid.cpp` but using the generalization features // introduced by v1. This in particular concerns the following functions: -// +// // - pineappl_add_channel // - pineappl_grid_new2 // - pineappl_grid_fill2 @@ -129,7 +129,7 @@ int main() { auto* channels = pineappl_lumi_new(); // Specify the dimension of the channel, ie the number of convolutions required - std::size_t nb_convolutions = 2; + std::size_t nb_convolutions = 2; // photon-photon initial state, where `22` is the photon (PDG MC ids) int32_t pids1[] = { 22, 22 }; diff --git a/examples/fortran/lhapdf_example_v1.f90 b/examples/fortran/lhapdf_example_v1.f90 index 677ab5e3..41133d2e 100644 --- a/examples/fortran/lhapdf_example_v1.f90 +++ b/examples/fortran/lhapdf_example_v1.f90 @@ -53,7 +53,7 @@ program lhapdf_example call lhapdf_initpdfset_byname(1, "nCTEQ15FullNuc_208_82") ! write(*, *) "xfx_test1: ", xfx_test1(0, 0.5_dp, 100.0_dp, c_null_ptr) - + ! calling pineappl_grid_convolve without any flags xfx = pineappl_xfx(xfx_test1) alphas = pineappl_alphas(alphas_test1) @@ -75,7 +75,7 @@ function xfx_test1(pdg_id, x, q2, state) bind(c) use iso_c_binding implicit none - + integer(c_int32_t), value, intent(in) :: pdg_id real(c_double), value, intent(in) :: x, q2 type(c_ptr), value, intent(in) :: state @@ -88,7 +88,7 @@ function xfx_test2(pdg_id, x, q2, state) bind(c) use iso_c_binding implicit none - + integer(c_int32_t), value, intent(in) :: pdg_id real(c_double), value, intent(in) :: x, q2 type(c_ptr), value, intent(in) :: state @@ -105,7 +105,7 @@ function alphas_test1(q2, state) bind(c) use iso_c_binding implicit none - + real(c_double), value, intent(in) :: q2 type(c_ptr), value, intent(in) :: state real(c_double) :: alphas_test1 @@ -117,7 +117,7 @@ function alphas_test2(q2, state) bind(c) use iso_c_binding implicit none - + real(c_double), value, intent(in) :: q2 type(c_ptr), value, intent(in) :: state real(c_double) :: alphas_test2 diff --git a/examples/fortran/test_v1.f90 b/examples/fortran/test_v1.f90 index 85c4544a..ce4a181a 100644 --- a/examples/fortran/test_v1.f90 +++ b/examples/fortran/test_v1.f90 @@ -1,7 +1,7 @@ program test_pineappl use pineappl use iso_c_binding - + implicit none integer, parameter :: dp = kind(0.0d0) @@ -24,7 +24,7 @@ program test_pineappl channels = pineappl_channels_new() call pineappl_channels_add(channels, 3, 2, [0, 0, 1, -1, 2, -2], [1.0_dp, 1.0_dp, 1.0_dp]) - + if (pineappl_lumi_count(channels) /= 1) then write(*, *) "pineappl_lumi_count(): ", pineappl_lumi_count(channels) error stop "error: pineappl_lumi_count" @@ -190,7 +190,7 @@ function xfx1_test(pdg_id, x, q2, state) bind(c) use iso_c_binding implicit none - + integer(c_int32_t), value, intent(in) :: pdg_id real(c_double), value, intent(in) :: x, q2 type(c_ptr), value, intent(in) :: state @@ -203,7 +203,7 @@ function xfx2_test(pdg_id, x, q2, state) bind(c) use iso_c_binding implicit none - + integer(c_int32_t), value, intent(in) :: pdg_id real(c_double), value, intent(in) :: x, q2 type(c_ptr), value, intent(in) :: state @@ -216,7 +216,7 @@ function alphas_test(q2, state) bind(c) use iso_c_binding implicit none - + real(c_double), value, intent(in) :: q2 type(c_ptr), value, intent(in) :: state real(c_double) :: alphas_test diff --git a/pineappl_py/tests/conftest.py b/pineappl_py/tests/conftest.py index f8337772..1d861840 100644 --- a/pineappl_py/tests/conftest.py +++ b/pineappl_py/tests/conftest.py @@ -109,9 +109,7 @@ def grid_with_generic_convolution( # Construct the `Scales` object fragmentation_scale = ( - ScaleFuncForm.Scale(0) - if nb_convolutions >= 3 - else ScaleFuncForm.NoScale(0) + ScaleFuncForm.Scale(0) if nb_convolutions >= 3 else ScaleFuncForm.NoScale(0) ) scale_funcs = Scales( ren=ScaleFuncForm.Scale(0), diff --git a/pineappl_py/tests/test_bin.py b/pineappl_py/tests/test_bin.py index b821b970..1bf06a8e 100644 --- a/pineappl_py/tests/test_bin.py +++ b/pineappl_py/tests/test_bin.py @@ -37,9 +37,7 @@ def test_binremapper(self, fake_grids): bin_dims = g.bin_dimensions() bin_limits = [ (left, right) - for left, right in zip( - g.bin_left(bin_dims - 1), g.bin_right(bin_dims - 1) - ) + for left, right in zip(g.bin_left(bin_dims - 1), g.bin_right(bin_dims - 1)) ] normalizations = [10.0 for _ in g.bin_normalizations()] diff --git a/pineappl_py/tests/test_grid.py b/pineappl_py/tests/test_grid.py index 0a1ad2ce..6cb0203c 100644 --- a/pineappl_py/tests/test_grid.py +++ b/pineappl_py/tests/test_grid.py @@ -253,9 +253,7 @@ def test_incosistent_convolutions( xfxs=[pdf.polarized_pdf], # Requires ONE single PDF alphas=pdf.alphasQ, ) - assert "called `Option::unwrap()` on a `None` value" == str( - err_func.value - ) + assert "called `Option::unwrap()` on a `None` value" == str(err_func.value) @pytest.mark.parametrize("params,expected", TESTING_SPECS) def test_toy_convolution(self, fake_grids, params, expected): @@ -440,9 +438,7 @@ def test_many_convolutions(self, fake_grids, pdf, nb_convolutions: int = 3): _q2grid = np.geomspace(1e3, 1e5, 5) _xgrid = np.geomspace(1e-5, 1, 4) comb_nodes = [_q2grid] + [_xgrid for _ in range(nb_convolutions)] - ntuples = [ - np.array(list(kins)) for kins in itertools.product(*comb_nodes) - ] + ntuples = [np.array(list(kins)) for kins in itertools.product(*comb_nodes)] obs = [rndgen.uniform(binning[0], binning[-1]) for _ in ntuples] for pto in range(len(ORDERS)): for channel_id in range(len(channels)): diff --git a/pineappl_py/tests/test_subgrid.py b/pineappl_py/tests/test_subgrid.py index 1548cfa7..573faaa5 100644 --- a/pineappl_py/tests/test_subgrid.py +++ b/pineappl_py/tests/test_subgrid.py @@ -73,7 +73,9 @@ def fake_grid(self, fake_grids) -> Grid: convolutions=[CONVOBJECT], ) - def fake_importonlysubgrid(self, nb_xdim: int = 1) -> Tuple[ImportSubgridV1, OperatorInfo]: + def fake_importonlysubgrid( + self, nb_xdim: int = 1 + ) -> Tuple[ImportSubgridV1, OperatorInfo]: x_grids = [np.linspace(0.1, 1, 2) for _ in range(nb_xdim)] xgrid_size = [x.size for x in x_grids] Q2s = np.linspace(10, 20, 2)