Commit 1cc3f5c2 authored by Gordian Edenhofer's avatar Gordian Edenhofer
Browse files

Word non-property `noramlized_ampliudes` active

Since `noramlized_ampliudes` is not a property anymore, name it more
actively as to highlight the need for it to be called as a function.
parent 5036a58e
...@@ -81,7 +81,7 @@ def main(): ...@@ -81,7 +81,7 @@ def main():
cfmaker.set_amplitude_total_offset(0., (1e-2, 1e-6)) cfmaker.set_amplitude_total_offset(0., (1e-2, 1e-6))
correlated_field = cfmaker.finalize() correlated_field = cfmaker.finalize()
normalized_amp = cfmaker.normalized_amplitudes() normalized_amp = cfmaker.get_normalized_amplitudes()
pspec1 = normalized_amp[0]**2 pspec1 = normalized_amp[0]**2
pspec2 = normalized_amp[1]**2 pspec2 = normalized_amp[1]**2
DC = SingleDomain(correlated_field.target, position_space) DC = SingleDomain(correlated_field.target, position_space)
......
...@@ -707,7 +707,7 @@ class CorrelatedFieldMaker: ...@@ -707,7 +707,7 @@ class CorrelatedFieldMaker:
ht = HarmonicTransformOperator(ht.target, ht = HarmonicTransformOperator(ht.target,
self._target_subdomains[i][amp_space], self._target_subdomains[i][amp_space],
space=spaces[i]) @ ht space=spaces[i]) @ ht
a = list(self.normalized_amplitudes()) a = list(self.get_normalized_amplitudes())
for ii in range(n_amplitudes): for ii in range(n_amplitudes):
co = ContractionOperator(hspace, spaces[:ii] + spaces[ii + 1:]) co = ContractionOperator(hspace, spaces[:ii] + spaces[ii + 1:])
pp = a[ii].target[amp_space] pp = a[ii].target[amp_space]
...@@ -758,7 +758,7 @@ class CorrelatedFieldMaker: ...@@ -758,7 +758,7 @@ class CorrelatedFieldMaker:
"""Returns the added fluctuations operators used in the model""" """Returns the added fluctuations operators used in the model"""
return self._a return self._a
def normalized_amplitudes(self): def get_normalized_amplitudes(self):
"""Returns the normalized amplitude operators used in the final model """Returns the normalized amplitude operators used in the final model
The amplitude operators are corrected for the otherwise degenerate The amplitude operators are corrected for the otherwise degenerate
...@@ -798,7 +798,7 @@ class CorrelatedFieldMaker: ...@@ -798,7 +798,7 @@ class CorrelatedFieldMaker:
' no unique set of amplitudes exist because only the', ' no unique set of amplitudes exist because only the',
' relative scale is determined.') ' relative scale is determined.')
raise NotImplementedError(s) raise NotImplementedError(s)
normal_amp = self.normalized_amplitudes()[0] normal_amp = self.get_normalized_amplitudes()[0]
expand = ContractionOperator( expand = ContractionOperator(
normal_amp.target, len(normal_amp.target) - 1 normal_amp.target, len(normal_amp.target) - 1
......
...@@ -142,7 +142,7 @@ def testAmplitudesInvariants(sspace, N): ...@@ -142,7 +142,7 @@ def testAmplitudesInvariants(sspace, N):
assert op.target[-2] == sspace assert op.target[-2] == sspace
assert op.target[-1] == fsspace assert op.target[-1] == fsspace
for ampl in fa.normalized_amplitudes(): for ampl in fa.get_normalized_amplitudes():
ift.extra.check_operator(ampl, 0.1*ift.from_random(ampl.domain), ntries=10) ift.extra.check_operator(ampl, 0.1*ift.from_random(ampl.domain), ntries=10)
ift.extra.check_operator(op, 0.1*ift.from_random(op.domain), ntries=10) ift.extra.check_operator(op, 0.1*ift.from_random(op.domain), ntries=10)
......
Supports Markdown
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