Skip to content

Commit

Permalink
chore: ruff adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
APN-Pucky committed Oct 8, 2024
1 parent 22852c5 commit fde178f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/filter_events_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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())"
]
},
Expand Down
4 changes: 2 additions & 2 deletions examples/write_monte_carlo_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions src/pylhe/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit fde178f

Please sign in to comment.