Skip to content

Commit d867d29

Browse files
committed
Fix invalid escape sequences (W605) Part 2
Semi-automated with: ruff check --fix --select W605 scripts
1 parent c8d8bb5 commit d867d29

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

scripts/forster_distance_calculator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
r'''
22
Described at PyMOL wiki:
33
http://www.pymolwiki.org/index.php/forster_distance_calculator
44
@@ -77,7 +77,7 @@ def forster(D_Exi="ATTO488Exi.txt", D_Emi="ATTO488Emi.txt", A_Exi="ATTO590Exi.tx
7777
print("The .plt should be opened with gnuplot to make the graphs.")
7878
print("The created graphs are .eps files.")
7979
print("They can be converted to pdf with the program: epstopdf or eps2pdf")
80-
print('Part of LaTeX: C:\Program Files (x86)\MiKTeX 2.9\miktex' + "\\" + "bin")
80+
print(r'Part of LaTeX: C:\Program Files (x86)\MiKTeX 2.9\miktex' + "\\" + "bin")
8181
print("Or download here: http://tinyurl.com/eps2pdf")
8282

8383
DonorEmi = open(D_Emi, "r")

scripts/propka.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
r'''
22
Described at PyMOL wiki:
33
http://www.pymolwiki.org/index.php/propka
44
@@ -222,7 +222,7 @@ def getpropka(PDB="NIL", chain="*", resi="0", resn="NIL", source="upload", PDBID
222222
assert version in ['v2.0', 'v3.0', 'v3.1'], "'version' has to be either: 'v2.0', 'v3.0', 'v3.1'"
223223
assert source in ['ID', 'upload', 'addr', 'input_file'], "'source' has to be either: 'ID', 'upload', 'addr', 'input_file'"
224224
if source == "upload":
225-
assert PDB not in ['NIL'], "You always have to provide PDB path. Example: PDB=.\Results_propka\4ins2011.pdb"
225+
assert PDB not in ['NIL'], r"You always have to provide PDB path. Example: PDB=.\Results_propka\4ins2011.pdb"
226226
if source == "ID":
227227
assert len(PDBID) == 4, "PDBID has to be 4 characters"
228228
# To print out to screen for selected residues. Can be separated with "." or make ranges with "-". Example: resi="4-8.10"
@@ -517,7 +517,7 @@ def importpropkabonds(result_pka_pkafile):
517517

518518
def createdirs():
519519
if platform.system() == 'Windows':
520-
Newdir = os.getcwd() + "\Results_propka\\"
520+
Newdir = os.getcwd() + "\\Results_propka\\"
521521
if platform.system() == 'Linux':
522522
Newdir = os.getcwd() + "/Results_propka/"
523523
if not os.path.exists(Newdir):

scripts/transformations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3131
# POSSIBILITY OF SUCH DAMAGE.
3232

33-
"""Homogeneous Transformation Matrices and Quaternions.
33+
r"""Homogeneous Transformation Matrices and Quaternions.
3434
3535
A library for calculating 4x4 matrices for translating, rotating, reflecting,
3636
scaling, shearing, projecting, orthogonalizing, and superimposing arrays of
@@ -883,7 +883,7 @@ def orthogonalization_matrix(lengths, angles):
883883

884884

885885
def affine_matrix_from_points(v0, v1, shear=True, scale=True, usesvd=True):
886-
"""Return affine transform matrix to register two point sets.
886+
r"""Return affine transform matrix to register two point sets.
887887
888888
v0 and v1 are shape (ndims, \*) arrays of at least ndims non-homogeneous
889889
coordinates, where ndims is the dimensionality of the coordinate space.
@@ -992,7 +992,7 @@ def affine_matrix_from_points(v0, v1, shear=True, scale=True, usesvd=True):
992992

993993

994994
def superimposition_matrix(v0, v1, scale=False, usesvd=True):
995-
"""Return matrix to transform given 3D point set into second point set.
995+
r"""Return matrix to transform given 3D point set into second point set.
996996
997997
v0 and v1 are shape (3, \*) or (4, \*) arrays of at least 3 points.
998998

scripts/wfmesh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def readOBJ(self, file):
4242
if os.path.exists(file):
4343
input = open(file, 'r')
4444
for line in input:
45-
dat = re.split("\s+", line)
45+
dat = re.split(r"\s+", line)
4646

4747
# Find vertex line
4848
if line[0] == 'v' and line[1] != 't' and line[1] != 'n':

0 commit comments

Comments
 (0)