File: 0029-Fix-Python-syntax-warnings.patch

package info (click to toggle)
cctbx 2025.2%2Bds2%2B~3.23.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 137,020 kB
  • sloc: python: 896,704; cpp: 299,496; ansic: 22,625; fortran: 18,268; javascript: 2,046; sh: 1,114; sql: 632; csh: 519; java: 368; makefile: 317; xml: 25
file content (82 lines) | stat: -rw-r--r-- 3,571 bytes parent folder | download
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
From: Roland Mas <lolando@debian.org>
Date: Fri, 24 Oct 2025 18:17:18 +0200
Subject: Fix Python syntax warnings

---
 iotbx/pdb/utils.py                                     |  4 ++--
 xfel/merging/application/errors/error_modifier_mm24.py | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/iotbx/pdb/utils.py b/iotbx/pdb/utils.py
index ec2455a..302469b 100644
--- a/iotbx/pdb/utils.py
+++ b/iotbx/pdb/utils.py
@@ -5,7 +5,7 @@ from six.moves import range
 import sys
 
 class generate_n_char_string:
-  """ Iterator to generate strings of length n_chars, using upper-case,
+  r""" Iterator to generate strings of length n_chars, using upper-case,
     lower-case and numbers as desired.
     Allows specialty sets of characters as well
 
@@ -43,7 +43,7 @@ class generate_n_char_string:
     all_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
     all_chars_lc = all_chars.lower()
     all_numbers = '0123456789'
-    special_characters = """[]_,.;:"&<>()\/\{}'`~!@#$%*|+-"""
+    special_characters = r"""[]_,.;:"&<>()\/\{}'`~!@#$%*|+-"""
     self._tilde = """~"""
 
     self._all_everything = ""
diff --git a/xfel/merging/application/errors/error_modifier_mm24.py b/xfel/merging/application/errors/error_modifier_mm24.py
index f2ffa2b..16a8b05 100644
--- a/xfel/merging/application/errors/error_modifier_mm24.py
+++ b/xfel/merging/application/errors/error_modifier_mm24.py
@@ -721,7 +721,7 @@ class error_modifier_mm24(worker):
       fig, axes = plt.subplots(1, 3, figsize=(8, 3))
       axes[0].bar(
         pairwise_differences_centers, pairwise_differences_hist,
-        width=pairwise_differences_db, label='$\omega_{hkl}$'
+        width=pairwise_differences_db, label=r'$\omega_{hkl}$'
         )
       axes[0].plot(
         pairwise_differences_centers,
@@ -736,8 +736,8 @@ class error_modifier_mm24(worker):
           )
 
       axes[0].legend(frameon=False, fontsize=8, handlelength=1)
-      axes[0].set_ylabel('Distribution of $\omega_{hbk}$')
-      axes[0].set_xlabel('Normalized PD ($\omega_{hbk}$)')
+      axes[0].set_ylabel(r'Distribution of $\omega_{hbk}$')
+      axes[0].set_xlabel(r'Normalized PD ($\omega_{hbk}$)')
       axes[0].set_xlim([0, 4.5])
       axes[0].set_xticks([0, 1, 2, 3, 4])
 
@@ -756,7 +756,7 @@ class error_modifier_mm24(worker):
 
       axes[1].set_ylim([0, lim])
       axes[1].set_ylabel('Rankits')
-      axes[1].set_xlabel('Sorted Normalized PD ($\omega_{hbk}$)')
+      axes[1].set_xlabel(r'Sorted Normalized PD ($\omega_{hbk}$)')
       axes[1].set_box_aspect(1)
       axes[1].set_xticks([0, 1, 2, 3, 4])
       axes[1].set_yticks([0, 1, 2, 3, 4])
@@ -775,7 +775,7 @@ class error_modifier_mm24(worker):
       axes[2].plot([x[0], x[-1]], np.sqrt(1 - 2/np.pi) * np.ones(2), color=[0, 0, 0])
       axes[2].plot(x, binned_scale, label='STD')
 
-      axes[2].set_ylabel('Standard Deviation of $I_{hbk}/\sigma_{hbk}$')
+      axes[2].set_ylabel(r'Standard Deviation of $I_{hbk}/\sigma_{hbk}$')
       axes[2].set_xlabel('Mean Intensity X 100,000')
       fig.tight_layout()
       fig.savefig(os.path.join(
@@ -804,7 +804,7 @@ class error_modifier_mm24(worker):
       axes_sadd.plot(centers, self.sfac**2 * sadd2, color=line_color)
       axes_hist.set_xlabel('Correlation Coefficient')
       axes_hist.set_ylabel('Lattices (x1,000)')
-      axes_sadd.set_ylabel('$s_{\mathrm{fac}}^2 \\times s_{\mathrm{add}}^2$')
+      axes_sadd.set_ylabel(r'$s_{\mathrm{fac}}^2 \\times s_{\mathrm{add}}^2$')
       fig.tight_layout()
       fig.savefig(os.path.join(
         self.params.output.output_dir,