1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
From: Roland Mas <lolando@debian.org>
Date: Wed, 11 Mar 2026 13:35:36 +0100
Subject: Fix SyntaxWarning in Python code
---
mantis_xray/mantis_qt.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/mantis_xray/mantis_qt.py b/mantis_xray/mantis_qt.py
index 8bf41e4..a66b02d 100644
--- a/mantis_xray/mantis_qt.py
+++ b/mantis_xray/mantis_qt.py
@@ -1304,7 +1304,7 @@ class PageTomo(QtWidgets.QWidget):
# sbcolor = 'black'
# startx = int(self.stk.n_cols*0.05)
# starty = self.stk.n_rows-int(self.stk.n_rows*0.05)-self.stk.scale_bar_pixels_y
-# um_string = ' $\mathrm{\mu m}$'
+# um_string = r' $\mathrm{\mu m}$'
# microns = '$'+self.stk.scale_bar_string+' $'+um_string
# axes.text(self.stk.scale_bar_pixels_x+startx+1,starty+1, microns, horizontalalignment='left', verticalalignment='center',
# color = sbcolor, fontsize=14)
@@ -2445,7 +2445,7 @@ class PageNNMA(QtWidgets.QWidget):
bound = np.max((np.abs(min_val), np.abs(max_val)))
if self.show_scale_bar == 1:
- um_string = ' $\mathrm{\mu m}$'
+ um_string = r' $\mathrm{\mu m}$'
microns = '$'+self.stk.scale_bar_string+' $'+um_string
axes.text(self.stk.scale_bar_pixels_x+10,self.stk.n_cols-9, microns, horizontalalignment='left', verticalalignment='center',
color = 'white', fontsize=14)
@@ -2514,7 +2514,7 @@ class PageNNMA(QtWidgets.QWidget):
bound = np.max((np.abs(min_val), np.abs(max_val)))
if self.show_scale_bar == 1:
- um_string = ' $\mathrm{\mu m}$'
+ um_string = r' $\mathrm{\mu m}$'
microns = '$'+self.stk.scale_bar_string+' $'+um_string
axes.text(self.stk.scale_bar_pixels_x+10,self.stk.n_cols-9, microns, horizontalalignment='left', verticalalignment='center',
color = 'white', fontsize=14)
@@ -2576,7 +2576,7 @@ class PageNNMA(QtWidgets.QWidget):
bound = np.max((np.abs(min_val), np.abs(max_val)))
if self.show_scale_bar == 1:
- um_string = ' $\mathrm{\mu m}$'
+ um_string = r' $\mathrm{\mu m}$'
microns = '$'+self.stk.scale_bar_string+' $'+um_string
axes.text(self.stk.scale_bar_pixels_x+10,self.stk.n_cols-9, microns, horizontalalignment='left', verticalalignment='center',
color = 'white', fontsize=14)
@@ -2665,7 +2665,7 @@ class PageNNMA(QtWidgets.QWidget):
bound = np.max((np.abs(min_val), np.abs(max_val)))
if self.show_scale_bar == 1:
- um_string = ' $\mathrm{\mu m}$'
+ um_string = r' $\mathrm{\mu m}$'
microns = '$'+self.stk.scale_bar_string+' $'+um_string
axes.text(self.stk.scale_bar_pixels_x+10,self.stk.n_cols-9, microns, horizontalalignment='left', verticalalignment='center',
color = 'white', fontsize=14)
@@ -4791,7 +4791,7 @@ class PagePeakID(QtWidgets.QWidget):
#Show Scale Bar
startx = int(self.stk.n_rows*0.05)
starty = int(self.stk.n_cols*0.05)+self.stk.scale_bar_pixels_y
- um_string = ' $\mathrm{\mu m}$'
+ um_string = r' $\mathrm{\mu m}$'
microns = '$'+self.stk.scale_bar_string+' $'+um_string
axes.text(self.stk.scale_bar_pixels_x+startx+1,starty+1, microns, horizontalalignment='left', verticalalignment='center',
color = 'black', fontsize=14)
@@ -5481,7 +5481,7 @@ class PageSpectral(QtWidgets.QWidget):
bound = np.max((np.abs(min_val), np.abs(max_val)))
if self.show_scale_bar == 1:
- um_string = ' $\mathrm{\mu m}$'
+ um_string = r' $\mathrm{\mu m}$'
microns = '$'+self.stk.scale_bar_string+' $'+um_string
axes.text(self.stk.scale_bar_pixels_x+10,self.stk.n_cols-9, microns, horizontalalignment='left', verticalalignment='center',
color = 'white', fontsize=14)
@@ -5751,7 +5751,7 @@ class PageSpectral(QtWidgets.QWidget):
bound = np.max((np.abs(min_val), np.abs(max_val)))
if self.show_scale_bar == 1:
- um_string = ' $\mathrm{\mu m}$'
+ um_string = r' $\mathrm{\mu m}$'
microns = '$'+self.stk.scale_bar_string+' $'+um_string
axes.text(self.stk.scale_bar_pixels_x+10,self.stk.n_cols-9, microns, horizontalalignment='left', verticalalignment='center',
color = 'white', fontsize=14)
@@ -9713,7 +9713,7 @@ class PageStack(QtWidgets.QWidget):
# sbcolor = 'black'
# startx = int(self.stk.n_cols*0.05)
# starty = self.stk.n_rows-int(self.stk.n_rows*0.05)-self.stk.scale_bar_pixels_y
- # um_string = ' $\mathrm{\mu m}$'
+ # um_string = r' $\mathrm{\mu m}$'
# microns = '$'+self.stk.scale_bar_string+' $'+um_string
# axes.text(self.stk.scale_bar_pixels_x+startx+1,starty+1, microns, horizontalalignment='left', verticalalignment='center',
# color = sbcolor, fontsize=14)
@@ -13608,7 +13608,7 @@ class SpectralROI(QtWidgets.QDialog):
#Show Scale Bar
startx = int(self.stack.n_rows*0.05)
starty = self.stack.n_cols-int(self.stack.n_cols*0.05)-self.stack.scale_bar_pixels_y
- um_string = ' $\mathrm{\mu m}$'
+ um_string = r' $\mathrm{\mu m}$'
microns = '$'+self.stack.scale_bar_string+' $'+um_string
axes.text(self.stack.scale_bar_pixels_x+startx+1,starty+1, microns, horizontalalignment='left', verticalalignment='center',
color = 'white', fontsize=14)
@@ -15340,7 +15340,7 @@ class StackListFrame(QtWidgets.QDialog):
#auto-read energies when the following syntax applies "<str>_XXX.XeV_XX.tif"
fnlist = filename.split('_')
try:
- ind =[ m for m, j in enumerate(fnlist) if re.search('\deV', j)][0]
+ ind =[ m for m, j in enumerate(fnlist) if re.search(r'\deV', j)][0]
iev = float(fnlist[ind][:-2])
except IndexError:
iev = i
|