From 70f604e1aa256414e4e15128724c8ace87fc1d3a Mon Sep 17 00:00:00 2001 From: mieskolainen Date: Wed, 28 Aug 2024 20:10:37 +0000 Subject: [PATCH] deploy: de600fa24b8e8d5c2385361c054aa79a69beb8b7 --- _modules/icenet/tools/process.html | 6 +++--- _modules/icezee/common.html | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/_modules/icenet/tools/process.html b/_modules/icenet/tools/process.html index ddd89760..c2367dc0 100644 --- a/_modules/icenet/tools/process.html +++ b/_modules/icenet/tools/process.html @@ -892,7 +892,7 @@

Source code for icenet.tools.process

     # -------------------------------------------------------------------
     # Technical
     
-    args['__runmode__']         = bool(cli_dict['runmode'])
+    args['__runmode__']         = cli_dict['runmode']
     args['__use_cache__']       = bool(cli_dict['use_cache'])
     args['__compute__']         = bool(cli_dict['compute'])
     args['__raytune_running__'] = False
@@ -918,7 +918,7 @@ 

Source code for icenet.tools.process

     
     # -------------------------------------------------------------------
     # Set random seeds for reproducability and train-validate-test splits
-
+    
     print('')
     print(" torch.__version__: " + torch.__version__)
 
@@ -963,7 +963,7 @@ 

Source code for icenet.tools.process

             print(cli) # for output log
             data = read_data_processed(args=args, func_loader=func_loader,
                     func_factor=func_factor, mvavars=f'configs.{rootname}.mvavars', runmode=runmode)
-            
+
         if args['__compute__']:
             
             if runmode == 'train':
diff --git a/_modules/icezee/common.html b/_modules/icezee/common.html
index e1b06e53..0c9aa7a3 100644
--- a/_modules/icezee/common.html
+++ b/_modules/icezee/common.html
@@ -663,6 +663,14 @@ 

Source code for icezee.common

     #W    = W[rand].squeeze()
     # -------------------------------------------------------------------------
     
+    # -------------------------------------------------------------------------
+    ## Add event weights as an aux variable called `raw_weight` for plots etc.
+    
+    X   = np.hstack((X, W[None].T))
+    ids = ids + ['raw_weight']
+    
+    # -------------------------------------------------------------------------
+    
     ## Print some diagnostics
     print(f'Total number of events: {len(X)}')
     
@@ -752,11 +760,11 @@ 

Source code for icezee.common

     data = io.IceXYW(x=x, y=y, w=w, ids=ids)
 
     # -------------------------------------------------------------------------
-    ### Pick kinematic variables out
+    ### Pick kinematic variables out (note also 'raw_weight')
     data_kin = None
 
     if inputvars.KINEMATIC_VARS is not None:
-        vars       = aux.process_regexp_ids(all_ids=data.ids, ids=inputvars.KINEMATIC_VARS)
+        vars       = aux.process_regexp_ids(all_ids=data.ids, ids=inputvars.KINEMATIC_VARS + ['raw_weight'])
         data_kin   = data[vars]
         data_kin.x = data_kin.x.astype(np.float32)
     
@@ -809,8 +817,6 @@ 

Source code for icezee.common

             # Change the variable name [+ have the same original variables in data_kin]
             data.ids[ind] = f'TRF__{v}'
     
-    # -------------------------------------------------------------------------
-    
     return {'data': data, 'data_MI': data_MI, 'data_kin': data_kin, 'data_deps': data_deps, 'data_tensor': data_tensor, 'data_graph': data_graph}