We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a36799d commit 0791e42Copy full SHA for 0791e42
.pre-commit-config.yaml
@@ -18,7 +18,8 @@ repos:
18
args: [--fix]
19
exclude: ^pineappl_cli/src/plot.py
20
- id: ruff-format
21
- args: [--line-length=80]
+ args: []
22
+ # TODO: remove this exclusion once we've merged this into master
23
24
- repo: local
25
hooks:
examples/python/positivity.py
@@ -38,9 +38,7 @@ def main(filename, Q2):
38
)
39
grid.set_subgrid(0, bin_, 0, subgrid.into())
40
# set the correct observables
41
- normalizations = np.array(
42
- [1.0] * bins
43
- ) # `normalizations` has to be `np.ndarray`
+ normalizations = np.array([1.0] * bins) # `normalizations` has to be `np.ndarray`
44
remapper = pineappl.bin.BinRemapper(normalizations, limits)
45
grid.set_remapper(remapper)
46
pineappl_cli/src/subgrid-pull-plot.py
@@ -19,9 +19,7 @@
xi = np.linspace(sym_min, sym_max, (nrap // 2) * 2 + 1)
yi = np.logspace(log10(np.min(y)), log10(np.max(y)), nmass)
-zi = griddata(
- (x, y), z, (xi[None, :], yi[:, None]), method="linear", rescale=True
-)
+zi = griddata((x, y), z, (xi[None, :], yi[:, None]), method="linear", rescale=True)
26
# print(xi.shape)
27
# print(yi.shape)
@@ -54,9 +52,7 @@
54
52
(x1, x2), z, (x1i[None, :], x2i[:, None]), method="linear", rescale=True
55
53
56
57
-mesh = axes[1].pcolormesh(
58
- x1i, x2i, z12i, shading="nearest", linewidth=0, snap=True
59
+mesh = axes[1].pcolormesh(x1i, x2i, z12i, shading="nearest", linewidth=0, snap=True)
60
axes[1].set_xscale("log")
61
axes[1].set_yscale("log")
62
axes[1].scatter(x1, x2, marker="*", s=5)
pineappl_cli/tests/plot.rs
@@ -443,9 +443,7 @@ sym_max = max(fabs(np.min(x)), fabs(np.max(x)))
443
444
445
446
447
448
449
450
451
@@ -478,9 +476,7 @@ z12i = griddata(
478
476
479
477
480
481
482
483
484
485
486
pineappl_py/docs/source/advanced.ipynb
@@ -414,9 +414,7 @@
414
"edges = np.arange(0.0, 2.4, 0.1)\n",
415
"\n",
416
"ax.step(edges, nbins, where=\"post\", color=\"C1\")\n",
417
- "plt.fill_between(\n",
418
- " np.arange(0.0, 2.4, 0.1), nbins, step=\"post\", color=\"C1\", alpha=0.2\n",
419
- ")\n",
+ "plt.fill_between(np.arange(0.0, 2.4, 0.1), nbins, step=\"post\", color=\"C1\", alpha=0.2)\n",
420
"ax.set_xlabel(\"$|y_{\\ell\\ell}|$\")\n",
421
"ax.set_ylabel(\"$\\mathrm{d} \\sigma / \\mathrm{d} |y_{\\ell\\ell}|$ [pb]\")\n",
422
"ax.grid(True, alpha=0.5)\n",
pineappl_py/docs/source/introduction.ipynb
@@ -258,9 +258,7 @@
258
")\n",
259
260
"# Normalization for each bin. See Section below for more details.\n",
261
- "bin_norm = np.array(\n",
262
- " [0.125 for _ in range(predictions.size - 2)] + [0.250, 0.250]\n",
263
+ "bin_norm = np.array([0.125 for _ in range(predictions.size - 2)] + [0.250, 0.250])\n",
264
265
"fig, ax = plt.subplots(figsize=(5.6, 3.9))\n",
266
"# Factor of `1e3` takes into account the unit conversion into `fb`\n",
@@ -633,9 +631,7 @@
633
631
"# Extract the left & right bin limits\n",
634
632
"bin_limits = [\n",
635
" (left, right)\n",
636
- " for left, right in zip(\n",
637
- " grid.bin_left(bin_dims - 1), grid.bin_right(bin_dims - 1)\n",
638
- " )\n",
+ " for left, right in zip(grid.bin_left(bin_dims - 1), grid.bin_right(bin_dims - 1))\n",
639
"]\n",
640
641
"# Multiply the normalization by a factor of `2`\n",
@@ -705,9 +701,7 @@
705
701
],
706
702
"source": [
707
703
"# Load our modified grids\n",
708
- "grid_nrm = pineappl.grid.Grid.read(\n",
709
- " \"./LHCB_DY_8TEV_custom_normalizations.pineappl.lz4\"\n",
710
704
+ "grid_nrm = pineappl.grid.Grid.read(\"./LHCB_DY_8TEV_custom_normalizations.pineappl.lz4\")\n",
711
"df_nbins = pl.DataFrame({\"bin normalization\": grid_nrm.bin_normalizations()})\n",
712
"df_nbins.with_row_index()"
713
]
pineappl_py/tests/test_fk_table.py
@@ -7,9 +7,7 @@ class TestFkTable:
7
def fake_grid(self, bins=None):
8
channels = [pineappl.boc.Channel([(1, 21, 1.0)])]
9
orders = [pineappl.grid.Order(0, 0, 0, 0)]
10
- bin_limits = np.array(
11
- [1e-7, 1e-3, 1] if bins is None else bins, dtype=float
12
- )
+ bin_limits = np.array([1e-7, 1e-3, 1] if bins is None else bins, dtype=float)
13
subgrid_params = pineappl.subgrid.SubgridParams()
14
g = pineappl.grid.Grid(channels, orders, bin_limits, subgrid_params)
15
return g
pineappl_py/tests/test_grid.py
@@ -17,9 +17,7 @@ class TestGrid:
17
channels = [pineappl.boc.Channel([(1, 21, 0.1)])]
orders = [pineappl.grid.Order(3, 0, 0, 0)]
0 commit comments