Skip to content

Commit 2af12e7

Browse files
committed
Merge pull request #70 from mtezzele/qc_fix
simplify bounds checks
2 parents 1177ec7 + 487fb88 commit 2af12e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pygem/openfhandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def parse(self, filename):
4444
if nrow == 19:
4545
n_points = int(line)
4646
mesh_points = np.zeros(shape=(n_points, 3))
47-
if nrow > 20 and nrow < 21 + n_points:
47+
if 20 < nrow < 21 + n_points:
4848
line = line[line.index("(") + 1:line.rindex(")")]
4949
j = 0
5050
for number in line.split():
@@ -80,7 +80,7 @@ def write(self, mesh_points, filename):
8080
with open(self.infile, 'r') as input_file, open(self.outfile, 'w') as output_file:
8181
for line in input_file:
8282
nrow += 1
83-
if nrow > 20 and nrow < 21 + n_points:
83+
if 20 < nrow < 21 + n_points:
8484
output_file.write('(' + str(mesh_points[i][0]) + ' ' + str(mesh_points[i][1]) + \
8585
' ' + str(mesh_points[i][2]) +')')
8686
output_file.write('\n')

0 commit comments

Comments
 (0)