Commit bbfd80cb authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'nifty6_no_f_strings' into 'NIFTy_6'

Downgrade f-strings to good old format strings

See merge request !390
parents 4ca56a07 d6af3750
Pipeline #65028 passed with stages
in 10 minutes and 2 seconds
......@@ -52,9 +52,9 @@ def _lognormal_moments(mean, sig, N=0):
else:
mean, sig = (_reshaper(param, N) for param in (mean, sig))
if not np.all(mean > 0):
raise ValueError(f"mean must be greater 0; got {mean!r}")
raise ValueError("mean must be greater 0; got {!r}".format(mean))
if not np.all(sig > 0):
raise ValueError(f"sig must be greater 0; got {sig!r}")
raise ValueError("sig must be greater 0; got {!r}".format(sig))
logsig = np.sqrt(np.log((sig/mean)**2 + 1))
logmean = np.log(mean) - logsig**2/2
......@@ -554,7 +554,7 @@ class CorrelatedFieldMaker:
if len(self._a) == 0:
raise NotImplementedError
if space >= len(self._a):
raise ValueError(f"invalid space specified; got {space!r}")
raise ValueError("invalid space specified; got {!r}".format(space))
if len(self._a) == 1:
return self.average_fluctuation(0)
q = 1.
......@@ -571,7 +571,7 @@ class CorrelatedFieldMaker:
if len(self._a) == 0:
raise NotImplementedError
if space >= len(self._a):
raise ValueError(f"invalid space specified; got {space!r}")
raise ValueError("invalid space specified; got {!r}".format(space))
if len(self._a) == 1:
return self._a[0].fluctuation_amplitude
return self._a[space].fluctuation_amplitude
......@@ -593,7 +593,7 @@ class CorrelatedFieldMaker:
space) realizations."""
ldom = len(samples[0].domain)
if space >= ldom:
raise ValueError(f"invalid space specified; got {space!r}")
raise ValueError("invalid space specified; got {!r}".format(space))
if ldom == 1:
return _total_fluctuation_realized(samples)
res1, res2 = 0., 0.
......@@ -611,7 +611,7 @@ class CorrelatedFieldMaker:
space) realizations."""
ldom = len(samples[0].domain)
if space >= ldom:
raise ValueError(f"invalid space specified; got {space!r}")
raise ValueError("invalid space specified; got {!r}".format(space))
if ldom == 1:
return _total_fluctuation_realized(samples)
spaces = ()
......
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