From 77a16e2d6f5d808fc14cde2c1af65cae3855f837 Mon Sep 17 00:00:00 2001 From: Chiara Liotta <liotta@astron.nl> Date: Mon, 10 Mar 2025 12:27:38 +0100 Subject: [PATCH] evaluate coupling --- history_percent.csv | 38 +++++++++++++++ history_ratios.csv | 38 --------------- main.py | 61 ++++++++++++++----------- metric_evaluation/change_impact_eval.py | 51 +++++++++++++++++++++ process_gitlab/process_history.py | 11 +++-- 5 files changed, 130 insertions(+), 69 deletions(-) create mode 100644 history_percent.csv delete mode 100644 history_ratios.csv create mode 100644 metric_evaluation/change_impact_eval.py diff --git a/history_percent.csv b/history_percent.csv new file mode 100644 index 0000000..813b7c8 --- /dev/null +++ b/history_percent.csv @@ -0,0 +1,38 @@ +,RD\LINC\steps\Ateamclipper.cwl,RD\LINC\steps\H5ParmCollector.cwl,RD\LINC\steps\LoSoTo.Faraday.cwl,RD\LINC\steps\LoSoTo.Plot.cwl,RD\LINC\steps\LoSoTo.Reset.cwl,RD\LINC\steps\add_missing_stations.cwl,RD\LINC\steps\compare_station_list.cwl,RD\LINC\steps\concatenate_files.cwl,RD\LINC\steps\ddecal.cwl,RD\LINC\steps\ddecal_array.cwl,RD\LINC\steps\dp3concat.cwl,RD\LINC\steps\filter_ms_group.cwl,RD\LINC\steps\filter_predict.cwl,RD\LINC\steps\plot_Ateamclipper.cwl,RD\LINC\workflows\HBA_calibrator.cwl,RD\LINC\workflows\HBA_target.cwl,RD\LINC\workflows\LBA_calibrator.cwl,RD\LINC\workflows\LBA_target.cwl,RD\LINC\workflows\linc_calibrator.cwl,RD\LINC\workflows\linc_calibrator\apply_calibrate_bp.cwl,RD\LINC\workflows\linc_calibrator\apply_calibrate_fr.cwl,RD\LINC\workflows\linc_calibrator\apply_pa.cwl,RD\LINC\workflows\linc_calibrator\faraday_rotation.cwl,RD\LINC\workflows\linc_calibrator\fr.cwl,RD\LINC\workflows\linc_calibrator\pa.cwl,RD\LINC\workflows\linc_calibrator\predict_calibrate.cwl,RD\LINC\workflows\linc_calibrator\prep.cwl,RD\LINC\workflows\linc_calibrator\prep_fr.cwl,RD\LINC\workflows\linc_target.cwl,RD\LINC\workflows\linc_target\apply_calibrate_tec.cwl,RD\LINC\workflows\linc_target\calib_targ.cwl,RD\LINC\workflows\linc_target\finalize.cwl,RD\LINC\workflows\linc_target\fr.cwl,RD\LINC\workflows\linc_target\gsmcal.cwl,RD\LINC\workflows\linc_target\predict_calibrate_fr.cwl,RD\LINC\workflows\linc_target\selfcal_targ_hba.cwl,RD\LINC\workflows\linc_target\selfcal_targ_lba.cwl +RD\LINC\steps\Ateamclipper.cwl,100.0,100.0,0.0,0.0,0.0,100.0,0.0,100.0,7.142857142857142,25.0,0.0,0.0,100.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,25.0,0.0,16.666666666666664,0.0 +RD\LINC\steps\H5ParmCollector.cwl,100.0,100.0,0.0,0.0,0.0,100.0,0.0,100.0,7.142857142857142,25.0,0.0,0.0,100.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,25.0,0.0,16.666666666666664,0.0 +RD\LINC\steps\LoSoTo.Faraday.cwl,0.0,0.0,100.0,80.0,100.0,0.0,20.0,0.0,35.714285714285715,12.5,9.090909090909092,0.0,0.0,0.0,60.0,0.0,60.0,0.0,37.5,16.666666666666664,66.66666666666666,66.66666666666666,57.14285714285714,42.857142857142854,21.73913043478261,16.666666666666664,20.0,37.5,0.0,0.0,0.0,0.0,42.857142857142854,0.0,50.0,0.0,60.0 +RD\LINC\steps\LoSoTo.Plot.cwl,0.0,0.0,80.0,100.0,80.0,0.0,0.0,0.0,28.57142857142857,0.0,0.0,0.0,0.0,0.0,75.0,0.0,75.0,0.0,42.857142857142854,0.0,50.0,80.0,42.857142857142854,50.0,17.391304347826086,0.0,0.0,42.857142857142854,0.0,0.0,0.0,0.0,50.0,0.0,60.0,0.0,75.0 +RD\LINC\steps\LoSoTo.Reset.cwl,0.0,0.0,100.0,80.0,100.0,0.0,20.0,0.0,35.714285714285715,12.5,9.090909090909092,0.0,0.0,0.0,60.0,0.0,60.0,0.0,37.5,16.666666666666664,66.66666666666666,66.66666666666666,57.14285714285714,42.857142857142854,21.73913043478261,16.666666666666664,20.0,37.5,0.0,0.0,0.0,0.0,42.857142857142854,0.0,50.0,0.0,60.0 +RD\LINC\steps\add_missing_stations.cwl,100.0,100.0,0.0,0.0,0.0,100.0,0.0,100.0,7.142857142857142,25.0,0.0,0.0,100.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,25.0,0.0,16.666666666666664,0.0 +RD\LINC\steps\compare_station_list.cwl,0.0,0.0,20.0,0.0,20.0,0.0,100.0,0.0,7.142857142857142,25.0,14.285714285714285,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,50.0,20.0,0.0,16.666666666666664,0.0,4.3478260869565215,50.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +RD\LINC\steps\concatenate_files.cwl,100.0,100.0,0.0,0.0,0.0,100.0,0.0,100.0,7.142857142857142,25.0,0.0,0.0,100.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,25.0,0.0,16.666666666666664,0.0 +RD\LINC\steps\ddecal.cwl,7.142857142857142,7.142857142857142,35.714285714285715,28.57142857142857,35.714285714285715,7.142857142857142,7.142857142857142,7.142857142857142,100.0,28.57142857142857,16.666666666666664,7.142857142857142,7.142857142857142,7.142857142857142,21.428571428571427,0.0,21.428571428571427,0.0,33.33333333333333,14.285714285714285,35.714285714285715,35.714285714285715,25.0,18.75,48.0,14.285714285714285,7.142857142857142,25.0,0.0,0.0,0.0,0.0,18.75,5.88235294117647,20.0,11.11111111111111,21.428571428571427 +RD\LINC\steps\ddecal_array.cwl,25.0,25.0,12.5,0.0,12.5,25.0,25.0,25.0,28.57142857142857,100.0,10.0,0.0,25.0,25.0,0.0,0.0,0.0,0.0,0.0,50.0,28.57142857142857,0.0,11.11111111111111,0.0,12.5,50.0,25.0,0.0,0.0,0.0,0.0,0.0,0.0,14.285714285714285,0.0,25.0,0.0 +RD\LINC\steps\dp3concat.cwl,0.0,0.0,9.090909090909092,0.0,9.090909090909092,0.0,14.285714285714285,0.0,16.666666666666664,10.0,100.0,14.285714285714285,0.0,0.0,0.0,0.0,0.0,0.0,0.0,12.5,9.090909090909092,9.090909090909092,8.333333333333332,0.0,15.384615384615385,12.5,14.285714285714285,8.333333333333332,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +RD\LINC\steps\filter_ms_group.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,7.142857142857142,0.0,14.285714285714285,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,20.0,0.0,0.0,4.3478260869565215,0.0,0.0,16.666666666666664,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +RD\LINC\steps\filter_predict.cwl,100.0,100.0,0.0,0.0,0.0,100.0,0.0,100.0,7.142857142857142,25.0,0.0,0.0,100.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,25.0,0.0,16.666666666666664,0.0 +RD\LINC\steps\plot_Ateamclipper.cwl,100.0,100.0,0.0,0.0,0.0,100.0,0.0,100.0,7.142857142857142,25.0,0.0,0.0,100.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,25.0,0.0,16.666666666666664,0.0 +RD\LINC\workflows\HBA_calibrator.cwl,0.0,0.0,60.0,75.0,60.0,0.0,0.0,0.0,21.428571428571427,0.0,0.0,0.0,0.0,0.0,100.0,0.0,100.0,0.0,50.0,0.0,60.0,60.0,50.0,60.0,13.043478260869565,0.0,0.0,50.0,0.0,0.0,0.0,0.0,60.0,0.0,75.0,0.0,100.0 +RD\LINC\workflows\HBA_target.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,100.0,0.0,0.0,50.0,0.0,50.0,0.0,14.285714285714285,0.0 +RD\LINC\workflows\LBA_calibrator.cwl,0.0,0.0,60.0,75.0,60.0,0.0,0.0,0.0,21.428571428571427,0.0,0.0,0.0,0.0,0.0,100.0,0.0,100.0,0.0,50.0,0.0,60.0,60.0,50.0,60.0,13.043478260869565,0.0,0.0,50.0,0.0,0.0,0.0,0.0,60.0,0.0,75.0,0.0,100.0 +RD\LINC\workflows\LBA_target.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +RD\LINC\workflows\linc_calibrator.cwl,0.0,0.0,37.5,42.857142857142854,37.5,0.0,0.0,0.0,33.33333333333333,0.0,0.0,0.0,0.0,0.0,50.0,0.0,50.0,0.0,100.0,0.0,37.5,37.5,33.33333333333333,57.14285714285714,26.08695652173913,0.0,0.0,33.33333333333333,0.0,0.0,0.0,0.0,37.5,0.0,42.857142857142854,0.0,50.0 +RD\LINC\workflows\linc_calibrator\apply_calibrate_bp.cwl,0.0,0.0,16.666666666666664,0.0,16.666666666666664,0.0,50.0,0.0,14.285714285714285,50.0,12.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,100.0,16.666666666666664,0.0,14.285714285714285,0.0,8.695652173913043,33.33333333333333,50.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +RD\LINC\workflows\linc_calibrator\apply_calibrate_fr.cwl,0.0,0.0,66.66666666666666,50.0,66.66666666666666,0.0,20.0,0.0,35.714285714285715,28.57142857142857,9.090909090909092,0.0,0.0,0.0,60.0,0.0,60.0,0.0,37.5,16.666666666666664,100.0,42.857142857142854,57.14285714285714,42.857142857142854,21.73913043478261,40.0,20.0,37.5,0.0,0.0,0.0,0.0,42.857142857142854,0.0,50.0,10.0,60.0 +RD\LINC\workflows\linc_calibrator\apply_pa.cwl,0.0,0.0,66.66666666666666,80.0,66.66666666666666,0.0,0.0,0.0,35.714285714285715,0.0,9.090909090909092,20.0,0.0,0.0,60.0,0.0,60.0,0.0,37.5,0.0,42.857142857142854,100.0,37.5,42.857142857142854,21.73913043478261,0.0,0.0,57.14285714285714,0.0,0.0,0.0,0.0,42.857142857142854,0.0,50.0,0.0,60.0 +RD\LINC\workflows\linc_calibrator\faraday_rotation.cwl,0.0,0.0,57.14285714285714,42.857142857142854,57.14285714285714,0.0,16.666666666666664,0.0,25.0,11.11111111111111,8.333333333333332,0.0,0.0,0.0,50.0,0.0,50.0,0.0,33.33333333333333,14.285714285714285,57.14285714285714,37.5,100.0,57.14285714285714,20.833333333333336,14.285714285714285,16.666666666666664,33.33333333333333,0.0,0.0,0.0,0.0,57.14285714285714,0.0,42.857142857142854,0.0,50.0 +RD\LINC\workflows\linc_calibrator\fr.cwl,0.0,0.0,42.857142857142854,50.0,42.857142857142854,0.0,0.0,0.0,18.75,0.0,0.0,0.0,0.0,0.0,60.0,0.0,60.0,0.0,57.14285714285714,0.0,42.857142857142854,42.857142857142854,57.14285714285714,100.0,21.73913043478261,0.0,0.0,37.5,0.0,0.0,0.0,0.0,42.857142857142854,0.0,50.0,0.0,60.0 +RD\LINC\workflows\linc_calibrator\pa.cwl,0.0,0.0,21.73913043478261,17.391304347826086,21.73913043478261,0.0,4.3478260869565215,0.0,48.0,12.5,15.384615384615385,4.3478260869565215,0.0,0.0,13.043478260869565,0.0,13.043478260869565,0.0,26.08695652173913,8.695652173913043,21.73913043478261,21.73913043478261,20.833333333333336,21.73913043478261,100.0,8.695652173913043,4.3478260869565215,20.833333333333336,0.0,0.0,0.0,0.0,12.0,0.0,12.5,3.571428571428571,13.043478260869565 +RD\LINC\workflows\linc_calibrator\predict_calibrate.cwl,0.0,0.0,16.666666666666664,0.0,16.666666666666664,0.0,50.0,0.0,14.285714285714285,50.0,12.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,33.33333333333333,40.0,0.0,14.285714285714285,0.0,8.695652173913043,100.0,50.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,14.285714285714285,0.0 +RD\LINC\workflows\linc_calibrator\prep.cwl,0.0,0.0,20.0,0.0,20.0,0.0,100.0,0.0,7.142857142857142,25.0,14.285714285714285,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,50.0,20.0,0.0,16.666666666666664,0.0,4.3478260869565215,50.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +RD\LINC\workflows\linc_calibrator\prep_fr.cwl,0.0,0.0,37.5,42.857142857142854,37.5,0.0,0.0,0.0,25.0,0.0,8.333333333333332,16.666666666666664,0.0,0.0,50.0,0.0,50.0,0.0,33.33333333333333,0.0,37.5,57.14285714285714,33.33333333333333,37.5,20.833333333333336,0.0,0.0,100.0,0.0,0.0,0.0,0.0,37.5,0.0,42.857142857142854,0.0,50.0 +RD\LINC\workflows\linc_target.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,100.0,0.0,0.0,50.0,0.0,50.0,0.0,14.285714285714285,0.0 +RD\LINC\workflows\linc_target\apply_calibrate_tec.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,100.0,100.0,0.0,0.0,0.0,25.0,0.0,0.0 +RD\LINC\workflows\linc_target\calib_targ.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,100.0,100.0,0.0,0.0,0.0,25.0,0.0,0.0 +RD\LINC\workflows\linc_target\finalize.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,50.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,50.0,0.0,0.0,100.0,0.0,25.0,0.0,16.666666666666664,0.0 +RD\LINC\workflows\linc_target\fr.cwl,0.0,0.0,42.857142857142854,50.0,42.857142857142854,0.0,0.0,0.0,18.75,0.0,0.0,0.0,0.0,0.0,60.0,0.0,60.0,0.0,37.5,0.0,42.857142857142854,42.857142857142854,57.14285714285714,42.857142857142854,12.0,0.0,0.0,37.5,0.0,0.0,0.0,0.0,100.0,0.0,50.0,0.0,60.0 +RD\LINC\workflows\linc_target\gsmcal.cwl,25.0,25.0,0.0,0.0,0.0,25.0,0.0,25.0,5.88235294117647,14.285714285714285,0.0,0.0,25.0,25.0,0.0,50.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,50.0,0.0,0.0,25.0,0.0,100.0,0.0,25.0,0.0 +RD\LINC\workflows\linc_target\predict_calibrate_fr.cwl,0.0,0.0,50.0,60.0,50.0,0.0,0.0,0.0,20.0,0.0,0.0,0.0,0.0,0.0,75.0,0.0,75.0,0.0,42.857142857142854,0.0,50.0,50.0,42.857142857142854,50.0,12.5,0.0,0.0,42.857142857142854,0.0,25.0,25.0,0.0,50.0,0.0,100.0,0.0,75.0 +RD\LINC\workflows\linc_target\selfcal_targ_hba.cwl,16.666666666666664,16.666666666666664,0.0,0.0,0.0,16.666666666666664,0.0,16.666666666666664,11.11111111111111,25.0,0.0,0.0,16.666666666666664,16.666666666666664,0.0,14.285714285714285,0.0,0.0,0.0,0.0,10.0,0.0,0.0,0.0,3.571428571428571,14.285714285714285,0.0,0.0,14.285714285714285,0.0,0.0,16.666666666666664,0.0,25.0,0.0,100.0,0.0 +RD\LINC\workflows\linc_target\selfcal_targ_lba.cwl,0.0,0.0,60.0,75.0,60.0,0.0,0.0,0.0,21.428571428571427,0.0,0.0,0.0,0.0,0.0,100.0,0.0,100.0,0.0,50.0,0.0,60.0,60.0,50.0,60.0,13.043478260869565,0.0,0.0,50.0,0.0,0.0,0.0,0.0,60.0,0.0,75.0,0.0,100.0 diff --git a/history_ratios.csv b/history_ratios.csv deleted file mode 100644 index 0e3a22d..0000000 --- a/history_ratios.csv +++ /dev/null @@ -1,38 +0,0 @@ -,steps\Ateamclipper.cwl,steps\H5ParmCollector.cwl,steps\LoSoTo.Faraday.cwl,steps\LoSoTo.Plot.cwl,steps\LoSoTo.Reset.cwl,steps\add_missing_stations.cwl,steps\compare_station_list.cwl,steps\concatenate_files.cwl,steps\ddecal.cwl,steps\ddecal_array.cwl,steps\dp3concat.cwl,steps\filter_ms_group.cwl,steps\filter_predict.cwl,steps\plot_Ateamclipper.cwl,workflows\HBA_calibrator.cwl,workflows\HBA_target.cwl,workflows\LBA_calibrator.cwl,workflows\LBA_target.cwl,workflows\linc_calibrator.cwl,workflows\linc_calibrator\apply_calibrate_bp.cwl,workflows\linc_calibrator\apply_calibrate_fr.cwl,workflows\linc_calibrator\apply_pa.cwl,workflows\linc_calibrator\faraday_rotation.cwl,workflows\linc_calibrator\fr.cwl,workflows\linc_calibrator\pa.cwl,workflows\linc_calibrator\predict_calibrate.cwl,workflows\linc_calibrator\prep.cwl,workflows\linc_calibrator\prep_fr.cwl,workflows\linc_target.cwl,workflows\linc_target\apply_calibrate_tec.cwl,workflows\linc_target\calib_targ.cwl,workflows\linc_target\finalize.cwl,workflows\linc_target\fr.cwl,workflows\linc_target\gsmcal.cwl,workflows\linc_target\predict_calibrate_fr.cwl,workflows\linc_target\selfcal_targ_hba.cwl,workflows\linc_target\selfcal_targ_lba.cwl -steps\Ateamclipper.cwl,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,0.07142857142857142,0.25,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.25,0.0,0.16666666666666666,0.0 -steps\H5ParmCollector.cwl,1.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.07142857142857142,0.25,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.25,0.0,0.16666666666666666,0.0 -steps\LoSoTo.Faraday.cwl,0.0,0.0,0.0,0.8,1.0,0.0,0.2,0.0,0.35714285714285715,0.125,0.09090909090909091,0.0,0.0,0.0,0.6,0.0,0.6,0.0,0.375,0.16666666666666666,0.6666666666666666,0.6666666666666666,0.5714285714285714,0.42857142857142855,0.21739130434782608,0.16666666666666666,0.2,0.375,0.0,0.0,0.0,0.0,0.42857142857142855,0.0,0.5,0.0,0.6 -steps\LoSoTo.Plot.cwl,0.0,0.0,0.8,0.0,0.8,0.0,0.0,0.0,0.2857142857142857,0.0,0.0,0.0,0.0,0.0,0.75,0.0,0.75,0.0,0.42857142857142855,0.0,0.5,0.8,0.42857142857142855,0.5,0.17391304347826086,0.0,0.0,0.42857142857142855,0.0,0.0,0.0,0.0,0.5,0.0,0.6,0.0,0.75 -steps\LoSoTo.Reset.cwl,0.0,0.0,1.0,0.8,0.0,0.0,0.2,0.0,0.35714285714285715,0.125,0.09090909090909091,0.0,0.0,0.0,0.6,0.0,0.6,0.0,0.375,0.16666666666666666,0.6666666666666666,0.6666666666666666,0.5714285714285714,0.42857142857142855,0.21739130434782608,0.16666666666666666,0.2,0.375,0.0,0.0,0.0,0.0,0.42857142857142855,0.0,0.5,0.0,0.6 -steps\add_missing_stations.cwl,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.07142857142857142,0.25,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.25,0.0,0.16666666666666666,0.0 -steps\compare_station_list.cwl,0.0,0.0,0.2,0.0,0.2,0.0,0.0,0.0,0.07142857142857142,0.25,0.14285714285714285,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.2,0.0,0.16666666666666666,0.0,0.043478260869565216,0.5,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -steps\concatenate_files.cwl,1.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.07142857142857142,0.25,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.25,0.0,0.16666666666666666,0.0 -steps\ddecal.cwl,0.07142857142857142,0.07142857142857142,0.35714285714285715,0.2857142857142857,0.35714285714285715,0.07142857142857142,0.07142857142857142,0.07142857142857142,0.0,0.2857142857142857,0.16666666666666666,0.07142857142857142,0.07142857142857142,0.07142857142857142,0.21428571428571427,0.0,0.21428571428571427,0.0,0.3333333333333333,0.14285714285714285,0.35714285714285715,0.35714285714285715,0.25,0.1875,0.48,0.14285714285714285,0.07142857142857142,0.25,0.0,0.0,0.0,0.0,0.1875,0.058823529411764705,0.2,0.1111111111111111,0.21428571428571427 -steps\ddecal_array.cwl,0.25,0.25,0.125,0.0,0.125,0.25,0.25,0.25,0.2857142857142857,0.0,0.1,0.0,0.25,0.25,0.0,0.0,0.0,0.0,0.0,0.5,0.2857142857142857,0.0,0.1111111111111111,0.0,0.125,0.5,0.25,0.0,0.0,0.0,0.0,0.0,0.0,0.14285714285714285,0.0,0.25,0.0 -steps\dp3concat.cwl,0.0,0.0,0.09090909090909091,0.0,0.09090909090909091,0.0,0.14285714285714285,0.0,0.16666666666666666,0.1,0.0,0.14285714285714285,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.125,0.09090909090909091,0.09090909090909091,0.08333333333333333,0.0,0.15384615384615385,0.125,0.14285714285714285,0.08333333333333333,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -steps\filter_ms_group.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.07142857142857142,0.0,0.14285714285714285,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.2,0.0,0.0,0.043478260869565216,0.0,0.0,0.16666666666666666,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -steps\filter_predict.cwl,1.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,0.07142857142857142,0.25,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.25,0.0,0.16666666666666666,0.0 -steps\plot_Ateamclipper.cwl,1.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,0.07142857142857142,0.25,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.25,0.0,0.16666666666666666,0.0 -workflows\HBA_calibrator.cwl,0.0,0.0,0.6,0.75,0.6,0.0,0.0,0.0,0.21428571428571427,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.5,0.0,0.6,0.6,0.5,0.6,0.13043478260869565,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.6,0.0,0.75,0.0,1.0 -workflows\HBA_target.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.5,0.0,0.5,0.0,0.14285714285714285,0.0 -workflows\LBA_calibrator.cwl,0.0,0.0,0.6,0.75,0.6,0.0,0.0,0.0,0.21428571428571427,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.5,0.0,0.6,0.6,0.5,0.6,0.13043478260869565,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.6,0.0,0.75,0.0,1.0 -workflows\LBA_target.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -workflows\linc_calibrator.cwl,0.0,0.0,0.375,0.42857142857142855,0.375,0.0,0.0,0.0,0.3333333333333333,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.0,0.0,0.0,0.375,0.375,0.3333333333333333,0.5714285714285714,0.2608695652173913,0.0,0.0,0.3333333333333333,0.0,0.0,0.0,0.0,0.375,0.0,0.42857142857142855,0.0,0.5 -workflows\linc_calibrator\apply_calibrate_bp.cwl,0.0,0.0,0.16666666666666666,0.0,0.16666666666666666,0.0,0.5,0.0,0.14285714285714285,0.5,0.125,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.16666666666666666,0.0,0.14285714285714285,0.0,0.08695652173913043,0.3333333333333333,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -workflows\linc_calibrator\apply_calibrate_fr.cwl,0.0,0.0,0.6666666666666666,0.5,0.6666666666666666,0.0,0.2,0.0,0.35714285714285715,0.2857142857142857,0.09090909090909091,0.0,0.0,0.0,0.6,0.0,0.6,0.0,0.375,0.16666666666666666,0.0,0.42857142857142855,0.5714285714285714,0.42857142857142855,0.21739130434782608,0.4,0.2,0.375,0.0,0.0,0.0,0.0,0.42857142857142855,0.0,0.5,0.1,0.6 -workflows\linc_calibrator\apply_pa.cwl,0.0,0.0,0.6666666666666666,0.8,0.6666666666666666,0.0,0.0,0.0,0.35714285714285715,0.0,0.09090909090909091,0.2,0.0,0.0,0.6,0.0,0.6,0.0,0.375,0.0,0.42857142857142855,0.0,0.375,0.42857142857142855,0.21739130434782608,0.0,0.0,0.5714285714285714,0.0,0.0,0.0,0.0,0.42857142857142855,0.0,0.5,0.0,0.6 -workflows\linc_calibrator\faraday_rotation.cwl,0.0,0.0,0.5714285714285714,0.42857142857142855,0.5714285714285714,0.0,0.16666666666666666,0.0,0.25,0.1111111111111111,0.08333333333333333,0.0,0.0,0.0,0.5,0.0,0.5,0.0,0.3333333333333333,0.14285714285714285,0.5714285714285714,0.375,0.0,0.5714285714285714,0.20833333333333334,0.14285714285714285,0.16666666666666666,0.3333333333333333,0.0,0.0,0.0,0.0,0.5714285714285714,0.0,0.42857142857142855,0.0,0.5 -workflows\linc_calibrator\fr.cwl,0.0,0.0,0.42857142857142855,0.5,0.42857142857142855,0.0,0.0,0.0,0.1875,0.0,0.0,0.0,0.0,0.0,0.6,0.0,0.6,0.0,0.5714285714285714,0.0,0.42857142857142855,0.42857142857142855,0.5714285714285714,0.0,0.21739130434782608,0.0,0.0,0.375,0.0,0.0,0.0,0.0,0.42857142857142855,0.0,0.5,0.0,0.6 -workflows\linc_calibrator\pa.cwl,0.0,0.0,0.21739130434782608,0.17391304347826086,0.21739130434782608,0.0,0.043478260869565216,0.0,0.48,0.125,0.15384615384615385,0.043478260869565216,0.0,0.0,0.13043478260869565,0.0,0.13043478260869565,0.0,0.2608695652173913,0.08695652173913043,0.21739130434782608,0.21739130434782608,0.20833333333333334,0.21739130434782608,0.0,0.08695652173913043,0.043478260869565216,0.20833333333333334,0.0,0.0,0.0,0.0,0.12,0.0,0.125,0.03571428571428571,0.13043478260869565 -workflows\linc_calibrator\predict_calibrate.cwl,0.0,0.0,0.16666666666666666,0.0,0.16666666666666666,0.0,0.5,0.0,0.14285714285714285,0.5,0.125,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.3333333333333333,0.4,0.0,0.14285714285714285,0.0,0.08695652173913043,0.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.14285714285714285,0.0 -workflows\linc_calibrator\prep.cwl,0.0,0.0,0.2,0.0,0.2,0.0,1.0,0.0,0.07142857142857142,0.25,0.14285714285714285,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.2,0.0,0.16666666666666666,0.0,0.043478260869565216,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -workflows\linc_calibrator\prep_fr.cwl,0.0,0.0,0.375,0.42857142857142855,0.375,0.0,0.0,0.0,0.25,0.0,0.08333333333333333,0.16666666666666666,0.0,0.0,0.5,0.0,0.5,0.0,0.3333333333333333,0.0,0.375,0.5714285714285714,0.3333333333333333,0.375,0.20833333333333334,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.375,0.0,0.42857142857142855,0.0,0.5 -workflows\linc_target.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.0,0.14285714285714285,0.0 -workflows\linc_target\apply_calibrate_tec.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.25,0.0,0.0 -workflows\linc_target\calib_targ.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.25,0.0,0.0 -workflows\linc_target\finalize.cwl,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.25,0.0,0.16666666666666666,0.0 -workflows\linc_target\fr.cwl,0.0,0.0,0.42857142857142855,0.5,0.42857142857142855,0.0,0.0,0.0,0.1875,0.0,0.0,0.0,0.0,0.0,0.6,0.0,0.6,0.0,0.375,0.0,0.42857142857142855,0.42857142857142855,0.5714285714285714,0.42857142857142855,0.12,0.0,0.0,0.375,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.6 -workflows\linc_target\gsmcal.cwl,0.25,0.25,0.0,0.0,0.0,0.25,0.0,0.25,0.058823529411764705,0.14285714285714285,0.0,0.0,0.25,0.25,0.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.25,0.0,0.0,0.0,0.25,0.0 -workflows\linc_target\predict_calibrate_fr.cwl,0.0,0.0,0.5,0.6,0.5,0.0,0.0,0.0,0.2,0.0,0.0,0.0,0.0,0.0,0.75,0.0,0.75,0.0,0.42857142857142855,0.0,0.5,0.5,0.42857142857142855,0.5,0.125,0.0,0.0,0.42857142857142855,0.0,0.25,0.25,0.0,0.5,0.0,0.0,0.0,0.75 -workflows\linc_target\selfcal_targ_hba.cwl,0.16666666666666666,0.16666666666666666,0.0,0.0,0.0,0.16666666666666666,0.0,0.16666666666666666,0.1111111111111111,0.25,0.0,0.0,0.16666666666666666,0.16666666666666666,0.0,0.14285714285714285,0.0,0.0,0.0,0.0,0.1,0.0,0.0,0.0,0.03571428571428571,0.14285714285714285,0.0,0.0,0.14285714285714285,0.0,0.0,0.16666666666666666,0.0,0.25,0.0,0.0,0.0 -workflows\linc_target\selfcal_targ_lba.cwl,0.0,0.0,0.6,0.75,0.6,0.0,0.0,0.0,0.21428571428571427,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.5,0.0,0.6,0.6,0.5,0.6,0.13043478260869565,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.6,0.0,0.75,0.0,0.0 diff --git a/main.py b/main.py index 1edd421..d3e536d 100644 --- a/main.py +++ b/main.py @@ -1,32 +1,24 @@ +from graph_traversal.metric_calculations.FlowCalculation import FlowCalculation +from graph_traversal.metric_calculations.ChangeImpact import ChangeImpact +from graph_traversal.subgraph_preprocessing.SubgraphPreprocessing import SubgraphPreprocessing +from metric_evaluation.change_impact_eval import evaluate_coupling +from neo4j_graph_queries.utils import clean_component_id +from process_gitlab.process_history import calculate_co_change_ratios from graph_creation.repo_processing import process_repos from neo4j import GraphDatabase import dotenv import os -import gitlab -import subprocess - -from graph_creation.utils import GITLAB_ASTRON - -def clone_repos(repo_list: list[str], folder_name: str) -> None: - """ - Given a list of relative paths to ASTRON GitLab repositories and the name of a folder, - the mentioned repositories are cloned into the mentioned folder. - - Parameters: - repo_list (list[str]): list of relative paths to ASTRON GitLab repositories - folder_name (str): the name of the folder to clone the repos into - """ - gl = gitlab.Gitlab(GITLAB_ASTRON) - projects = gl.projects.list(iterator=True, get_all=True) - for project in projects: - repo_name = project.attributes['path_with_namespace'] - if repo_name in repo_list: - git_url = project.ssh_url_to_repo - subprocess.call(['git', 'clone', git_url, f'./{folder_name}/{repo_name}']) +import pandas as pd + +from process_gitlab.process_repos import clone_repos, save_commit_history_for_evaluation + + if __name__ == '__main__': - relevant_repos = ['ldv/imaging_compress_pipeline' - , 'RD/LINC' + relevant_repos = [ + 'ldv\\imaging_compress_pipeline' + , + 'RD\\LINC' ] folder = 'repos' # clone_repos(relevant_repos, folder) @@ -39,14 +31,29 @@ if __name__ == '__main__': URI = os.getenv("NEO4J_URI") AUTH = (os.getenv("NEO4J_USERNAME"), os.getenv("NEO4J_PASSWORD")) - repo_paths = [f'{folder}/{path}' for path in relevant_repos] + repo_paths = [f'{folder}\\{path}' for path in relevant_repos] with GraphDatabase.driver(URI, auth=AUTH) as driver: driver.verify_connectivity() print("Connection established.") driver = GraphDatabase.driver(URI, auth=AUTH) - # with driver.session() as session: - # session.run("MATCH ()-[r:DATA]-() DELETE r") - process_repos(repo_paths, driver, build=False, calculate=True) + # clone_repos(relevant_repos, folder) + # process_repos(repo_paths, driver) + # neo4j_traversal = SubgraphPreprocessing(driver) + # neo4j_traversal.preprocess_all_graphs() + + # flow_calculation = FlowCalculation(driver) + # flow_calculation.perform_flow_path_calculation() + + # with open("flow_paths.json", "r") as json_file: + # paths = json.load(json_file) + # change_impact = ChangeImpact(driver) + # change_impact.complete_path_analysis(paths) + # with open("commits_for_evaluation.json", "r") as json_file: + # commit_history = json.load(json_file) + # calculate_co_change_ratios(commit_history) + + evaluate_coupling("change_impact_analysis.csv","history_percent.csv") + driver.close() diff --git a/metric_evaluation/change_impact_eval.py b/metric_evaluation/change_impact_eval.py new file mode 100644 index 0000000..471098b --- /dev/null +++ b/metric_evaluation/change_impact_eval.py @@ -0,0 +1,51 @@ +import pandas as pd +from scipy import stats +from cliffs_delta import cliffs_delta + +def evaluate_coupling(coupling_matrix_path, cochange_matrix_path): + # Load the two separate matrices (dataframes) + # Example of loading two CSV files (replace with your file paths) + c_matrix = pd.read_csv(coupling_matrix_path, index_col=[0]) # This matrix contains IFC values + cochange_matrix = pd.read_csv(cochange_matrix_path, index_col=[0]) # This matrix contains cochange percentages + + # Find the common indices (pairs) between the two matrices (both row and column) + # Here, we are considering both row and column indices for comparison + common_rows = c_matrix.index.intersection(cochange_matrix.index) + common_columns = c_matrix.columns.intersection(cochange_matrix.columns) + + # Extract the IFC values and cochange percentages for the common pairs + c_values_common = c_matrix.loc[common_rows, common_columns].values.flatten() + cochange_values_common = cochange_matrix.loc[common_rows, common_columns].values.flatten() + + # Create two groups based on IFC values + group_c_gt_0 = cochange_values_common[c_values_common > 0] + group_c_eq_0 = cochange_values_common[c_values_common == 0] + + # Perform the Mann-Whitney U test + statistic, p_value = stats.mannwhitneyu(group_c_gt_0, group_c_eq_0, alternative='greater') + + # Output the results + print("Mann-Whitney U test statistic:", statistic) + print("P-value:", p_value) + + # Interpretation of the result + if p_value < 0.05: + print("The difference between the two groups is statistically significant.") + else: + print("There is no statistically significant difference between the two groups.") + + # Perform the Cliff's Delta test + delta = cliffs_delta(group_c_gt_0, group_c_eq_0) + print("Cliff's Delta:", delta) + + tau, tau_p_value = stats.kendalltau(c_values_common, cochange_values_common) + + # Output Kendall's Tau results + print("Kendall's Tau coefficient:", tau) + print("Kendall's Tau p-value:", tau_p_value) + + # Interpretation of Kendall's Tau result + if tau_p_value < 0.05: + print("There is a statistically significant correlation between coupling values and cochange percentages.") + else: + print("There is no statistically significant correlation between coupling values and cochange percentages.") \ No newline at end of file diff --git a/process_gitlab/process_history.py b/process_gitlab/process_history.py index 364ed5e..b9f051a 100644 --- a/process_gitlab/process_history.py +++ b/process_gitlab/process_history.py @@ -13,7 +13,7 @@ def calculate_co_change_ratios(commit_history: list[dict]): for commit in commit_history: files: list[str] = commit["changed_files"] - cwl_files = [str(Path(file))for file in files if file.endswith('cwl')] + cwl_files = ['RD\\LINC\\' + str(Path(file)) for file in files if file.endswith('cwl')] # Update change counts for each individual file for file in cwl_files: @@ -22,7 +22,7 @@ def calculate_co_change_ratios(commit_history: list[dict]): # Update co-change counts for each pair of files modified together for file1 in cwl_files: for file2 in cwl_files: - if file1 > file2: + if file1 >= file2: pair = (file1, file2) co_change_counts[pair] += 1 @@ -30,18 +30,21 @@ def calculate_co_change_ratios(commit_history: list[dict]): files = sorted(file_change_counts.keys()) co_change_ratios = pd.DataFrame(index=files, columns=files, data=0.0) + for file in files: + co_change_ratios.at[file2, file1] = 100.0 + for pair, co_count in co_change_counts.items(): file1, file2 = pair total_changes = file_change_counts[file1] + file_change_counts[file2] - co_count if total_changes > 0: - ratio = co_count / total_changes + ratio = (co_count / total_changes) * 100 else: ratio = 0 co_change_ratios.at[file1, file2] = ratio co_change_ratios.at[file2, file1] = ratio - co_change_ratios.to_csv(f"history_ratios.csv") + co_change_ratios.to_csv(f"history_percent.csv") return co_change_ratios -- GitLab