From b90496bef9fb1e17c157fabb5d225dd03626f445 Mon Sep 17 00:00:00 2001
From: Maxim Gonchar <maxim.mg.gonchar@gmail.com>
Date: Thu, 1 Jun 2023 14:10:47 +0300
Subject: [PATCH] feat: group labels

---
 models/dayabay_v0.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/models/dayabay_v0.py b/models/dayabay_v0.py
index ea01c36..c06259a 100644
--- a/models/dayabay_v0.py
+++ b/models/dayabay_v0.py
@@ -30,7 +30,7 @@ def model_dayabay_v0():
     list_dr_unique = idx_rd.unique_values
     idx_unique = index.unique_values
 
-    close = False
+    close = True
     with Graph(close=close) as graph, storage:
         #
         # Load parameters
@@ -65,6 +65,7 @@ def model_dayabay_v0():
         #
         labels = LoadYaml(datasource/'labels.yaml')
         nodes = storage.child('nodes')
+        inputs = storage.child('inputs')
         outputs = storage.child('outputs')
 
         from dagflow.lib.Array import Array
@@ -80,7 +81,7 @@ def model_dayabay_v0():
         from dagflow.lib.IntegratorGroup import IntegratorGroup
         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)
-        nodes['integrator'] = (integrator:=IntegratorGroup.replicate('2d', replicate=list_dr))
+        integrator=IntegratorGroup.replicate('2d', replicate=list_dr)
         integration_orders_edep >> integrator.inputs["ordersX"]
         integration_orders_costheta >> integrator.inputs["ordersY"]
         outputs['integration.mesh_edep'] = (int_mesh_edep:=integrator.outputs['x'])
@@ -95,11 +96,12 @@ def model_dayabay_v0():
         outputs['ibd'] = ibd.outputs['result']
 
         integrator.print()
-        ibd.outputs['result'] >> integrator
+        ibd.outputs['result'] >> inputs('kinint')
 
     storage('outputs').read_labels(labels)
+    storage('inputs').remove_connected_inputs()
     storage.read_paths()
-    storage.process_indices(idx_unique)
+    # storage.process_indices(idx_unique)
 
     if not close:
         print(storage.to_table(truncate=True))
-- 
GitLab