Skip to content

Commit

Permalink
[FIX 🧹] Code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
saratheriver committed Jul 26, 2022
1 parent c26483b commit 23ac2e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions enigmatoolbox/vtk_interface/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def connect(ftr0, ftr1, port0=0, port1=0, add_conn=False):
raise ValueError("'{0}' only accepts {1} input ports.".
format(ftr1.__vtkname__, ftr1.nip))

if add_conn is True or isinstance(add_conn, int):
if add_conn is True or type(add_conn) == int:
if ftr1.nip > 1:
raise ValueError("No support yet for 'add_conn' when filter "
"has more than 1 input ports.")
Expand All @@ -65,7 +65,7 @@ def connect(ftr0, ftr1, port0=0, port1=0, add_conn=False):
"accept multiple connections.".
format(ftr1.nip, ftr1.__vtkname__))

if isinstance(add_conn, int):
if type(add_conn) == int:
if not hasattr(ftr1, 'GetUserManagedInputs') or \
ftr1.GetUserManagedInputs() == 0:
raise ValueError("Input port {0} of '{1}' does not accept "
Expand All @@ -77,7 +77,7 @@ def connect(ftr0, ftr1, port0=0, port1=0, add_conn=False):
if add_conn is True:
# Connection for only 1 input port. Not tested.
ftr1.AddInputConnection(port1, op)
elif isinstance(add_conn, int):
elif type(add_conn) == int:
# Connection for only 1 input port. Not tested.
ftr1.SetInputConnectionByNumber(add_conn, op)
else:
Expand All @@ -87,7 +87,7 @@ def connect(ftr0, ftr1, port0=0, port1=0, add_conn=False):
ftr0 = ftr0.VTKObject
if add_conn is True:
ftr1.AddInputData(ftr0)
elif isinstance(add_conn, int):
elif type(add_conn) == int:
ftr1.SetInputDataByNumber(add_conn, ftr0)
else:
ftr1.SetInputDataObject(port1, ftr0)
Expand Down

0 comments on commit 23ac2e2

Please sign in to comment.