Skip to content

Commit

Permalink
fix: resolve syntax warnings
Browse files Browse the repository at this point in the history
* Correct invalid escape sequences in string literals.
* Use "!=" instead of "is not" for integer comparison.
  • Loading branch information
tueda committed Jul 30, 2024
1 parent 3e2615d commit 7da94a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions madminer/fisherinformation/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _information_inv(self, theta):
return np.linalg.inv(self._information(theta))

def _information_derivative(self, theta):
"""
r"""
Low level function that calculates the derivative of Fisher Information
`\partial_k I_{ij}` at the theory parameter `theta`.
Expand All @@ -184,7 +184,7 @@ def _information_derivative(self, theta):
)

def _christoffel(self, theta):
"""
r"""
Low level function that calculates the Christoffel symbol (2nd kind) Gamma^i_jk at
the theory parameter `theta`. Here Gamma^i_jk=0.5*I^{im}(\partial_k I_{mj}
+ \partial_j I_{mk} - \partial_m I_{jk})
Expand Down Expand Up @@ -346,7 +346,7 @@ def distance_contours(
stepsize = min([(limit[1] - limit[0]) / 20.0 for limit in grid_ranges])
if ntrajectories is None:
ntrajectories = 20 * self.dimension
if self.dimension is not 2:
if self.dimension != 2:
continous_sampling = False

limits = (1.0 + 2.0 * stepsize) * np.array(grid_ranges)
Expand Down
2 changes: 1 addition & 1 deletion madminer/utils/interfaces/mg.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def setup_mg_with_scripts(
)

# Replace environment variable in proc card
replacement_command = """sed -e 's@\$mgprocdir@'"$mgprocdir"'@' {}/{} > {}/{}""".format(
replacement_command = r"""sed -e 's@\$mgprocdir@'"$mgprocdir"'@' {}/{} > {}/{}""".format(
mg_process_directory_placeholder,
proc_card_filename_from_mgprocdir,
mg_process_directory_placeholder,
Expand Down

0 comments on commit 7da94a1

Please sign in to comment.