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
1ee4c964
Commit
1ee4c964
authored
1 year ago
by
Maxim Gonchar
Browse files
Options
Downloads
Patches
Plain Diff
draft: use replicated integrator
parent
2677d9c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/dayabay_v0.py
+28
-24
28 additions, 24 deletions
models/dayabay_v0.py
with
28 additions
and
24 deletions
models/dayabay_v0.py
+
28
−
24
View file @
1ee4c964
...
@@ -9,7 +9,7 @@ from gindex import GNIndex
...
@@ -9,7 +9,7 @@ from gindex import GNIndex
from
dagflow.storage
import
NodeStorage
from
dagflow.storage
import
NodeStorage
def
model_dayabay_v0
():
def
model_dayabay_v0
():
storage
=
NodeStorage
(
{},
sep
=
'
.
'
)
storage
=
NodeStorage
()
datasource
=
Path
(
'
data/dayabay-v0
'
)
datasource
=
Path
(
'
data/dayabay-v0
'
)
index
=
GNIndex
.
from_dict
({
index
=
GNIndex
.
from_dict
({
...
@@ -27,7 +27,11 @@ def model_dayabay_v0():
...
@@ -27,7 +27,11 @@ def model_dayabay_v0():
list_dr
=
idx_rd
.
values
list_dr
=
idx_rd
.
values
list_reactors_isotopes
=
idx_ri
.
values
list_reactors_isotopes
=
idx_ri
.
values
with
Graph
(
close
=
True
)
as
graph
,
storage
:
list_dr_unique
=
idx_rd
.
unique_values
idx_unique
=
index
.
unique_values
close
=
False
with
Graph
(
close
=
close
)
as
graph
,
storage
:
#
#
# Load parameters
# Load parameters
#
#
...
@@ -60,8 +64,8 @@ def model_dayabay_v0():
...
@@ -60,8 +64,8 @@ def model_dayabay_v0():
# Create nodes
# Create nodes
#
#
labels
=
LoadYaml
(
datasource
/
'
labels.yaml
'
)
labels
=
LoadYaml
(
datasource
/
'
labels.yaml
'
)
outputs
=
storage
.
child
(
'
outputs
'
)
nodes
=
storage
.
child
(
'
nodes
'
)
nodes
=
storage
.
child
(
'
nodes
'
)
outputs
=
storage
.
child
(
'
outputs
'
)
from
dagflow.lib.Array
import
Array
from
dagflow.lib.Array
import
Array
from
dagflow.lib.View
import
View
from
dagflow.lib.View
import
View
...
@@ -76,30 +80,30 @@ def model_dayabay_v0():
...
@@ -76,30 +80,30 @@ def model_dayabay_v0():
from
dagflow.lib.IntegratorGroup
import
IntegratorGroup
from
dagflow.lib.IntegratorGroup
import
IntegratorGroup
integration_orders_edep
=
Array
.
from_value
(
"
integration.ordersx
"
,
4
,
edges
=
edges_energy_edep
,
label_from
=
labels
)
integration_orders_edep
=
Array
.
from_value
(
"
integration.ordersx
"
,
4
,
edges
=
edges_energy_edep
,
label_from
=
labels
)
integration_orders_costheta
=
Array
.
from_value
(
"
integration.ordersy
"
,
4
,
edges
=
edges_costheta
,
label_from
=
labels
)
integration_orders_costheta
=
Array
.
from_value
(
"
integration.ordersy
"
,
4
,
edges
=
edges_costheta
,
label_from
=
labels
)
nodes
[
'
integrator
'
]
=
(
integrator
:
=
IntegratorGroup
(
'
2d
'
))
nodes
[
'
integrator
'
]
=
(
integrator
:
=
IntegratorGroup
.
replicate
(
'
2d
'
,
replicate
=
list_dr
))
integration_orders_edep
>>
integrator
.
inputs
[
"
ordersX
"
]
integration_orders_edep
>>
integrator
.
inputs
[
"
ordersX
"
]
integration_orders_costheta
>>
integrator
.
inputs
[
"
ordersY
"
]
integration_orders_costheta
>>
integrator
.
inputs
[
"
ordersY
"
]
outputs
[
'
integration.
nod
es_edep
'
]
=
(
int_
nod
es_edep
:
=
integrator
.
outputs
[
'
x
'
])
outputs
[
'
integration.
m
es
h
_edep
'
]
=
(
int_
m
es
h
_edep
:
=
integrator
.
outputs
[
'
x
'
])
outputs
[
'
integration.
nod
es_costheta
'
]
=
(
int_
nod
es_costheta
:
=
integrator
.
outputs
[
'
y
'
])
outputs
[
'
integration.
m
es
h
_costheta
'
]
=
(
int_
m
es
h
_costheta
:
=
integrator
.
outputs
[
'
y
'
])
from
reactornueosc.IBDXsecO1Group
import
IBDXsecO1Group
from
reactornueosc.IBDXsecO1Group
import
IBDXsecO1Group
nodes
[
'
ibd
'
]
=
(
ibd
:
=
IBDXsecO1Group
(
use_edep
=
True
))
nodes
[
'
ibd
'
]
=
(
ibd
:
=
IBDXsecO1Group
(
use_edep
=
True
))
ibd
<<
storage
(
'
parameter.constant.ibd
'
)
ibd
<<
storage
(
'
parameter.constant.ibd
'
)
ibd
<<
storage
(
'
parameter.constant.ibd.csc
'
)
ibd
<<
storage
(
'
parameter.constant.ibd.csc
'
)
int_
nod
es_edep
>>
ibd
.
inputs
[
'
edep
'
]
int_
m
es
h
_edep
>>
ibd
.
inputs
[
'
edep
'
]
int_
nod
es_costheta
>>
ibd
.
inputs
[
'
costheta
'
]
int_
m
es
h
_costheta
>>
ibd
.
inputs
[
'
costheta
'
]
outputs
[
'
ibd
'
]
=
ibd
.
outputs
[
'
result
'
]
outputs
[
'
ibd
'
]
=
ibd
.
outputs
[
'
result
'
]
integrator
.
print
()
ibd
.
outputs
[
'
result
'
]
>>
integrator
ibd
.
outputs
[
'
result
'
]
>>
integrator
outputs
[
'
kinint
'
]
=
integrator
.
outputs
[
'
output
'
]
storage
(
'
outputs
'
).
read_labels
(
labels
)
storage
(
'
outputs
'
).
read_labels
(
labels
)
storage
.
read_paths
()
storage
.
read_paths
()
storage
.
process_indices
(
idx_unique
)
from
mpl_toolkits.mplot3d
import
axes3d
if
not
close
:
from
matplotlib.pyplot
import
subplots
print
(
storage
.
to_table
(
truncate
=
True
))
subplots
(
1
,
1
,
subplot_kw
=
{
'
projection
'
:
'
3d
'
})
return
plot_auto
(
storage
[
'
outputs.kinint
'
],
method
=
'
bar3d
'
)
storage
(
'
outputs
'
).
plot
(
show_all
=
True
)
storage
(
'
outputs
'
).
plot
(
show_all
=
True
)
...
@@ -115,17 +119,17 @@ def model_dayabay_v0():
...
@@ -115,17 +119,17 @@ def model_dayabay_v0():
print
(
'
Everything
'
)
print
(
'
Everything
'
)
print
(
storage
.
to_table
(
truncate
=
True
))
print
(
storage
.
to_table
(
truncate
=
True
))
print
(
'
Constants
'
)
#
print('Constants')
print
(
storage
(
'
parameter.constant
'
).
to_table
(
truncate
=
True
))
#
print(storage('parameter.constant').to_table(truncate=True))
#
print
(
'
Constrained
'
)
#
print('Constrained')
print
(
constrained
.
to_table
(
truncate
=
True
))
#
print(constrained.to_table(truncate=True))
#
print
(
'
Normalized
'
)
#
print('Normalized')
print
(
normalized
.
to_table
(
truncate
=
True
))
#
print(normalized.to_table(truncate=True))
#
print
(
'
Stat
'
)
#
print('Stat')
print
(
storage
(
'
stat
'
).
to_table
(
truncate
=
True
))
#
print(storage('stat').to_table(truncate=True))
# print('Parameters (latex)')
# print('Parameters (latex)')
# print(storage['parameter'].to_latex())
# print(storage['parameter'].to_latex())
...
...
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