diff --git a/examples/filter_events_example.ipynb b/examples/filter_events_example.ipynb index 2c97985..1b98288 100644 --- a/examples/filter_events_example.ipynb +++ b/examples/filter_events_example.ipynb @@ -1053,7 +1053,7 @@ "source": [ "lhe_data = data_path(\"pylhe-drell-yan-ll-lhe.gz\")\n", "with gzip.open(lhe_data) as f:\n", - " for i in range(1000):\n", + " for _ in range(1000):\n", " print(f.readline())" ] }, diff --git a/examples/write_monte_carlo_example.ipynb b/examples/write_monte_carlo_example.ipynb index 9334559..30a74bf 100644 --- a/examples/write_monte_carlo_example.ipynb +++ b/examples/write_monte_carlo_example.ipynb @@ -62,7 +62,7 @@ "# https://equation-database.readthedocs.io/en/latest/_autosummary/equation_database.isbn_9780471887416.html#equation_database.isbn_9780471887416.equation_6_32\n", "\n", "\n", - "def dsigma(s, theta, phi):\n", + "def dsigma(s, theta, _phi):\n", " return (math.cos(theta) ** 2 + 1) / 4 * alpha**2 / s" ] }, @@ -174,7 +174,7 @@ "num_samples = 100000\n", "integ = 0.0\n", "lheevents = []\n", - "for i in range(num_samples):\n", + "for _i in range(num_samples):\n", " theta = random.uniform(theta_min, theta_max)\n", " phi = random.uniform(phi_min, phi_max)\n", " sig = (\n", diff --git a/src/pylhe/__init__.py b/src/pylhe/__init__.py index 644ea22..d393b9f 100644 --- a/src/pylhe/__init__.py +++ b/src/pylhe/__init__.py @@ -1,7 +1,7 @@ import gzip import io import xml.etree.ElementTree as ET -from typing import Iterable +from typing import Iterable, Optional import graphviz from particle import latex_to_html_name @@ -367,7 +367,9 @@ def fromstring(cls, string): class LHEFile: - def __init__(self, init: LHEInit = None, events: Iterable[LHEEvent] = None): + def __init__( + self, init: LHEInit = None, events: Optional[Iterable[LHEEvent]] = None + ): self.init = init self.events = events