Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
d6af3750
Commit
d6af3750
authored
Dec 05, 2019
by
Gordian Edenhofer
Browse files
Downgrade f-strings to good old format strings
parent
4ca56a07
Pipeline
#65021
passed with stages
in 8 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/library/correlated_fields.py
View file @
d6af3750
...
...
@@ -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
=
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment