Commit 641e1576 authored by Martin Reinecke's avatar Martin Reinecke

PEP8

parent 848a7b66
......@@ -74,7 +74,7 @@ class LineEnergy(object):
self._line_position = float(line_position)
self._line_direction = line_direction
if self._line_position==float(offset):
if self._line_position == float(offset):
self.energy = energy
else:
pos = energy.position \
......@@ -116,6 +116,6 @@ class LineEnergy(object):
def directional_derivative(self):
res = self.energy.gradient.vdot(self.line_direction)
if abs(res.imag) / max(abs(res.real), 1.) > 1e-12:
print ("directional derivative has non-negligible "
print("directional derivative has non-negligible "
"imaginary part:", res)
return res.real
......@@ -109,11 +109,11 @@ class CriticalPowerEnergy(Energy):
@property
def w(self):
if self._w is None:
#self.logger.info("Initializing w")
# self.logger.info("Initializing w")
w = Field(domain=self.position.domain, val=0., dtype=self.m.dtype)
if self.D is not None:
for i in range(self.samples):
#self.logger.info("Drawing sample %i" % i)
# self.logger.info("Drawing sample %i" % i)
posterior_sample = generate_posterior_sample(
self.m, self.D)
projected_sample = posterior_sample.power_analyze(
......
from ...operators import EndomorphicOperator,\
InvertibleOperatorMixin
class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
"""The curvature of the WienerFilterEnergy.
......@@ -27,9 +28,8 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
self.N = N
self.S = S
self._domain = self.S.domain
super(WienerFilterCurvature, self).__init__(
inverter=inverter,
**kwargs)
super(WienerFilterCurvature, self).__init__(inverter=inverter,
**kwargs)
@property
def domain(self):
......
......@@ -75,7 +75,7 @@ class Prober(object):
def probing_run(self, callee):
""" controls the generation, evaluation and finalization of probes """
self.reset()
if self._ncpu==1:
if self._ncpu == 1:
for index in range(self.probe_count):
current_probe = self.get_probe(index)
pre_result = self.process_probe(callee, current_probe, index)
......@@ -89,7 +89,8 @@ class Prober(object):
from pathos.multiprocessing import ProcessingPool as Pool
pool = Pool(ncpus=self._ncpu)
pre_results = pool.map(self.evaluate_probe_parallel, callee, probes)
pre_results = pool.map(self.evaluate_probe_parallel, callee,
probes)
for ii in xrange(self.probe_count):
self.finish_probe(probes[ii], pre_results[ii])
......
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