Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dayabay-model
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dayabay-data-preservation
dayabay-model
Commits
9b4db6b4
Commit
9b4db6b4
authored
1 year ago
by
Maxim Gonchar
Browse files
Options
Downloads
Patches
Plain Diff
feat: plot(show, close) options
parent
b6868715
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
model_tools/parameters_storage.py
+15
-2
15 additions, 2 deletions
model_tools/parameters_storage.py
models/dayabay_v0.py
+1
-3
1 addition, 3 deletions
models/dayabay_v0.py
with
16 additions
and
5 deletions
model_tools/parameters_storage.py
+
15
−
2
View file @
9b4db6b4
...
...
@@ -28,13 +28,26 @@ class ParametersStorage(NestedMKDict):
key
=
'
.
'
.
join
(
key
)
labels
.
setdefault
(
'
paths
'
,
[]).
append
(
key
)
def
plot
(
self
)
->
None
:
def
plot
(
self
,
*
args
,
close
:
bool
=
True
,
show
:
bool
=
True
,
**
kwargs
)
->
None
:
from
dagflow.plot
import
plot_auto
if
close
:
from
matplotlib.pyplot
import
close
if
show
:
from
matplotlib.pyplot
import
show
for
key
,
value
in
self
.
walkitems
():
if
not
isinstance
(
value
,
Output
):
continue
plot_auto
(
value
)
plot_auto
(
value
,
*
args
,
**
kwargs
)
if
show
:
show
()
if
close
:
close
()
def
to_list
(
self
,
**
kwargs
)
->
list
:
return
self
.
visit
(
ParametersVisitor
(
kwargs
)).
data_list
...
...
This diff is collapsed.
Click to expand it.
models/dayabay_v0.py
+
1
−
3
View file @
9b4db6b4
from
dagflow.bundles.load_parameters
import
load_parameters
from
pathlib
import
Path
from
matplotlib.pyplot
import
show
from
dagflow.graph
import
Graph
from
dagflow.graphviz
import
savegraph
...
...
@@ -63,8 +62,7 @@ def model_dayabay_v0():
outputs
[
'
edges.energy_common
'
]
=
(
energy_edges
:
=
Array
(
"
energy_edges
"
,
linspace
(
0
,
12
,
241
)).
outputs
[
0
])
storage
.
read_paths
()
storage
(
'
outputs
'
).
plot
()
show
()
storage
(
'
outputs
'
).
plot
(
close
=
False
,
show
=
True
)
storage
[
'
parameter.normalized.detector.eres.b_stat
'
].
value
=
1
storage
[
'
parameter.normalized.detector.eres.a_nonuniform
'
].
value
=
2
...
...
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