Commit f447d128 authored by Ingo Meyer's avatar Ingo Meyer

Merge remote-tracking branch 'upstream-gitolite/develop' into develop

parents 2a7fbd53 8bb49d84
Pipeline #29168 failed with stages
in 2 minutes and 2 seconds
The MIT License (MIT)
Copyright (c) 2015 Ingo Heimbach
Copyright (c) 2015 Ingo Meyer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -47,5 +47,5 @@ We provide binary software packages for Linux and Mac OS X at our
Contact
=======
For questions, bug reports or feature requests please contact `Ingo Heimbach <mailto:i.heimbach@fz-juelich.de>`_
For questions, bug reports or feature requests please contact `Ingo Meyer <mailto:i.meyer@fz-juelich.de>`_
(software maintainer).
......@@ -16,12 +16,43 @@ array_contains() {
}
python_flags() {
test_framework_version() {
local DARWIN_FRAMEWORK_PATH
local CURRENT_TEMP_DIR
local DARWIN_FRAMEWORK_VERSION
DARWIN_FRAMEWORK_PATH="${1}"
CURRENT_TEMP_DIR="$(mktemp -d)"
pushd "${CURRENT_TEMP_DIR}" >/dev/null 2>&1
cat <<-EOF > main.c
#include <Python/Python.h>
#include <stdio.h>
int main(void) {
printf("%d\n", PY_MAJOR_VERSION);
return 0;
}
EOF
DARWIN_FRAMEWORK_VERSION="0"
clang -o main -F"${DARWIN_FRAMEWORK_PATH}" -framework Python main.c >/dev/null 2>&1 && \
DARWIN_FRAMEWORK_VERSION="$(./main)"
popd >/dev/null 2>&1
rm -rf "${DARWIN_FRAMEWORK_VERSION}" >/dev/null 2>&1
echo "${DARWIN_FRAMEWORK_VERSION}"
}
local DARWIN_CONDA_INCLUDE="${CONDA_PREFIX}/include/python2.7"
local DARWIN_CONDA_LIB="${CONDA_PREFIX}/lib"
local DARWIN_LOCAL_FRAMEWORK="/usr/local/Library/Frameworks"
local DARWIN_FRAMEWORK="/System/Library/Frameworks"
local DARWIN_LOCAL_INCLUDE="/usr/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7"
local DARWIN_INCLUDE="/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7"
local DARWIN_LOCAL_FRAMEWORK_INCLUDE="${DARWIN_LOCAL_FRAMEWORK}/Python.framework/Versions/2.7/include/python2.7"
local DARWIN_FRAMEWORK_INCLUDE="${DARWIN_FRAMEWORK}/Python.framework/Versions/2.7/include/python2.7"
local DARWIN_LOCAL_INCLUDE="/usr/local/include/python2.7"
local DARWIN_LOCAL_FRAMEWORK_LIB="${DARWIN_LOCAL_FRAMEWORK}/Python.framework/Versions/2.7/lib/"
local DARWIN_LOCAL_LIB="/usr/local/lib/python2.7"
local LINUX_LOCAL_INCLUDE="/usr/local/include/python2.7"
local LINUX_INCLUDE="/usr/include/python2.7"
local LINUX_LOCAL_LIB="/usr/local/lib/python2.7"
......@@ -34,12 +65,18 @@ python_flags() {
if [ -n "${CONDA_PREFIX}" ]; then
INC_FLAGS="-I${DARWIN_CONDA_INCLUDE}"
LIB_FLAGS="-L${DARWIN_CONDA_LIB} -lpython2.7"
elif [ -d "${DARWIN_LOCAL_FRAMEWORK}" ]; then
INC_FLAGS="-F${DARWIN_LOCAL_FRAMEWORK} -I${DARWIN_LOCAL_INCLUDE}"
elif [ -d "${DARWIN_LOCAL_FRAMEWORK}" ] && [ "$(test_framework_version ${DARWIN_LOCAL_FRAMEWORK})" -eq "2" ]; then
INC_FLAGS="-F${DARWIN_LOCAL_FRAMEWORK} -I${DARWIN_LOCAL_FRAMEWORK_INCLUDE}"
LIB_FLAGS="-F${DARWIN_LOCAL_FRAMEWORK} -framework Python"
else
INC_FLAGS="-F${DARWIN_FRAMEWORK} -I${DARWIN_INCLUDE}"
elif [ "$(test_framework_version ${DARWIN_FRAMEWORK})" -eq "2" ]; then
INC_FLAGS="-F${DARWIN_FRAMEWORK} -I${DARWIN_FRAMEWORK_INCLUDE}"
LIB_FLAGS="-F${DARWIN_FRAMEWORK} -framework Python"
elif [ -d "${DARWIN_LOCAL_FRAMEWORK_INCLUDE}" ]; then
INC_FLAGS="-I${DARWIN_LOCAL_FRAMEWORK_INCLUDE} -DWITHOUT_PYTHON_FRAMEWORK"
LIB_FLAGS="-L${DARWIN_LOCAL_FRAMEWORK_LIB} -lpython2.7"
else
INC_FLAGS="-I${DARWIN_LOCAL_INCLUDE} -DWITHOUT_PYTHON_FRAMEWORK"
LIB_FLAGS="-L${DARWIN_LOCAL_LIB} -lpython2.7"
fi
;;
Linux)
......@@ -62,10 +99,10 @@ numpy_flags() {
local PYTHON_EXEC
local INC_FLAGS
if [ -f "/usr/local/bin/python" ]; then
PYTHON_EXEC="/usr/local/bin/python"
if [ -f "/usr/local/bin/python2" ]; then
PYTHON_EXEC="/usr/local/bin/python2"
else
PYTHON_EXEC=$(which python)
PYTHON_EXEC=$(which python2)
fi
INC_FLAGS=$(${PYTHON_EXEC} <<EOF
......
......@@ -9,8 +9,8 @@ import importlib
import pkgutil
__author__ = 'Ingo Heimbach'
__email__ = 'i.heimbach@fz-juelich.de'
__author__ = 'Ingo Meyer'
__email__ = 'i.meyer@fz-juelich.de'
_modules = None
......
......@@ -16,8 +16,8 @@ from .util import command
from .util.binary_replace import binary_replace
__author__ = 'Ingo Heimbach'
__email__ = 'i.heimbach@fz-juelich.de'
__author__ = 'Ingo Meyer'
__email__ = 'i.meyer@fz-juelich.de'
PY_PRE_STARTUP_CONDA_SETUP = '''
......
......@@ -8,8 +8,8 @@ from __future__ import absolute_import
import subprocess
__author__ = 'Ingo Heimbach'
__email__ = 'i.heimbach@fz-juelich.de'
__author__ = 'Ingo Meyer'
__email__ = 'i.meyer@fz-juelich.de'
def exec_cmd(*cmd):
......
......@@ -12,8 +12,8 @@ import re
from .command import exec_cmd
__author__ = 'Ingo Heimbach'
__email__ = 'i.heimbach@fz-juelich.de'
__author__ = 'Ingo Meyer'
__email__ = 'i.meyer@fz-juelich.de'
def extract_dependencies(lib_path, dependency_path_prefix):
......
......@@ -21,8 +21,8 @@ import logging
logging.basicConfig(level=logging.WARNING)
__author__ = 'Ingo Heimbach'
__email__ = 'i.heimbach@fz-juelich.de'
__author__ = 'Ingo Meyer'
__email__ = 'i.meyer@fz-juelich.de'
__version_info__ = (0, 1, 1)
__version__ = '.'.join(map(str, __version_info__))
......
SUBDIRS = computation gui util visualization config core statistics
GRDIR=/usr/local/gr
all:
for i in $(SUBDIRS); do make -C $$i PYLIBPATH=$(PYLIBPATH) EXTRA_LD_FLAGS=$(EXTRA_LD_FLAGS) all; done
EXTRA_LD_FLAGS = -Wl,-rpath,/usr/local/gr/lib
EXTRA_LD_FLAGS = -Wl,-rpath,$(GRDIR)/lib
app_extension_modules: clean all
clean:
......
#ifdef __APPLE__
#if defined(__APPLE__) && !defined(WITHOUT_PYTHON_FRAMEWORK)
#include <Python/Python.h>
#else
#include <Python.h>
......@@ -18,24 +18,24 @@ static PyObject *calculate_domain_centers(PyObject *self, PyObject *args) {
point_t *combined_trans_vecs;
PyObject *domains, *domain_nodes, *node;
point_t node_pos, node_dim;
PyObject *atoms_it;
PyObject *combined_translation_vectors_it;
PyObject *domains_it, *domain_nodes_it;
int i, j;
int x, y, z;
int combined_trans_vecs_count, atom_count;
int min_distance, max_distance, current_distance;
point_t diff;
point_t current_center;
PyObject *centers_list;
if (!PyArg_ParseTuple(args, "OOO", &atoms, &combined_translation_vectors, &domains))
return NULL;
atom_count = PyList_Size(atoms);
atom_pos = malloc(atom_count * sizeof(point_t));
atoms_it = PyObject_GetIter(atoms);
......@@ -46,7 +46,7 @@ static PyObject *calculate_domain_centers(PyObject *self, PyObject *args) {
Py_DECREF(atom);
}
Py_DECREF(atoms_it);
combined_trans_vecs_count = PySequence_Size(combined_translation_vectors) + 1;
combined_trans_vecs = malloc(combined_trans_vecs_count * sizeof(point_t));
combined_trans_vecs[0].x = 0;
......@@ -60,9 +60,9 @@ static PyObject *calculate_domain_centers(PyObject *self, PyObject *args) {
Py_DECREF(combined_translation_vector);
}
Py_DECREF(combined_translation_vectors_it);
centers_list = PyList_New(0);
domains_it = PyObject_GetIter(domains);
while((domain_nodes = PyIter_Next(domains_it))) {
max_distance = -1;
......@@ -100,10 +100,10 @@ static PyObject *calculate_domain_centers(PyObject *self, PyObject *args) {
PyList_Append(centers_list, Py_BuildValue("(iii)", current_center.x, current_center.y, current_center.z));
}
Py_DECREF(domains_it);
free(atom_pos);
free(combined_trans_vecs);
return centers_list;
}
......
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#ifdef __APPLE__
#if defined(__APPLE__) && !defined(WITHOUT_PYTHON_FRAMEWORK)
#include <Python/Python.h>
#else
#include <Python.h>
......@@ -7,7 +7,7 @@
#include <numpy/ndarraytypes.h>
#define IS_EQUIVALENT(a, b) ((!(a) || (b)) && (!(b) || (a)))
#define IS_EQUIVALENT(a, b) ((!(a) || (b)) && (!(b) || (a)))
typedef struct {
int x, y, z;
......@@ -18,7 +18,7 @@ static PyObject *find_index_of_first_element_not_equivalent(PyObject *self, PyOb
int x, y, z;
int done = 0;
point_t pos = {-1, -1, -1};
PyArrayObject *array;
PyArrayObject *mask_array;
int elem, current_elem;
......@@ -27,19 +27,19 @@ static PyObject *find_index_of_first_element_not_equivalent(PyObject *self, PyOb
char *mask;
npy_intp *shape;
npy_intp *data_stride, *mask_stride;
if (!PyArg_ParseTuple(args, "OO", &array, &mask_array))
return NULL;
data = (int *) PyArray_BYTES(array);
mask = (char *) PyArray_BYTES(mask_array);
shape = PyArray_DIMS(array);
data_stride = PyArray_STRIDES(array);
mask_stride = PyArray_STRIDES(mask_array);
elem = *data;
mask_elem = *mask;
for(x = 0; x < shape[0]; ++x) {
for(y = 0; y < shape[1]; ++y) {
for(z = 0; z < shape[2]; ++z) {
......@@ -57,7 +57,7 @@ static PyObject *find_index_of_first_element_not_equivalent(PyObject *self, PyOb
}
if(done) break;
}
return Py_BuildValue("(iii)", pos.x, pos.y, pos.z);
}
......
......@@ -167,7 +167,7 @@ class MainWindow(QtWidgets.QMainWindow):
(('Florian Rhiem', 'f.rhiem@fz-juelich.de'),
('Fabian Beule', 'f.beule@fz-juelich.de'),
('David Knodt', 'd.knodt@fz-juelich.de'),
('Ingo Heimbach', 'i.heimbach@fz-juelich.de'),
('Ingo Meyer', 'i.meyer@fz-juelich.de'),
('Florian Macherey', 'f.macherey@fz-juelich.de'))).show()
def init_submenu_recent_files(self):
......
......@@ -21,7 +21,10 @@ if __name__ == '__main__' and len(sys.argv) > 1 and sys.argv[1] == '--batch':
# use pythonic PyQt api (version 2)
import sip
try:
from PyQt5 import sip
except ImportError:
import sip
API_NAMES = ("QDate", "QDateTime", "QString", "QTextStream", "QTime", "QUrl", "QVariant")
API_VERSION = 2
for name in API_NAMES:
......
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