Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frtrglib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Bruch
frtrglib
Commits
69bec4ec
Commit
69bec4ec
authored
Jun 20, 2022
by
Valentin Bruch
Browse files
Options
Downloads
Patches
Plain Diff
bug fix in data management; allow log scale parameter swipes
parent
5e46b604
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
data_management.py
+5
-1
5 additions, 1 deletion
data_management.py
gen_data.py
+18
-2
18 additions, 2 deletions
gen_data.py
with
23 additions
and
3 deletions
data_management.py
+
5
−
1
View file @
69bec4ec
...
@@ -79,7 +79,11 @@ class KondoExport:
...
@@ -79,7 +79,11 @@ class KondoExport:
else
:
else
:
method
=
'
mu
'
method
=
'
mu
'
solver_flags
=
0
solver_flags
=
0
# TODO: use solver_flags
try
:
if
self
.
kondo
.
simplified_initial_conditions
:
solver_flags
|=
DataManager
.
SOLVER_FLAGS
[
"
simplified_initial_conditions
"
]
except
AttributeError
:
pass
return
dict
(
return
dict
(
hash
=
self
.
hash
,
hash
=
self
.
hash
,
omega
=
self
.
kondo
.
omega
,
omega
=
self
.
kondo
.
omega
,
...
...
This diff is collapsed.
Click to expand it.
gen_data.py
+
18
−
2
View file @
69bec4ec
...
@@ -17,6 +17,7 @@ import numpy as np
...
@@ -17,6 +17,7 @@ import numpy as np
def
gen_option_iter
(
options
,
verbose
=
False
):
def
gen_option_iter
(
options
,
verbose
=
False
):
steps
=
options
.
pop
(
"
steps
"
)
steps
=
options
.
pop
(
"
steps
"
)
scales
=
options
.
pop
(
"
scale
"
)
iter_variables
=
{}
iter_variables
=
{}
if
steps
is
None
:
if
steps
is
None
:
max_length
=
1
max_length
=
1
...
@@ -35,17 +36,31 @@ def gen_option_iter(options, verbose=False):
...
@@ -35,17 +36,31 @@ def gen_option_iter(options, verbose=False):
options
.
pop
(
key
)
options
.
pop
(
key
)
steps
=
[
max_length
]
steps
=
[
max_length
]
else
:
else
:
if
isinstance
(
scales
,
str
):
scales
=
len
(
steps
)
*
[
scales
]
if
len
(
scales
)
==
1
:
scales
*=
len
(
steps
)
for
key
,
value
in
options
.
items
():
for
key
,
value
in
options
.
items
():
if
type
(
value
)
!=
list
or
key
==
"
fourier_coef
"
:
if
type
(
value
)
!=
list
or
key
==
"
fourier_coef
"
:
continue
continue
if
len
(
value
)
==
1
:
if
len
(
value
)
==
1
:
options
[
key
],
=
value
options
[
key
],
=
value
elif
len
(
value
)
==
2
:
elif
len
(
value
)
==
2
:
if
scales
[
0
]
in
(
"
lin
"
,
"
linear
"
):
iter_variables
[
key
]
=
(
0
,
np
.
linspace
(
value
[
0
],
value
[
1
],
steps
[
0
]))
iter_variables
[
key
]
=
(
0
,
np
.
linspace
(
value
[
0
],
value
[
1
],
steps
[
0
]))
elif
scales
[
0
]
==
"
log
"
:
iter_variables
[
key
]
=
(
0
,
np
.
logspace
(
np
.
log10
(
value
[
0
]),
np
.
log10
(
value
[
1
]),
steps
[
0
]))
else
:
raise
ValueError
(
"
Unexpected value for parameters
\"
scales
\"
: %s
"
%
scales
[
0
])
elif
len
(
value
)
==
3
:
elif
len
(
value
)
==
3
:
dim
=
round
(
value
[
2
])
dim
=
round
(
value
[
2
])
assert
0
<=
dim
<
len
(
steps
)
assert
0
<=
dim
<
len
(
steps
)
if
scales
[
dim
]
in
(
"
lin
"
,
"
linear
"
):
iter_variables
[
key
]
=
(
dim
,
np
.
linspace
(
value
[
0
],
value
[
1
],
steps
[
dim
]))
iter_variables
[
key
]
=
(
dim
,
np
.
linspace
(
value
[
0
],
value
[
1
],
steps
[
dim
]))
elif
scales
[
dim
]
==
"
log
"
:
iter_variables
[
key
]
=
(
dim
,
np
.
logspace
(
np
.
log10
(
value
[
0
]),
np
.
log10
(
value
[
1
]),
steps
[
dim
]))
else
:
raise
ValueError
(
"
Unexpected value for parameters
\"
scales
\"
: %s
"
%
scales
[
dim
])
else
:
else
:
raise
ValueError
(
"
Array parameters must be of the form (start, stop, dim)
"
)
raise
ValueError
(
"
Array parameters must be of the form (start, stop, dim)
"
)
for
key
in
iter_variables
.
keys
():
for
key
in
iter_variables
.
keys
():
...
@@ -64,6 +79,7 @@ def main():
...
@@ -64,6 +79,7 @@ def main():
"""
"""
parser
=
argparse
.
ArgumentParser
(
description
=
main
.
__doc__
)
parser
=
argparse
.
ArgumentParser
(
description
=
main
.
__doc__
)
parser
.
add_argument
(
"
--steps
"
,
type
=
int
,
nargs
=
'
+
'
,
help
=
"
Number of steps
"
)
parser
.
add_argument
(
"
--steps
"
,
type
=
int
,
nargs
=
'
+
'
,
help
=
"
Number of steps
"
)
parser
.
add_argument
(
"
--scale
"
,
type
=
str
,
nargs
=
'
+
'
,
default
=
"
linear
"
,
choices
=
(
"
linear
"
,
"
log
"
),
help
=
"
Scale used for swipes
"
)
parser
.
add_argument
(
"
--save
"
,
type
=
str
,
default
=
"
all
"
,
choices
=
(
"
all
"
,
"
reduced
"
,
"
observables
"
,
"
minimal
"
),
help
=
"
What to save
"
)
parser
.
add_argument
(
"
--save
"
,
type
=
str
,
default
=
"
all
"
,
choices
=
(
"
all
"
,
"
reduced
"
,
"
observables
"
,
"
minimal
"
),
help
=
"
What to save
"
)
parser
.
add_argument
(
"
--threads
"
,
type
=
int
,
default
=
4
,
help
=
"
Number parallel processes
"
)
parser
.
add_argument
(
"
--threads
"
,
type
=
int
,
default
=
4
,
help
=
"
Number parallel processes
"
)
parser
.
add_argument
(
"
--method
"
,
type
=
str
,
required
=
True
,
choices
=
(
'
J
'
,
'
mu
'
),
help
=
"
method: J or mu
"
)
parser
.
add_argument
(
"
--method
"
,
type
=
str
,
required
=
True
,
choices
=
(
'
J
'
,
'
mu
'
),
help
=
"
method: J or mu
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment