From 7da94a1f9be5052637bdfc79a1ed4a09f6d33765 Mon Sep 17 00:00:00 2001 From: Takahiro Ueda Date: Tue, 30 Jul 2024 19:44:20 +0900 Subject: [PATCH] fix: resolve syntax warnings * Correct invalid escape sequences in string literals. * Use "!=" instead of "is not" for integer comparison. --- madminer/fisherinformation/geometry.py | 6 +++--- madminer/utils/interfaces/mg.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/madminer/fisherinformation/geometry.py b/madminer/fisherinformation/geometry.py index 0050aace2..d3c9d2a37 100755 --- a/madminer/fisherinformation/geometry.py +++ b/madminer/fisherinformation/geometry.py @@ -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`. @@ -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}) @@ -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) diff --git a/madminer/utils/interfaces/mg.py b/madminer/utils/interfaces/mg.py index 1254a6293..5600bbd1a 100644 --- a/madminer/utils/interfaces/mg.py +++ b/madminer/utils/interfaces/mg.py @@ -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,