Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 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
4 changes: 2 additions & 2 deletions .ci/azure-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

steps:
- script: |
python -m pip wheel . -w wheelhouse/
displayName: 'Build wheel'
python -m pip wheel . -w wheelhouse/ --find-links https://wheels.pyvista.org/ --only-binary="numpy"
displayName: 'Build wheel with 3.10 VTK workaround'

- script: |
python -m pip install $(package_name) --no-index -f wheelhouse/ --upgrade --ignore-installed
Expand Down
8 changes: 4 additions & 4 deletions .ci/build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ set -e -x
# build based on python version from args
PYTHON_VERSION="$1"
case $PYTHON_VERSION in
3.6)
PYBIN="/opt/python/cp36-cp36m/bin"
;;
3.7)
PYBIN="/opt/python/cp37-cp37m/bin"
;;
Expand All @@ -18,6 +15,9 @@ case $PYTHON_VERSION in
3.9)
PYBIN="/opt/python/cp39-cp39/bin"
;;
3.10)
PYBIN="/opt/python/cp310-cp310/bin"
;;
esac

# build, don't install
Expand All @@ -26,4 +26,4 @@ cd io
"${PYBIN}/python" setup.py bdist_wheel
auditwheel repair dist/$package_name*.whl
rm -f dist/*
mv wheelhouse/*manylinux2010* dist/
mv wheelhouse/*manylinux2014* dist/
12 changes: 6 additions & 6 deletions .ci/macos-install-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
PYTHON_VERSION="$1"

case $PYTHON_VERSION in
2.7)
FULL_VERSION=2.7.16
;;
3.6)
FULL_VERSION=3.6.8
;;
3.7)
FULL_VERSION=3.7.7
;;
3.8)
FULL_VERSION=3.8.3
;;
3.9)
FULL_VERSION=3.9.12
;;
3.10)
FULL_VERSION=3.10.4
;;
esac

INSTALLER_NAME=python-$FULL_VERSION-macosx10.9.pkg
Expand Down
38 changes: 32 additions & 6 deletions .github/workflows/testing-and-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Unit Testing
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true

on:
push:
Expand All @@ -9,11 +12,18 @@ on:

jobs:
macOS:
runs-on: macos-latest
runs-on: ${{ matrix.os }}
name: Mac OS Unit Testing
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10']
os: ['macos-11']
exclude:
- python-version: '3.10'
os: macos-11
include:
- python-version: '3.10'
os: macos-12

env:
SHELLOPTS: 'errexit:pipefail'
Expand All @@ -26,15 +36,31 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Build package
- name: Setup dependencies
run: |
pip install -r requirements_build.txt --only-binary="numpy" --find-links https://wheels.pyvista.org/

- name: Build wheel
run: |
pip install -r requirements_build.txt
python setup.py bdist_wheel
pip install dist/*

- name: Install package
- name: Manually install VTK wheel on 3.10 since it does not work locally
run: |
pip install --upgrade pip
curl https://wheels.pyvista.org/vtk-9.1.0.dev0-cp310-cp310-macosx_12_0_x86_64.whl -o vtk-9.1.0.dev0-cp310-cp310-macosx_10_16_x86_64.whl
pip install ./vtk-9.1.0.dev0-cp310-cp310-macosx_10_16_x86_64.whl
if: ${{ matrix.os == 'macos-12' }}
Comment on lines +44 to +49

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally on my 12.3 Monterey install I cannot reproduce this issue, but on GH actions there is some problem installing this wheel despite many attempts at debugging. So here I just hack the filename to make it seem like at 10_16 wheel so that pip will install it.

It's a hack but I think it's acceptable since we want a 3.10 wheel for this package, and this hack can go away once VTK releases 9.2 with 3.10 wheels in the coming weeks (!?)


- name: Install vtk
run: |
pip install --find-links https://wheels.pyvista.org/ vtk -vvv

- name: Install wheel
run: |
pip install dist/*

- name: Check package
run: |
python -c "import pyvista; print(pyvista.Report(gpu=False))"

- name: Install test dependencies
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ within memory and wish to repair it using MeshFix.
mesh = meshfix.mesh

# Or, access the resulting arrays directly from the object
meshfix.v # numpy np.float array
meshfix.v # numpy np.float64 array
meshfix.f # numpy np.int32 array

# View the repaired mesh (requires vtkInterface)
Expand Down Expand Up @@ -148,13 +148,13 @@ algorithm.

# Fill holes
tin.fill_small_boundaries()
print('There are {:d} boundaries'.format(tin.boundaries())
print('There are {:d} boundaries'.format(tin.boundaries()))

# Clean (removes self intersections)
tin.clean(max_iters=10, inner_loops=3)

# Check mesh for holes again
print('There are {:d} boundaries'.format(tin.boundaries())
print('There are {:d} boundaries'.format(tin.boundaries()))

# Clean again if necessary...

Expand Down
16 changes: 8 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
- job: Linux
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
pool:
vmImage: 'ubuntu-18.04'
steps:
Expand All @@ -32,11 +32,11 @@ jobs:
displayName: 'Use Python $(python.version)'
- script: |
set -ex
docker pull quay.io/pypa/manylinux2010_x86_64
docker run -e package_name=$(package_name) --rm -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /io/.ci/build_wheels.sh $(python.version)
displayName: Build wheel using manylinux2010
docker pull quay.io/pypa/manylinux2014_x86_64
docker run -e package_name=$(package_name) --rm -v `pwd`:/io quay.io/pypa/manylinux2014_x86_64 /io/.ci/build_wheels.sh $(python.version)
displayName: Build wheel using manylinux2014
- script: |
pip install dist/*.whl
pip install dist/*.whl --find-links https://wheels.pyvista.org/
displayName: Install wheel
- script: |
pip install -r requirements_test.txt
Expand All @@ -52,14 +52,14 @@ jobs:
python.architecture: 'x64'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
steps:
- template: .ci/azure-setup.yml
- template: .ci/azure-steps.yml
Expand Down
8 changes: 4 additions & 4 deletions pymeshfix/cython/_meshfix.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ cdef class PyTMesh:
raise Exception('Cannot load new arrays once initialized')

if not v.flags['C_CONTIGUOUS']:
if v.dtype != np.float:
v = np.ascontiguousarray(v, dtype=np.float)
if v.dtype not in (float, np.float64):
v = np.ascontiguousarray(v, dtype=np.float64)
else:
v = np.ascontiguousarray(v)
elif v.dtype != np.float:
v = v.astype(np.float)
elif v.dtype not in (float, np.float64):
Comment thread
adeak marked this conversation as resolved.
Outdated
v = v.astype(np.float64)

# Ensure inputs are of the right type
assert f.ndim == 2, 'Face array must be 2D numpy array'
Expand Down
2 changes: 1 addition & 1 deletion pymeshfix/meshfix.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def load_arrays(self, v, f):
# Check inputs
if not isinstance(v, np.ndarray):
try:
v = np.asarray(v, np.float)
v = np.asarray(v, np.float64)
if v.ndim != 2 and v.shape[1] != 3:
raise Exception('Invalid vertex format. Shape ' +
'should be (npoints, 3)')
Expand Down
3 changes: 2 additions & 1 deletion requirements_build.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
setuptools>=41.0.0
wheel>=0.33.0
numpy<1.20.0
numpy<1.20.0; python_version >= '3.7' and python_version <= '3.9'
numpy<=1.21.3; python_version >= '3.10'
cython>=0.29.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ def build_extensions(self):
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
python_requires='>=3.7',
url='https://github.com/pyvista/pymeshfix',

# Build cython modules
Expand Down