Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Prefer our VTKReader: bug reading D[] results as array in official
  • Loading branch information
makdl committed Jun 14, 2021
commit f78940d1c33a38a76f69c437cf5203c2d2fdc5b5
8 changes: 4 additions & 4 deletions spatialpy/Result.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
import numpy

from spatialpy.Model import *
from spatialpy.VTKReader import VTKReader

try:
import vtk
except ImportError as e:
print('''The Python package 'vtk' is not installed. Using integrated VTK reader. This is significantly
slower than the official VTK package.''')
from spatialpy.VTKReader import VTKReader
pass

common_rgb_values=['#1f77b4','#ff7f0e','#2ca02c','#d62728','#9467bd','#8c564b','#e377c2','#7f7f7f',
'#bcbd22','#17becf','#ff0000','#00ff00','#0000ff','#ffff00','#00ffff','#ff00ff',
Expand Down Expand Up @@ -68,6 +67,7 @@ def __init__(self, model=None, result_dir=None):
self.stdout = None
self.stderr = None
self.timeout = False
self.official_vtk = False
self.result_dir = result_dir


Expand Down Expand Up @@ -183,7 +183,7 @@ def read_step(self, step_num, debug=False):
if debug:
print("read_step({0}) opening '{1}'".format(step_num, filename))

if 'vtk' in sys.modules:
if self.official_vtk:
reader = vtk.vtkGenericDataObjectReader()
reader.SetFileName(filename)
reader.Update()
Expand Down