Changeset d1ccc57
- Timestamp:
- Apr 10, 2026, 5:16:25 PM (26 hours ago)
- Branches:
- master
- Children:
- e2e927e
- Parents:
- 806534c
- Location:
- doc/theses/mike_brooks_MMath/plots
- Files:
-
- 2 edited
-
ListCommon.py (modified) (5 diffs)
-
list-mchn-szz.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/plots/ListCommon.py
r806534c rd1ccc57 136 136 # print( "marginalizing on", marginalizeOn, "conditioning on", conditionOn, file=sys.stderr ) 137 137 138 stats = canonSrc.groupby(conditionOn)['mean_op_dur_ns'].agg(**{ 139 c_tgtPeers: 'count', 140 c_tgtBl: gmean 141 }) 142 group_lookup = timings.set_index(conditionOn).index 143 timings[c_tgtPeers] = stats[c_tgtPeers].reindex(group_lookup).values 144 timings[c_tgtBl] = stats[c_tgtBl].reindex(group_lookup).values 138 if conditionOn: 139 stats = canonSrc.groupby(conditionOn)['mean_op_dur_ns'].agg(**{ 140 c_tgtPeers: 'count', 141 c_tgtBl: gmean 142 }) 143 group_lookup = timings.set_index(conditionOn).index 144 timings[c_tgtPeers] = stats[c_tgtPeers].reindex(group_lookup).values 145 timings[c_tgtBl] = stats[c_tgtBl].reindex(group_lookup).values 146 else: 147 stats = canonSrc.groupby((lambda _: 0))['mean_op_dur_ns'].agg(**{ 148 c_tgtPeers: 'count', 149 c_tgtBl: gmean 150 }) 151 # Extract the single row 152 row = stats.iloc[0] 153 # Broadcast to all rows 154 timings[c_tgtPeers] = row[c_tgtPeers] 155 timings[c_tgtBl] = row[c_tgtBl] 156 145 157 146 158 # everywhere := itself / [preferred-subset derived] … … 405 417 tgtAccessor = 'all', 406 418 tgtInterleave = 0.0, 407 marginalizeOn=['fx'] ): 419 drillOn = ['fx'], 420 marginalizeOn = None ): # None means match drill-on 421 422 if marginalizeOn == None: 423 marginalizeOn = drillOn 408 424 409 425 # watch out for filtering too early here; need everything sticking around until baselines are applies … … 450 466 aggregated[ c_measureBkt ] = aggregated[c_measure].apply( botOfBucketOfVal ) 451 467 452 marggrp = aggregated.groupby(marginalizeOn)468 drillgrp = aggregated.groupby(drillOn) 453 469 454 470 … … 457 473 # print() 458 474 459 for mkey, mgroup in marggrp:475 for dkey, dgroup in drillgrp: 460 476 # print(mgroup, file=sys.stderr) 461 477 462 histo_raw = mgroup[ c_measureBkt ].value_counts()478 histo_raw = dgroup[ c_measureBkt ].value_counts() 463 479 for b in buckets: 464 480 if b not in histo_raw.keys(): … … 472 488 histo.insert(y_lo_col_loc + 1, "y_hi", histo["y_lo"].apply(topValOfBucketBotVal)) 473 489 474 header = str.join(', ', mkey)490 header = str.join(', ', dkey) 475 491 print(f'"{header}"') 476 492 text = histo.to_csv(header=False, index=False, sep='\t') -
doc/theses/mike_brooks_MMath/plots/list-mchn-szz.py
r806534c rd1ccc57 11 11 tgtPolarity = 'all', 12 12 tgtAccessor = 'all', 13 marginalizeOn=['machine', 'SizeZone'] ) 13 drillOn=['machine', 'SizeZone'], 14 marginalizeOn=explanations )
Note:
See TracChangeset
for help on using the changeset viewer.