Skip to content

Commit 5d299e7

Browse files
committed
Add ruff unsafe fixes
1 parent 9083b05 commit 5d299e7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/sdf/dsres.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import scipy.io
44

55
# extract strings from the matrix
6-
strMatNormal = lambda a: [''.join(s).rstrip() for s in a]
7-
strMatTrans = lambda a: [''.join(s).rstrip() for s in zip(*a)]
6+
def strMatNormal(a):
7+
return [''.join(s).rstrip() for s in a]
8+
def strMatTrans(a):
9+
return [''.join(s).rstrip() for s in zip(*a)]
810

911

1012
def _split_description(comment):

src/sdf/plot/contour_plot_3d.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ def create_plot(filename, datasets):
2929
figure = plt.figure(figsize=(12, 8))
3030
figure.patch.set_facecolor('white')
3131

32-
nrows = len(datasets)
33-
3432
for row, dataset in enumerate(datasets):
3533

3634
# load the datasets
@@ -78,7 +76,7 @@ def create_plot(filename, datasets):
7876
ax.set_title(scale3.display_name + "=" + ("%g" % scale3.data[i]) + " " + scale3.unit)
7977
ax.set_xlabel(C1.scales[1].display_name + " / " + C1.scales[1].unit)
8078

81-
cbar = figure.colorbar(CSF)
79+
figure.colorbar(CSF)
8280

8381
plt.tight_layout()
8482

tests/test_sdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def test_hierarchy(self):
132132
sdf.save('roundtrip.sdf', g)
133133

134134
# load the group from the file
135-
g2 = sdf.load('roundtrip.sdf', '/')
135+
sdf.load('roundtrip.sdf', '/')
136136

137137
# TODO: compare the objects
138138
#self.assertEqual(pickle.dumps(g), pickle.dumps(g2))

0 commit comments

Comments
 (0)