yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #01871
[Branch ~yade-dev/yade/trunk] Rev 1733: utils.uniaxialTestFeatures: fix compat with py2.5
------------------------------------------------------------
revno: 1733
committer: Václav Šmilauer <vaclav@flux>
branch nick: trunk
timestamp: Mon 2009-08-24 19:07:33 +0200
message:
utils.uniaxialTestFeatures: fix compat with py2.5
SConstruct: fix compilation issues with older symlinks in include dirs
modified:
SConstruct
py/utils.py
--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'SConstruct'
--- SConstruct 2009-08-23 15:50:47 +0000
+++ SConstruct 2009-08-24 17:07:33 +0000
@@ -510,6 +510,7 @@
if not env['haveForeach']:
mkSymlink(boostDir+'/foreach.hpp','extra/foreach.hpp_local')
#mkSymlink(boostDir+'/python','py/3rd-party/boost-python-indexing-suite-v2-noSymlinkHeaders')
+ if os.path.exists(boostDir+'/python'): os.remove(boostDir+'/python') # remove deprecated symlink from previous line that can break things if it is left there; remove this at some point in the future
mkSymlink(buildDir+'/include/yade-'+env['version']+'/indexing_suite','py/3rd-party/boost-python-indexing-suite-v2-noSymlinkHeaders')
#env.InstallAs(env['PREFIX']+'/include/yade-'+env['version']+'/boost/foreach.hpp',foreachTarget)
env.Default(env.Alias('install',['$PREFIX/bin','$PREFIX/lib'])) # build and install everything that should go to instDirs, which are $PREFIX/{bin,lib} (uses scons' Install)
=== modified file 'py/utils.py'
--- py/utils.py 2009-08-22 18:21:25 +0000
+++ py/utils.py 2009-08-24 17:07:33 +0000
@@ -489,7 +489,7 @@
if filename: ids=spheresFromFile(filename,**kw)
else: ids=[b.id for b in O.bodies]
mm,mx=aabbExtrema()
- dim=aabbDim(); axis=dim.index(max(dim))
+ dim=aabbDim(); axis=list(dim).index(max(dim)) # list(dim) for compat with python 2.5 which didn't have index defined for tuples yet (appeared in 2.6 first)
import numpy
areas=[approxSectionArea(coord,axis) for coord in numpy.linspace(mm[axis],mx[axis],num=10)[1:-1]]
negIds,posIds=negPosExtremeIds(axis=axis,distFactor=2.2)