Skip to content

Commit

Permalink
CIs error on deprecation warning (#708)
Browse files Browse the repository at this point in the history
* Raise errors for DeprecationWarnings during CI tests

* Remove ez_setup.py

The version here [generates deprecations](https://app.circleci.com/jobs/github/usnistgov/fipy/2031)
and [ez_setup.py itself is deprecated](pypa/setuptools#581)

* Change "FORTRAN" array ordering to 'F'

Missed in #707

* Update from deprecated Pysparse API

This stuff was deprecated [ages ago](https://sourceforge.net/p/pysparse/git/ci/241a05d7a6e5f0f8ae28c53ac79a2111fe2d7cc0/)

* Switch from itsolvers classes to krylov functions

The itsolvers classes aren't written right (e.g., `solve()` doesn't
return anything) and don't encapsulate anything we care about.
The `krylov` calls are set up the way we expect.

* Raise errors for DeprecationWarnings only in test suite

Raising errors for all of `python setup.py test` causes
errors for deprecations in things we don't control, like versioneer.

* Use legacy absolute tolerance for scipy Krylov solvers

Avoid DeprecationWarning

* Introduce specialized TestProgram to throw Deprecation errors

In Py3k, TestProgram makes it very hard to change DeprecationWarnings
into errors. [TestProgram gives all warnings an action of `default`](https://github.com/python/cpython/blob/master/Lib/unittest/main.py#L84)
which causes [TestRunner to clobber our DeprecationWarning filter](https://github.com/python/cpython/blob/master/Lib/unittest/runner.py#L167)
(passing any other action to TestProgram just causes that action to clobber instead)

* Force Py27 builds on Visual Studio 2015

scikit-fmm (and maybe others) needs VC++ 9.0
https://help.appveyor.com/discussions/problems/26278-organization-build-fails-because-vc-90-is-not-present

* Choose appropriate build environment

[Exclude unwanted build configurations](https://www.appveyor.com/docs/build-configuration/#exclude-configuration-from-the-matrix)
  • Loading branch information
guyer authored Feb 14, 2020
1 parent 6c9451e commit ea78c12
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 312 deletions.
14 changes: 13 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This file was adapted from what's generated by conda-smithy.

image:
- Visual Studio 2015
- Visual Studio 2019

environment:

matrix:
Expand Down Expand Up @@ -34,6 +38,14 @@ environment:
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
FIPY_SOLVERS: scipy

matrix:
exclude:
- image: Visual Studio 2015
CONDA_PY: 36

- image: Visual Studio 2019
CONDA_PY: 27

# We always use a 64-bit machine, but can build x86 distributions
# with the TARGET_ARCH variable.
platform:
Expand Down Expand Up @@ -91,7 +103,7 @@ build_script:
test_script:
- python setup.py egg_info
- if defined FIPY_INLINE python setup.py test 1> NUL 2>&1
- python setup.py test
- python setup.py test --deprecation-errors
- conda env export

artifacts:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ commands:
if [[ ! -z "${FIPY_INLINE}" ]]; then
<< parameters.mpirun >> python setup.py test > /dev/null 2>&1 || true;
fi
<< parameters.mpirun >> python setup.py test
<< parameters.mpirun >> python setup.py test --deprecation-errors
- run:
name: Output Environment
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ before_script:
travis_wait 40 $MPIRUN python setup.py test || true;
fi
script:
- $MPIRUN python setup.py test;
- $MPIRUN python setup.py test --deprecation-errors;
after_success:
- conda env export
1 change: 0 additions & 1 deletion MANIFEST-UNIX.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include *.rst
include ez_setup.py
# include MANIFEST MANIFEST.in *.rst

recursive-include documentation *.rst
Expand Down
6 changes: 3 additions & 3 deletions examples/levelSet/electroChem/matplotlibSurfactantViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ def _plot(self):

maxX = max(X)

X = X.reshape(shape, order="FORTRAN")
Y = Y.reshape(shape, order="FORTRAN")
Z = self.distanceVar.value.reshape(shape, order="FORTRAN")
X = X.reshape(shape, order='F')
Y = Y.reshape(shape, order='F')
Z = self.distanceVar.value.reshape(shape, order='F')

zmin, zmax = self._autoscale(vars=(self.surfactantVar,),
datamin=self._getLimit(('datamin', 'zmin')),
Expand Down
287 changes: 0 additions & 287 deletions ez_setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions fipy/solvers/pysparse/linearCGSSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import sys

from pysparse import itsolvers
from pysparse.itsolvers import krylov

from fipy.solvers.pysparse.pysparseSolver import PysparseSolver

Expand Down Expand Up @@ -36,4 +36,4 @@ def __init__(self, precon=None, *args, **kwargs):
import warnings
warnings.warn("The Pysparse CGS solver may return incorrect results for some matrices", UserWarning)
super(LinearCGSSolver, self).__init__(precon=precon, *args, **kwargs)
self.solveFnc = itsolvers.cgs
self.solveFnc = krylov.cgs
6 changes: 3 additions & 3 deletions fipy/solvers/pysparse/linearGMRESSolver.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from __future__ import unicode_literals
__docformat__ = 'restructuredtext'

from fipy.solvers.pysparse.preconditioners import JacobiPreconditioner
from pysparse import itsolvers
from pysparse.itsolvers import krylov

from fipy.solvers.pysparse.preconditioners import JacobiPreconditioner
from fipy.solvers.pysparse.pysparseSolver import PysparseSolver

__all__ = ["LinearGMRESSolver"]
Expand Down Expand Up @@ -32,4 +32,4 @@ def __init__(self, precon=JacobiPreconditioner(), *args, **kwargs):
precon : ~fipy.solvers.pysparse.preconditioners.preconditioner.Preconditioner, optional
"""
super(LinearGMRESSolver, self).__init__(precon=precon, *args, **kwargs)
self.solveFnc = itsolvers.gmres
self.solveFnc = krylov.gmres
2 changes: 1 addition & 1 deletion fipy/solvers/pysparse/linearLUSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import os

from pysparse import superlu
from pysparse.direct import superlu

from fipy.solvers.pysparse.pysparseSolver import PysparseSolver
from fipy.tools import numerix
Expand Down
Loading

0 comments on commit ea78c12

Please sign in to comment.