Skip to content

Commit

Permalink
Merge branch 'develop' of ssh://code.matforge.org/nist/fipy into tick…
Browse files Browse the repository at this point in the history
…et460-import-fipy-without-solvers-rebase
  • Loading branch information
wd15 committed Sep 20, 2012
2 parents 4b87817 + 084d364 commit 0170d4c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion examples/phase/polyxtal.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
... Viewer(vars=theta,
... datamin=-numerix.pi,
... datamax=numerix.pi)))
>>> viewer.plot()
... viewer.plot()
and iterate the solution in time, plotting as we go,
Expand Down
2 changes: 1 addition & 1 deletion examples/phase/polyxtalCoupled.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
... Viewer(vars=theta,
... datamin=-numerix.pi,
... datamax=numerix.pi)))
>>> viewer.plot()
... viewer.plot()
and iterate the solution in time, plotting as we go,
Expand Down
11 changes: 9 additions & 2 deletions fipy/tools/comms/commWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,15 @@ def allgather(self, sendobj=None, recvobj=None):
return recvobj

def sum(self, a, axis=None):
return self.epetra_comm.SumAll(numerix.array(a).sum(axis=axis))

summed = numerix.array(a).sum(axis=axis)
shape = summed.shape
if shape == ():
summed = summed.reshape((1,))
parallelSummed = self.epetra_comm.SumAll(summed)
if shape == ():
parallelSummed = parallelSummed.reshape(())
return parallelSummed

def __getstate__(self):
return {'dummy': 0}

Expand Down
38 changes: 13 additions & 25 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def run(self):
# },

##Hacked from numpy
def svn_version():
def getVersion():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
Expand All @@ -233,35 +233,23 @@ def _minimal_ext_cmd(cmd):
out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0]
return out

try:
out = _minimal_ext_cmd(['svn', 'info'])
except OSError:
print(" --- Could not run svn info --- ")
return ""
version = 'unknown'

import re
r = re.compile('Revision: ([0-9]+)')
svnver = ""

out = str(out.decode())

for line in out.split('\n'):
m = r.match(line.strip())
if m:
svnver = m.group(1)

if not svnver:
print("Error while parsing svn version")

return svnver
if os.path.exists('.git'):
try:
out = _minimal_ext_cmd(['git', 'describe', '--tags', '--match', 'version-*'])
version = out.strip().replace('version-', '').replace('_', '.').replace('-', '-dev', 1)
except OSError:
import warnings
warnings.warn("Could not run ``git describe``")
elif os.path.exists('FiPy.egg-info'):
from fipy import _getVersion
version = _getVersion()

def getVersion(version, release=False):
if not release:
version += '-dev' + svn_version()
return version

dist = setup( name = "FiPy",
version = getVersion(version='3.0', release=False),
version = getVersion(),
author = "Jonathan Guyer, Daniel Wheeler, & Jim Warren",
author_email = "fipy@nist.gov",
url = "http://www.ctcms.nist.gov/fipy/",
Expand Down

0 comments on commit 0170d4c

Please sign in to comment.