Skip to content
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
41 changes: 21 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
cache: apt
sudo: false

language: python
python:
- "2.7"
- "2.7"

virtualenv:
system_site_packages: true

before_install:
- travis_retry wget http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda
- travis_retry wget http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda

install:
- conda create --yes -n test python=$TRAVIS_PYTHON_VERSION
- source activate test
- conda install --yes numpy scipy matplotlib pip nose
- pip install setuptools
- pip install enum34
- pip install numpy-stl
- pip install coveralls
- pip install coverage
- python setup.py install
- conda create --yes -n test python=$TRAVIS_PYTHON_VERSION
- source activate test
- conda install --yes numpy scipy matplotlib pip nose vtk
- pip install setuptools
- pip install enum34
- pip install numpy-stl
- pip install coveralls
- pip install coverage
- python setup.py install

script: coverage run test.py

after_success:
- coveralls
- coveralls

branches:
only:
- master
only:
- master
17 changes: 12 additions & 5 deletions pygem/file_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,11 @@ def parse(self, filename):
reader.Update()
data = reader.GetOutput()

mesh_points = np.zeros([data.GetNumberOfPoints(),3])
n_points = data.GetNumberOfPoints()
mesh_points = np.zeros([n_points, 3])

for i in range(data.GetNumberOfPoints()):
mesh_points[i,0],mesh_points[i,1],mesh_points[i,2] = data.GetPoint(i)
for i in range(n_points):
mesh_points[i, 0], mesh_points[i, 1], mesh_points[i, 2] = data.GetPoint(i)

return mesh_points

Expand Down Expand Up @@ -224,8 +225,14 @@ def write(self, mesh_points, filename):

writer = vtk.vtkDataSetWriter()
writer.SetFileName(self.outfile)
writer.SetInput(data)



if vtk.VTK_MAJOR_VERSION <= 5:
writer.SetInput(data)
else:
writer.SetInputData(data)

#writer.SetInputData(data)
writer.Write()


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def readme():
description='Tools to apply FFD.',
long_description=readme(),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Intended Audience :: Science/Research',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_datasets/test_red_blood_cell_out_true.vtk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vtk DataFile Version 3.0
# vtk DataFile Version 4.0
vtk output
ASCII
DATASET UNSTRUCTURED_GRID
Expand Down