Skip to content

Commit 71c48d9

Browse files
authored
Merge pull request #578 from guyer/inline
Add --inline to travis tests
2 parents 23fab6d + c87a05a commit 71c48d9

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.travis.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ os:
77
- linux
88
env:
99
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=pysparse
10+
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=pysparse FIPY_INLINE=1
1011
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=scipy
1112
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=trilinos
1213
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN="mpirun -np 2" FIPY_SOLVERS=trilinos
@@ -56,10 +57,10 @@ before_install:
5657
if [[ $PY3K -eq 1 ]]; then
5758
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION numpy scipy gmsh matplotlib;
5859
else
59-
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION numpy scipy gmsh pysparse mpi4py matplotlib mayavi fipytrilinos;
60+
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION numpy scipy gmsh pysparse mpi4py matplotlib mayavi fipytrilinos weave;
6061
fi
6162
elif [[ $TRAVIS_OS_NAME -eq "osx" ]]; then
62-
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION fipy;
63+
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION fipy weave;
6364
fi
6465
- source activate test-environment
6566
# Useful for debugging any issues with conda
@@ -81,6 +82,9 @@ before_script:
8182
sleep 3;
8283
fi
8384
script:
84-
$MPIRUN python setup.py test ;
85-
# ls -l /usr/lib/liblapack*;
86-
# dpkg -l "liblapack*";
85+
# inline must be run twice to clear out compiler warnings
86+
# we don't care if it fails the first time
87+
- if [[ ! -z "${FIPY_INLINE}" ]]; then
88+
$MPIRUN python setup.py test > /dev/null 2>&1 || true;
89+
fi
90+
- $MPIRUN python setup.py test;

fipy/meshes/cylindricalNonUniformGrid2D.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(self, dx=1., dy=1., nx=None, ny=None,
7373
super(CylindricalNonUniformGrid2D, self).__init__(dx=dx, dy=dy, nx=nx, ny=ny, overlap=overlap,
7474
communicator=communicator, *args, **kwargs)
7575

76-
self._faceAreas *= self.faceCenters[0]
76+
self._faceAreas *= self.faceCenters[0].value
7777

7878
self._scaledFaceAreas = self._scale['area'] * self._faceAreas
7979
self._areaProjections = self.faceNormals * self._faceAreas

fipy/tools/numerix.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,14 @@ def sqrtDot(a1, a2):
447447
448448
Usually used with v1==v2 to return magnitude of v1.
449449
"""
450-
unit1 = unit2 = 1
450+
from fipy.tools.dimensions import physicalField
451+
unit1 = unit2 = physicalField._unity
451452

452453
def dimensionlessUnmasked(a):
453-
unit = 1
454+
unit = physicalField._unity
454455
mask = False
455456
if _isPhysical(a):
456-
unit = a.inBaseUnits().getUnit()
457+
unit = a.inBaseUnits().unit
457458
a = a.numericValue
458459
if MA.isMaskedArray(a):
459460
mask = a.mask
@@ -481,7 +482,7 @@ def dimensionlessUnmasked(a):
481482
if NUMERIX.any(mask1) or NUMERIX.any(mask2):
482483
result1 = MA.array(result1, mask=NUMERIX.logical_or(mask1, mask2))
483484

484-
if unit1 != 1 or unit2 != 1:
485+
if unit1 != physicalField._unity or unit2 != physicalField._unity:
485486
from fipy.tools.dimensions.physicalField import PhysicalField
486487
result1 = PhysicalField(value=result, unit=(unit1 * unit2)**0.5)
487488

0 commit comments

Comments
 (0)