Skip to content

Commit

Permalink
Merge pull request #578 from guyer/inline
Browse files Browse the repository at this point in the history
Add --inline to travis tests
  • Loading branch information
guyer authored Jun 14, 2018
2 parents 23fab6d + c87a05a commit 71c48d9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ os:
- linux
env:
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=pysparse
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=pysparse FIPY_INLINE=1
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=scipy
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN= FIPY_SOLVERS=trilinos
- TRAVIS_PYTHON_VERSION=2.7 MPIRUN="mpirun -np 2" FIPY_SOLVERS=trilinos
Expand Down Expand Up @@ -56,10 +57,10 @@ before_install:
if [[ $PY3K -eq 1 ]]; then
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION numpy scipy gmsh matplotlib;
else
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;
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;
fi
elif [[ $TRAVIS_OS_NAME -eq "osx" ]]; then
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION fipy;
conda create --quiet --name test-environment --show-channel-urls --channel guyer --channel conda-forge python=$TRAVIS_PYTHON_VERSION fipy weave;
fi
- source activate test-environment
# Useful for debugging any issues with conda
Expand All @@ -81,6 +82,9 @@ before_script:
sleep 3;
fi
script:
$MPIRUN python setup.py test ;
# ls -l /usr/lib/liblapack*;
# dpkg -l "liblapack*";
# inline must be run twice to clear out compiler warnings
# we don't care if it fails the first time
- if [[ ! -z "${FIPY_INLINE}" ]]; then
$MPIRUN python setup.py test > /dev/null 2>&1 || true;
fi
- $MPIRUN python setup.py test;
2 changes: 1 addition & 1 deletion fipy/meshes/cylindricalNonUniformGrid2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self, dx=1., dy=1., nx=None, ny=None,
super(CylindricalNonUniformGrid2D, self).__init__(dx=dx, dy=dy, nx=nx, ny=ny, overlap=overlap,
communicator=communicator, *args, **kwargs)

self._faceAreas *= self.faceCenters[0]
self._faceAreas *= self.faceCenters[0].value

self._scaledFaceAreas = self._scale['area'] * self._faceAreas
self._areaProjections = self.faceNormals * self._faceAreas
Expand Down
9 changes: 5 additions & 4 deletions fipy/tools/numerix.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,14 @@ def sqrtDot(a1, a2):
Usually used with v1==v2 to return magnitude of v1.
"""
unit1 = unit2 = 1
from fipy.tools.dimensions import physicalField
unit1 = unit2 = physicalField._unity

def dimensionlessUnmasked(a):
unit = 1
unit = physicalField._unity
mask = False
if _isPhysical(a):
unit = a.inBaseUnits().getUnit()
unit = a.inBaseUnits().unit
a = a.numericValue
if MA.isMaskedArray(a):
mask = a.mask
Expand Down Expand Up @@ -481,7 +482,7 @@ def dimensionlessUnmasked(a):
if NUMERIX.any(mask1) or NUMERIX.any(mask2):
result1 = MA.array(result1, mask=NUMERIX.logical_or(mask1, mask2))

if unit1 != 1 or unit2 != 1:
if unit1 != physicalField._unity or unit2 != physicalField._unity:
from fipy.tools.dimensions.physicalField import PhysicalField
result1 = PhysicalField(value=result, unit=(unit1 * unit2)**0.5)

Expand Down

0 comments on commit 71c48d9

Please sign in to comment.