Skip to content
Merged
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
10 changes: 5 additions & 5 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 Expand Up @@ -380,7 +380,7 @@ def plot_species(self, species, t_ndx=0, concentration=False, deterministic=Fals
if colormap is None:
colormap = "viridis"

plt.figure(figsize=(mpl_width,mpl_height))
plt.figure(figsize=(width, height))
plt.scatter(points[:,0],points[:,1],c=d,cmap=colormap)
plt.axis('scaled')
plt.colorbar()
Expand Down