Skip to content

Commit

Permalink
Merge pull request #54 from boutproject/ruff-fix
Browse files Browse the repository at this point in the history
Do not compare types, use `isinstance()`
  • Loading branch information
ZedThree authored Apr 30, 2024
2 parents a5c1411 + 0dd5d96 commit 6c22995
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 9 deletions.
1 change: 0 additions & 1 deletion boututils/analyse_equil_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Takes a RZ psi grid, and finds x-points and o-points
"""


import numpy
from crosslines import find_inter
from matplotlib.pyplot import annotate, contour, draw, gradient, plot
Expand Down
1 change: 0 additions & 1 deletion boututils/anim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Animate graph with mayavi"""


import os

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion boututils/calculus.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
B.Dudson, University of York, Nov 2009
"""


try:
from past.utils import old_div
except ImportError:
Expand Down
3 changes: 1 addition & 2 deletions boututils/datafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"""


import numpy as np

from boututils.boutarray import BoutArray
Expand Down Expand Up @@ -942,7 +941,7 @@ def write(self, name, data, info=False):

try:
for attrname, attrval in data.attributes.items():
if type(attrval) == str:
if isinstance(attrval, str):
attrval = attrval.encode(encoding="utf-8")
self.handle[name].attrs.create(attrname, attrval)
except AttributeError:
Expand Down
1 change: 0 additions & 1 deletion boututils/showdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""


from matplotlib import animation
from matplotlib import pyplot as plt
from numpy import abs, array, floor, isclose, linspace, max, meshgrid, min, pi
Expand Down
1 change: 0 additions & 1 deletion boututils/spectrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""


from numpy import arange, cos, exp, linspace, max, min, power, sin, transpose, zeros
from scipy import fftpack, pi

Expand Down
1 change: 0 additions & 1 deletion boututils/surface_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""


import numpy as np
from past.utils import old_div

Expand Down
1 change: 0 additions & 1 deletion boututils/volume_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""


import numpy as np
from past.utils import old_div

Expand Down

0 comments on commit 6c22995

Please sign in to comment.