Commit 0e793273 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'NIFTy_4' into move_multi

parents 344c2c08 0884f5c2
Pipeline #28481 passed with stages
in 2 minutes and 51 seconds
image: docker:stable
image: $CONTAINER_TEST_IMAGE
variables:
CONTAINER_TEST_IMAGE: gitlab-registry.mpcdf.mpg.de/ift/nifty:$CI_BUILD_REF_NAME
......@@ -9,6 +9,7 @@ stages:
- release
build_docker:
image: docker:stable
stage: build_docker
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.mpcdf.mpg.de
......@@ -16,7 +17,6 @@ build_docker:
- docker push $CONTAINER_TEST_IMAGE
test_python2_scalar:
image: $CONTAINER_TEST_IMAGE
stage: test
script:
- python setup.py install --user -f
......@@ -25,28 +25,24 @@ test_python2_scalar:
coverage report | grep TOTAL | awk '{ print "TOTAL: "$6; }'
test_python3_scalar:
image: $CONTAINER_TEST_IMAGE
stage: test
script:
- python3 setup.py install --user -f
- nosetests3 -q
test_python2_mpi:
image: $CONTAINER_TEST_IMAGE
stage: test
script:
- python setup.py install --user -f
- OMP_NUM_THREADS=1 mpiexec -n 2 nosetests -q 2> /dev/null
test_python3_mpi:
image: $CONTAINER_TEST_IMAGE
stage: test
script:
- python3 setup.py install --user -f
- OMP_NUM_THREADS=1 mpiexec -n 2 nosetests3 -q 2> /dev/null
pages:
image: $CONTAINER_TEST_IMAGE
stage: release
script:
- python setup.py install --user -f
......
......@@ -82,6 +82,6 @@ class InversionEnabler(EndomorphicOperator):
def draw_sample(self, from_inverse=False, dtype=np.float64):
try:
return self._op.draw_sample(from_inverse, dtype)
except:
except NotImplementedError:
samp = self._op.draw_sample(not from_inverse, dtype)
return self.inverse_times(samp) if from_inverse else self(samp)
......@@ -50,6 +50,7 @@ class SandwichOperator(EndomorphicOperator):
def draw_sample(self, from_inverse=False, dtype=np.float64):
if from_inverse:
raise ValueError("cannot draw from inverse of this operator")
raise NotImplementedError(
"cannot draw from inverse of this operator")
return self._bun.adjoint_times(
self._cheese.draw_sample(from_inverse, dtype))
......@@ -145,7 +145,8 @@ class SumOperator(LinearOperator):
def draw_sample(self, from_inverse=False, dtype=np.float64):
if from_inverse:
raise ValueError("cannot draw from inverse of this operator")
raise NotImplementedError(
"cannot draw from inverse of this operator")
res = self._ops[0].draw_sample(from_inverse, dtype)
for op in self._ops[1:]:
res += op.draw_sample(from_inverse, dtype)
......
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