Commit 2a489298 authored by Philipp Arras's avatar Philipp Arras

Formatting

parent 455439b4
Pipeline #70599 passed with stages
in 17 minutes and 7 seconds
...@@ -482,7 +482,7 @@ class Field(object): ...@@ -482,7 +482,7 @@ class Field(object):
Returns Returns
------- -------
Field Field
The result of the product. The result of the product.
""" """
return self._contraction_helper('prod', spaces) return self._contraction_helper('prod', spaces)
...@@ -649,7 +649,6 @@ class Field(object): ...@@ -649,7 +649,6 @@ class Field(object):
scalar scalar
The result of the operation. The result of the operation.
""" """
from .sugar import sqrt
if self.scalar_weight() is not None: if self.scalar_weight() is not None:
return self._val.std() return self._val.std()
return np.sqrt(self.s_var()) return np.sqrt(self.s_var())
......
...@@ -36,7 +36,7 @@ from ..operators.endomorphic_operator import EndomorphicOperator ...@@ -36,7 +36,7 @@ from ..operators.endomorphic_operator import EndomorphicOperator
from ..operators.harmonic_operators import HarmonicTransformOperator from ..operators.harmonic_operators import HarmonicTransformOperator
from ..operators.linear_operator import LinearOperator from ..operators.linear_operator import LinearOperator
from ..operators.operator import Operator from ..operators.operator import Operator
from ..operators.simple_linear_operators import FieldAdapter, ducktape from ..operators.simple_linear_operators import ducktape
from ..probing import StatCalculator from ..probing import StatCalculator
from ..sugar import full, makeDomain, makeField, makeOp from ..sugar import full, makeDomain, makeField, makeOp
...@@ -410,11 +410,9 @@ class CorrelatedFieldMaker: ...@@ -410,11 +410,9 @@ class CorrelatedFieldMaker:
raise ValueError("length of dofdex needs to match total_N") raise ValueError("length of dofdex needs to match total_N")
if self._total_N > 0: if self._total_N > 0:
space = 1
N = max(dofdex) + 1 N = max(dofdex) + 1
position_space = makeDomain((UnstructuredDomain(N), position_space)) position_space = makeDomain((UnstructuredDomain(N), position_space))
else: else:
space = 0
N = 0 N = 0
position_space = makeDomain(position_space) position_space = makeDomain(position_space)
prefix = str(prefix) prefix = str(prefix)
...@@ -633,9 +631,9 @@ class CorrelatedFieldMaker: ...@@ -633,9 +631,9 @@ class CorrelatedFieldMaker:
space = space + spaces[0] space = space + spaces[0]
sub_spaces = set(spaces) sub_spaces = set(spaces)
sub_spaces.remove(space) sub_spaces.remove(space)
#Domain containing domain[space] and domain[0] iff total_N>0 # Domain containing domain[space] and domain[0] iff total_N>0
sub_dom = makeDomain([samples[0].domain[ind] sub_dom = makeDomain([samples[0].domain[ind]
for ind in (set([0,])-set(spaces))|set([space,])]) for ind in (set([0])-set(spaces)) | set([space])])
co = ContractionOperator(sub_dom, len(sub_dom)-1) co = ContractionOperator(sub_dom, len(sub_dom)-1)
size = co.domain.size/co.target.size size = co.domain.size/co.target.size
res = 0. res = 0.
......
...@@ -148,14 +148,3 @@ class ChainOperator(LinearOperator): ...@@ -148,14 +148,3 @@ class ChainOperator(LinearOperator):
c_inp, t_op = op.simplify_for_constant_input(c_inp) c_inp, t_op = op.simplify_for_constant_input(c_inp)
newop = t_op if newop is None else op(newop) newop = t_op if newop is None else op(newop)
return c_inp, newop return c_inp, newop
# def draw_sample(self, from_inverse=False, dtype=np.float64):
# from ..sugar import from_random
# if len(self._ops) == 1:
# return self._ops[0].draw_sample(from_inverse, dtype)
#
# samp = from_random(random_type="normal", domain=self._domain,
# dtype=dtype)
# for op in self._ops:
# samp = op.process_sample(samp, from_inverse)
# return samp
...@@ -29,7 +29,7 @@ from .operator import Operator ...@@ -29,7 +29,7 @@ from .operator import Operator
from .sampling_enabler import SamplingEnabler from .sampling_enabler import SamplingEnabler
from .sandwich_operator import SandwichOperator from .sandwich_operator import SandwichOperator
from .scaling_operator import ScalingOperator from .scaling_operator import ScalingOperator
from .simple_linear_operators import FieldAdapter, VdotOperator from .simple_linear_operators import VdotOperator
class EnergyOperator(Operator): class EnergyOperator(Operator):
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import numpy as np import numpy as np
from .. import utilities, fft from .. import fft, utilities
from ..domain_tuple import DomainTuple from ..domain_tuple import DomainTuple
from ..domains.gl_space import GLSpace from ..domains.gl_space import GLSpace
from ..domains.lm_space import LMSpace from ..domains.lm_space import LMSpace
...@@ -248,7 +248,6 @@ class SHTOperator(LinearOperator): ...@@ -248,7 +248,6 @@ class SHTOperator(LinearOperator):
def _apply_spherical(self, x, mode): def _apply_spherical(self, x, mode):
axes = x.domain.axes[self._space] axes = x.domain.axes[self._space]
axis = axes[0]
v = x.val v = x.val
p2h = not x.domain[self._space].harmonic p2h = not x.domain[self._space].harmonic
......
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