Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not compare types, use isinstance() #54

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading