Skip to content
Snippets Groups Projects

Downgrade f-strings to good old format strings

Merged Gordian Edenhofer requested to merge nifty6_no_f_strings into NIFTy_6
1 file
+ 6
6
Compare changes
  • Side-by-side
  • Inline
@@ -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 = ()
Loading