File: 0005-Fix-SyntaxWarning.patch

package info (click to toggle)
pysph 1.0~b2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,100 kB
  • sloc: python: 58,494; makefile: 212; cpp: 206; sh: 165
file content (36 lines) | stat: -rw-r--r-- 1,221 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
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Wed, 5 Jul 2023 05:36:58 +0000
Subject: Fix SyntaxWarning

Forwarded: not-needed
---
 pysph/solver/vtk_output.py | 2 +-
 pysph/tools/read_mesh.py   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pysph/solver/vtk_output.py b/pysph/solver/vtk_output.py
index c472038..7a105e7 100644
--- a/pysph/solver/vtk_output.py
+++ b/pysph/solver/vtk_output.py
@@ -33,7 +33,7 @@ class VTKOutput(Output):
 
         self.vectors = {}
         for name, vector in vectors.items():
-            assert (len(vector) is 3)
+            assert (len(vector) == 3)
             self.vectors[name] = vector
 
     def set_output_scalar(self, scalars=None):
diff --git a/pysph/tools/read_mesh.py b/pysph/tools/read_mesh.py
index 9b91807..ea33952 100644
--- a/pysph/tools/read_mesh.py
+++ b/pysph/tools/read_mesh.py
@@ -85,7 +85,7 @@ def mesh2points(file_name, dx, file_format=None, uniform=False):
         xf, yf, zf = surface_points(x, y, z, cells, dx)
 
     else:
-        if file_format is 'stl':
+        if file_format == 'stl':
             normals = mesh.mesh.cell_data['facet_normals'][0]
         else:
             normals = mesh.compute_normals()