Commit cfb14e34 authored by eric pellegrini's avatar eric pellegrini

Merge branch 'release-1.0.12'

parents 0f17e512 55f5b8bb
Pipeline #3060 passed with stages
in 9 minutes and 56 seconds
......@@ -9,3 +9,4 @@ dist/
Tests/FunctionalTests/Jobs
/.gitignore
/MANIFEST
.settings
......@@ -77,7 +77,7 @@ build:osx:
- build
expire_in: 1 day
tags:
- mac
- macmini2
test:osx:
stage: test
......@@ -95,7 +95,7 @@ test:osx:
dependencies:
- build:osx
tags:
- mac
- macmini2
deploy:osx:
stage: deploy
......@@ -110,7 +110,7 @@ deploy:osx:
paths:
- BuildServer/Darwin/Build/*.dmg
tags:
- mac
- macmini2
# # windows 7 pipeline
......
......@@ -17,7 +17,7 @@ if sys.platform.startswith('darwin'):
u'LSApplicationCategoryType': u'public.app-category.science'
}
OPTIONS = {
'argv_emulation': True,
'argv_emulation': False,# has to be False otherwise triggers problems zith wxPython which lose some events that are captured by OS
'iconfile': u'../../../MDANSE/GUI/Icons/mdanse.icns',
'excludes': 'PyQt4',
'matplotlib_backends': '-',
......@@ -26,14 +26,15 @@ if sys.platform.startswith('darwin'):
'bdist_base': '../Build/build',
'dist_dir': '../Build/dist',
'graph': False,
'xref': False
'xref': False,
'packages' : ["MDANSE","MMTK","Scientific"]
}
setup(
name="MDANSE",
name='MDANSE',
app=APP,
options={'py2app': OPTIONS},
setup_requires=['py2app']
)
else:
print 'No build_app implementation for your system.'
print 'No build_app implementation for your system.'
#!/bin/bash
files=`ls ./dist/MDANSE.app/Contents/Frameworks/libwx*.dylib`
libs="osx_cocoau_xrc osx_cocoau_webview osx_cocoau_html osx_cocoau_qa osx_cocoau_adv osx_cocoau_core baseu_xml baseu_net baseu"
for f in $files
do
chmod 777 $f
for l in $libs
do
install_name_tool -change /usr/local/lib/libwx_$l-3.0.dylib @executable_path/../Frameworks/libwx_$l-3.0.dylib $f
done
done
......@@ -11,7 +11,7 @@ ROUGE="\\033[1;31m"
BLEU="\\033[1;34m"
##Select the build target
BUILD_TARGET=darwin
# take the latest version of nmoldyn available on the forge
echo -e "$BLEU""Getting last MDANSE revision" "$NORMAL"
......@@ -31,10 +31,10 @@ rm -rf build
rm -rf dist
# Remove previous install of MDANSE
rm /usr/local/bin/mdanse*
rm /usr/local/lib/python2.7/site-packages/MDANSE*.egg-info
rm -rf /usr/local/lib/python2.7/site-packages/MDANSE
rm /Library/Frameworks/Python.framework/Versions/2.7/bin/mdanse*
rm /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MDANSE*.egg-info
rm -rf /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MDANSE
# Build and install MDANSE to the homebrewed python
/usr/local/bin/python setup.py build >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
/usr/local/bin/python setup.py install >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py build >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
......@@ -36,7 +36,7 @@ export DISTUTILS_DEBUG=0
cd BuildServer/Darwin/Scripts
/usr/local/bin/python build.py py2app >> build_log.txt 2>&1
/usr/local/bin/python build.py py2app
rc=$?
if [[ $rc != 0 ]]; then
......@@ -63,6 +63,25 @@ hdiutil unmount /Volumes/MDANSE -force -quiet
sleep 5
# When launching the bundle, the executable target (i.e. MDANSE) modify the python that is shipped with the bundle (si.e. package path, dylib dependencies ...)
# see http://joaoventura.net/blog/2016/embeddable-python-osx/ for technical details
# In our case we also want the user to be able to start directly python without launching the bundle executable (e.g. to run scripts in command line) which is the reason
# why we have to modify the python executable appropriately with the following commands
cp -r /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7
rm -rf ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/*
cp /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ./dist/MDANSE.app/Contents/MacOS/python
cp /Library/Frameworks/Python.framework/Versions/2.7/Python ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
install_name_tool -change /Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ./dist/MDANSE.app/Contents/MacOS/python
chmod 777 ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
install_name_tool -id @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
# In order that the modified python in the bundle import the zipped sitepackages located in Contents/Resources we provide a modified site.py that will
# update the sys.path accordingly
cp ../Scripts/site.py ./dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/.
chmod 777 ../Scripts/change_dylib_path.sh
../Scripts/change_dylib_path.sh
../Tools/create-dmg/create-dmg --background "../Resources/background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 "${MDANSE_DMG}" ./dist
exit
......@@ -4,7 +4,7 @@ ROUGE="\\033[1;31m"
# Performs the unit tests
cd Tests/UnitTests
nosetests --verbosity=3 -P .
/Library/Frameworks/Python.framework/Versions/2.7/bin/nosetests --verbosity=3 -P .
# Exit now if unable to run tests
if [ $? -ne 0 ]; then
status = $?
......@@ -14,8 +14,8 @@ fi
cd ../..
cd Tests/FunctionalTests/Jobs
python BuildJobTests.py
nosetests --verbosity=3 --exe -P .
/Library/Frameworks/Python.framework/Versions/2.7/bin/python BuildJobTests.py
/Library/Frameworks/Python.framework/Versions/2.7/bin/nosetests --verbosity=3 --exe -P .
if [ $? -ne 0 ]; then
status=$?
echo -e "$ROUGE""One or several functional tests failed"
......
This diff is collapsed.
version 1.0.12
--------------
* updated the macos build scripts in order to have an universal dmg
version 1.0.11
-------------
* bug fix when converting MS trajectories due to a too small value for recursionlimit parameter
......
......@@ -152,25 +152,7 @@ class XTDFile(object):
bondsMapping[idx] = [atomsMapping[int(v)] for v in node.attrib['Connects'].split(',')]
idx1,idx2 = bondsMapping[idx]
self._atoms[idx1]["bonded_to"].add(idx2)
self._atoms[idx2]["bonded_to"].add(idx1)
def _build_universe(self, idx, clustered, cluster):
"""
"""
clustered[idx] = True
cluster.append(idx)
at = self._atoms[idx]
for nidx in at["bonded_to"]:
if nidx in clustered:
continue
self._build_universe(nidx, clustered, cluster)
self._atoms[idx2]["bonded_to"].add(idx1)
def build_universe(self):
......@@ -179,37 +161,47 @@ class XTDFile(object):
self._universe.setShape(self._cell)
else:
self._universe = InfiniteUniverse()
clustered = {}
cluster = []
configuration = numpy.empty((self._nAtoms,3),dtype=numpy.float64)
for idx in self._atoms.keys():
if idx in clustered:
continue
self._build_universe(idx, clustered, cluster)
clustername = collections.defaultdict(lambda : 0)
ac = []
for idx in cluster:
nclusters = 0
clusters = {}
equivalences = {}
for idx,atom in self._atoms.items():
if not clusters.has_key(idx):
nclusters += 1
clusters[idx] = nclusters
for neighbor in atom["bonded_to"]:
if (neighbor in clusters) and (clusters[idx] != clusters[neighbor]):
equivalences[clusters[neighbor]] = equivalences.get(clusters[idx],clusters[idx])
clusters[neighbor] = clusters[idx]
mergedClusters = {}
for idx,clusterId in clusters.items():
if equivalences.has_key(clusterId):
mergedClusters.setdefault(equivalences[clusterId],[]).append(idx)
else:
mergedClusters.setdefault(clusterId,[]).append(idx)
for k,indexes in mergedClusters.items():
atomCluster = AtomCluster([])
bruteFormula = collections.defaultdict(lambda : 0)
for idx in indexes:
element = self._atoms[idx]["element"]
name = self._atoms[idx]["name"]
at = Atom(element, name=name, xtdIndex=idx)
at.index = self._atoms[idx]["mmtk_index"]
configuration[at.index] = self._atoms[idx]["xyz"]
ac.append(at)
clustername[element] += 1
clustername = "".join(["%s%d" % (k,v) for k,v in sorted(clustername.items())])
cluster = []
ac = AtomCluster(ac,name=clustername)
self._universe.addObject(ac)
atomCluster.atoms.append(at)
bruteFormula[element] += 1
atomCluster.name = "".join(["%s%d" % (k,v) for k,v in sorted(bruteFormula.items())])
self._universe.addObject(atomCluster)
if self._pbc:
configuration = self._universe._boxToRealPointArray(configuration)
......
......@@ -118,9 +118,9 @@ class JobPlugin(ComponentPlugin):
startupinfo.wShowWindow = subprocess.SW_HIDE
else:
startupinfo = None
subprocess.Popen([sys.executable, filename], startupinfo=startupinfo, stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.check_output([sys.executable, filename],stderr=subprocess.STDOUT)
time.sleep(1)
PUBLISHER.sendMessage("msg_start_job",message=None)
......@@ -190,4 +190,4 @@ if __name__ == "__main__":
app = wx.App(False)
f = JobFrame(None,'dacf',filename)
f.Show()
app.MainLoop()
\ No newline at end of file
app.MainLoop()
......@@ -30,9 +30,6 @@ Created on Mar 26, 2015
:author: Eric C. Pellegrini
'''
import sys
sys.setrecursionlimit(10000)
import os
import warnings
warnings.filterwarnings("ignore")
......
__version__ = "1.0.11"
__version__ = "1.0.12"
__date__ = "05-04-2017"
__date__ = "24-11-2017"
__author__ = "Eric Pellegrini"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment