-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tex
725 lines (622 loc) · 26.1 KB
/
main.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
\pdfminorversion=4
\documentclass[aspectratio=169]{beamer}
\mode<presentation>
{
\usetheme{default}
\usecolortheme{default}
\usefonttheme{default}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{footline}[frame number] % or "page number"
\setbeamercolor{frametitle}{fg=white}
\setbeamercolor{footline}{fg=black}
}
\usepackage[english]{babel}
\usepackage{inputenc}
\usepackage{tikz}
\usepackage{courier}
\usepackage{array}
\usepackage{bold-extra}
\usepackage{minted}
\usepackage[thicklines]{cancel}
\usepackage{fancyvrb}
\xdefinecolor{dianablue}{rgb}{0.18,0.24,0.31}
\xdefinecolor{darkblue}{rgb}{0.1,0.1,0.7}
\xdefinecolor{darkgreen}{rgb}{0,0.5,0}
\xdefinecolor{darkgrey}{rgb}{0.35,0.35,0.35}
\xdefinecolor{darkorange}{rgb}{0.8,0.5,0}
\xdefinecolor{darkred}{rgb}{0.7,0,0}
\definecolor{darkgreen}{rgb}{0,0.6,0}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\title[2023-05-09-chep23-analysis-of-physicists]{Analysis of physics analysis}
\author{Jim Pivarski and \underline{Henry Schreiner}}
\institute{Princeton University -- IRIS-HEP}
\date{May 9, 2023}
\usetikzlibrary{shapes.callouts}
%% Thanks to https://github.com/gpoore/minted/issues/288
\makeatletter
%
% Similar to \EscVerb.
%
% \EscMintinline[options]{<language>}{<backslash-escaped text>}
%
\def\EscMintinline{%
\FVExtraRobustCommand
\RobustEscMintinline
\FVExtraUnexpandedReadOArgMArgEscVArg}
\NewExpandableDocumentCommand \FVExtraUnexpandedReadOArgMArgEscVArg { o m m } {%
\IfNoValueTF{#1}
{\FVExtraAlwaysUnexpanded
{\FVExtraUnexpandedReadOArgMArgEscVArg{#2}{#3}}}
{\FVExtraAlwaysUnexpanded
{\FVExtraUnexpandedReadOArgMArgEscVArg[#1]{#2}{#3}}}%
}
\newrobustcmd\RobustEscMintinline[2][]{%
% similar to \mintinline
\begingroup
\setboolean{minted@isinline}{true}%
\minted@configlang{#2}%
\setkeys{minted@opt@cmd}{#1}%
\minted@fvset
\begingroup
\@ifnextchar\bgroup
{\FVExtraDetokenizeREscVArg{\minted@inline@iii}}%
{\PackageError{minted}%
{\string\EscMintinline\space delimiters must be paired curly braces in this context}%
{Delimit argument with curly braces}}}
\makeatother
\begin{document}
\logo{\pgfputat{\pgfxy(0.11, 7.4)}{\pgfbox[right,base]{\tikz{\filldraw[fill=dianablue, draw=none] (0 cm, 0 cm) rectangle (50 cm, 1 cm);}\mbox{\hspace{-8 cm}\includegraphics[height=1 cm]{princeton-logo-long.png}\hspace{0.1 cm}\raisebox{0.1 cm}{\includegraphics[height=0.8 cm]{iris-hep-logo-long.png}}\hspace{0.1 cm}}}}}
\begin{frame}
\titlepage
\end{frame}
\logo{\pgfputat{\pgfxy(0.11, 7.4)}{\pgfbox[right,base]{\tikz{\filldraw[fill=dianablue, draw=none] (0 cm, 0 cm) rectangle (50 cm, 1 cm);}\mbox{\hspace{-8 cm}\includegraphics[height=1 cm]{princeton-logo.png}\hspace{0.1 cm}\raisebox{0.1 cm}{\includegraphics[height=0.8 cm]{iris-hep-logo.png}}\hspace{0.1 cm}}}}}
% Uncomment these lines for an automatically generated outline.
%\begin{frame}{Outline}
% \tableofcontents
%\end{frame}
%% https://indico.jlab.org/event/459/contributions/11547/
%% Analysis of physics analysis
%% 9 May 2023, 16:00
%% 15m
%% Marriott Ballroom VI-VII (Norfolk Waterside Marriott)
%% Speaker
%% Pivarski, Jim (Princeton University)
%% Description
%% Data analysis in particle physics is socially distributed: unlike centrally developed and executed reconstruction pipelines, the analysis work performed after Analysis Object Descriptions (AODs) are made and before the final paper review—which includes particle and event selection, systematic error handling, decay chain reconstruction, histogram aggregation, fitting, statistical models, and machine learning—are often performed “off the GRID.”
%% This presents a challenge for developers of analysis tools, who need to know how their tools are being used in order to focus efforts in development, documentation, and training. The most common methods have traditionally been direct conversations with known users, wide-cast surveys, and download counts, but each of these has its limitations.
%% In this talk, I will discuss the above as well as new methods of analyzing user behavior: collecting issue comments through GitHub and GitLab APIs, statically analyzing code from thousands of git repositories matching search criteria, and web analytics of documentation sites. Applying these methods to the Awkward Array library reveals the most commonly used functions, slice idioms, and data types, as well as what libraries Awkward Array is commonly used with and how data are transferred between them. Finally, I apply these methods to other physics analysis libraries to show the generality of the techniques.
%% Consider for long presentation No
% START START START START START START START START START START START START START
\begin{frame}{Dark computing}
\vspace{0.25 cm}
\begin{columns}
\column{1.1\linewidth}
\only<1>{\includegraphics[width=\linewidth]{PLOTS/analysis-chain-0.pdf}}\only<2->{\includegraphics[width=\linewidth]{PLOTS/analysis-chain.pdf}}
\end{columns}
\vspace{0.5 cm}
\begin{itemize}
\item<3-> The ``analysis'' step is the only one in the pipeline for which we don't even know \underline{\it who} all the users are.
\end{itemize}
\end{frame}
\begin{frame}{We don't do this}
\vspace{1 cm}
\begin{center}
\includegraphics[width=0.5\linewidth]{PLOTS/iphone-send-usage-data.png}
\end{center}
\end{frame}
\begin{frame}{So what can we do instead?}
\vspace{0.35 cm}
\begin{columns}
\column{1.05\linewidth}
\renewcommand{\arraystretch}{0.85}
\begin{tabular}{p{3 cm} p{4.7 cm} p{5.7 cm}}
{\bf Method} & {\bf Good} & {\bf Bad} \\\hline
\uncover<2->{Bug-reports} & \uncover<2->{Resolve immediate needs.} & \uncover<2->{Only hear from proactive people.} \\
\uncover<3->{Surveys} & \uncover<3->{Can directly ask people what they think. Quantitative.} & \uncover<3->{Are the people who didn't fill it out correlated with the questions?} \\
\uncover<4->{Focus groups} & \uncover<4->{As above, but open to free-form, generating new ideas.} & \uncover<4->{Need to follow up from the small group to a large survey.} \\
\uncover<5->{Download stats} & \uncover<5->{People vote with their feet. Quantitative.} & \uncover<5->{Coarse-grained: only know package-level info. Skewed by batch jobs.} \\
\textcolor{white}{Textual analysis of CHEP/ACAT} & \textcolor{white}{Long-view historical trends.} & \textcolor{white}{Only for those who give talks, and what they choose to talk about.} \\
\textcolor{white}{Analysis of source code online} & \textcolor{white}{Fine-grained, quantitative, average over many users.} & \textcolor{white}{Only public repos, have to identify demographics with some seed: how to define ``particle physicists''?} \\
\end{tabular}
\end{columns}
\end{frame}
\begin{frame}{What download stats are good for (one slide)}
\vspace{0.35 cm}
Relative rates, such as new version adoption.
\begin{center}
\includegraphics[width=0.9\linewidth]{PLOTS/pip-macwin-awkward-log.pdf}
\end{center}
\end{frame}
\begin{frame}{So what can we do instead?}
\vspace{0.35 cm}
\begin{columns}
\column{1.05\linewidth}
\renewcommand{\arraystretch}{0.85}
\begin{tabular}{p{3 cm} p{4.7 cm} p{5.7 cm}}
{\bf Method} & {\bf Good} & {\bf Bad} \\\hline
\uncover<1->{Bug-reports} & \uncover<1->{Resolve immediate needs.} & \uncover<1->{Only hear from proactive people.} \\
\uncover<1->{Surveys} & \uncover<1->{Can directly ask people what they think. Quantitative.} & \uncover<1->{Are the people who didn't fill it out correlated with the questions?} \\
\uncover<1->{Focus groups} & \uncover<1->{As above, but open to free-form, generating new ideas.} & \uncover<1->{Need to follow up from the small group to a large survey.} \\
\uncover<1->{Download stats} & \uncover<1->{People vote with their feet. Quantitative.} & \uncover<1->{Coarse-grained: only know package-level info. Skewed by batch jobs.} \\
\uncover<2->{Textual analysis of CHEP/ACAT} & \uncover<2->{Long-view historical trends.} & \uncover<2->{Only for those who give talks, and what they choose to talk about.} \\
\textcolor{white}{Analysis of source code online} & \textcolor{white}{Fine-grained, quantitative, average over many users.} & \textcolor{white}{Only public repos, have to identify demographics with some seed: how to define ``particle physicists''?} \\
\end{tabular}
\end{columns}
\end{frame}
\begin{frame}{What textual analysis of CHEP/ACAT is good for (one slide)}
\vspace{0.35 cm}
Discovering trends and changing interests.
\begin{center}
\includegraphics[width=\linewidth]{PLOTS/chep-papers-ml.pdf}
\end{center}
\end{frame}
\begin{frame}{So what can we do instead?}
\vspace{0.35 cm}
\begin{columns}
\column{1.05\linewidth}
\renewcommand{\arraystretch}{0.85}
\begin{tabular}{p{3 cm} p{4.7 cm} p{5.7 cm}}
{\bf Method} & {\bf Good} & {\bf Bad} \\\hline
\uncover<1->{Bug-reports} & \uncover<1->{Resolve immediate needs.} & \uncover<1->{Only hear from proactive people.} \\
\uncover<1->{Surveys} & \uncover<1->{Can directly ask people what they think. Quantitative.} & \uncover<1->{Are the people who didn't fill it out correlated with the questions?} \\
\uncover<1->{Focus groups} & \uncover<1->{As above, but open to free-form, generating new ideas.} & \uncover<1->{Need to follow up from the small group to a large survey.} \\
\uncover<1->{Download stats} & \uncover<1->{People vote with their feet. Quantitative.} & \uncover<1->{Coarse-grained: only know package-level info. Skewed by batch jobs.} \\
\uncover<1->{Textual analysis of CHEP/ACAT} & \uncover<1->{Long-view historical trends.} & \uncover<1->{Only for those who give talks, and what they choose to talk about.} \\
\uncover<2->{Analysis of source code online} & \uncover<2->{Fine-grained, quantitative, average over many users.} & \uncover<2->{Only public repos, have to identify demographics with some seed: how to define ``particle physicists''?} \\
\end{tabular}
\end{columns}
\end{frame}
\begin{frame}{Analysis of source code online (the rest of this talk)}
\vspace{0.5 cm}
A few years ago (2019), Jim stumbled upon a good technique:
\vspace{0.2 cm}
\begin{itemize}
\item CMSSW has been on GitHub since 2013.
\item Many CMS physicists have to fork CMSSW at some point.
\item Very few non-physicists would fork CMSSW.
\end{itemize}
\vspace{0.2 cm}
\uncover<2->{So the technique is: select GitHub users who forked CMSSW (``CMS physicists'') and look at all of their non-fork repos. \textcolor{darkblue}{3\,697 people, 22\,961 repos over 10 years.}}
\vspace{1 cm}
\uncover<3->{\textcolor{darkblue}{But what about experiments other than CMS?}}
\end{frame}
\begin{frame}{A complementary dataset}
\vspace{0.5 cm}
\vspace{\baselineskip}
\begin{itemize}
\item GitHub Archive (\textcolor{blue}{\small\bf\url{https://www.gharchive.org/}}) has been collecting all fork, PR, issue, wiki, watch, and comment events since 2017. We can get a list of GitHub users who have had any interaction at all with a specified repo.
\item \textcolor{blue}{\small\bf\url{https://github.com/root-project/root}} seems like a logical choice to define ``particle physicists.''
\item \textcolor{gray}{(Could also consider a set of repos.)}
\item \textcolor{gray}{(We can get a list of 13\,069 root-forum users, but not their GitHub userids.)}
\end{itemize}
\vspace{0.2 cm}
\uncover<2->{So: select GitHub users who interacted with the ROOT repo (``particle physicists'') and look at all of their non-fork repos. \textcolor{darkblue}{2\,824 people, 17\,334 repos over 6 years.}}
\vspace{0.5 cm}
\uncover<3->{Interestingly, only 143 are in both (3.9\% of CMSSW and 5.1\% of ROOT).}
\end{frame}
\begin{frame}{What they said in their profile bios}
\vspace{0.5 cm}
\begin{columns}
\column{0.55\linewidth}
\mbox{ } \hfill \textcolor{darkblue}{\large Selected by CMSSW fork} \hfill \mbox{ }
\vspace{0.2 cm}
\includegraphics[width=\linewidth]{PLOTS/cmssw-profile-bios-wordcloud.pdf}
\begin{center}
\begin{minipage}{0.9\linewidth}
A lot of ``physics,'' ``student,'' ``particle,'' ``physicist,'' ``PhD,'' ``CERN,'' and ``CMS.''
\end{minipage}
\end{center}
\column{0.55\linewidth}
\mbox{ } \hfill \textcolor{darkblue}{\large Selected by ROOT interaction} \hfill \mbox{ }
\vspace{0.2 cm}
\includegraphics[width=\linewidth]{PLOTS/root-repo-profile-bios-wordcloud.pdf}
\begin{center}
\begin{minipage}{0.95\linewidth}
A little more ``software,'' ``engineer,'' but still lots of ``physics,'' ``student,'' and ``PhD.''
\end{minipage}
\end{center}
\end{columns}
\end{frame}
\begin{frame}{What can we do once we have the repos?}
\vspace{0.5 cm}
Previously, Jim regex-searched them for ``\mintinline{python}{import XYZ}'' and ``\EscMintinline{c++}{\#include<XYZ>}''.
\vspace{0.5 cm}
\uncover<2->{For this talk, we wanted to go further and build ASTs/statically analyze all of the code.}
\vspace{0.5 cm}
\begin{uncoverenv}<3->
Prior art: see Chris Ostrouchov's \textcolor{blue}{\href{https://labs.quansight.org/blog/2019/05/python-package-function-usage}{Measuring API Usage}} (2019).
\begin{center}
\includegraphics[width=0.55\linewidth]{PLOTS/chris-ostrouchov.png}
\end{center}
\end{uncoverenv}
\end{frame}
\begin{frame}{But first, reproducing the previous studies}
\vspace{0.5 cm}
\textcolor{gray}{Note that the data have changed: more GitHub users have forked CMSSW since the last time we looked, which adds even their past history to the plot, and the date of a repo is set by the latest file, which causes them to migrate bins (forward in time).}
\begin{columns}
\column{0.58\linewidth}
\hspace{-0.4 cm}\includegraphics[width=1.05\linewidth]{analysis/github-language-cmsswseed.pdf}
\column{0.58\linewidth}
\hspace{-0.45 cm}\includegraphics[width=1.05\linewidth]{analysis/github-package-cmsswseed.pdf}
\end{columns}
\begin{columns}
\column{0.5\linewidth}
\small
\uncover<2->{Conclusion is the same: C++ and CMSSW config (Python with \mintinline{python}{import FWCore}) are flat, while Python and Jupyter (Python) increase.}
\column{0.5\linewidth}
\small
\uncover<3->{Conclusion is the same: ROOT-C++ usage is flat while PyROOT and especially NumPy, Matplotlib, Pandas, TensorFlow are increasing. \uncover<4->{\textcolor{darkorange}{Uproot/Awkward usage $\sim$ TensorFlow usage.}}}
\end{columns}
\end{frame}
\begin{frame}{Better represented as fractions: \#matching repos/\#total repos}
\begin{columns}
\column{0.6\linewidth}
\hspace{-0.45 cm}\includegraphics[width=1.05\linewidth]{analysis/github-language-cmsswseed-fraction.pdf}
\column{0.6\linewidth}
\hspace{-0.75 cm}\includegraphics[width=1.05\linewidth]{analysis/github-package-cmsswseed-fraction.pdf}
\end{columns}
\vspace{-0.08 cm}
\begin{columns}
\column{0.6\linewidth}
\uncover<2->{\hspace{-0.45 cm}\includegraphics[width=1.05\linewidth]{analysis/github-language-rootseed-fraction.pdf}}
\column{0.6\linewidth}
\uncover<2->{\hspace{-0.75 cm}\includegraphics[width=1.05\linewidth]{analysis/github-package-rootseed-fraction.pdf}}
\end{columns}
\begin{uncoverenv}<3->
\vspace{-6.8 cm}
\mbox{ } \hfill \fcolorbox{darkblue}{white}{\begin{minipage}{0.5\linewidth}
\textcolor{darkblue}{Some of the growth was in the denominator: the total number of repos is increasing while Python use also increases.}
\end{minipage}} \hfill \mbox{ }
\vspace{6.8 cm}
\end{uncoverenv}
\begin{uncoverenv}<4->
\vspace{-4.6 cm}
\mbox{ } \hfill \fcolorbox{darkblue}{white}{\begin{minipage}{0.5\linewidth}
\textcolor{darkblue}{In the ROOT-selected group, Python use has always been higher, though the profile bios indicated more engineers and computer scientists.}
\end{minipage}} \hfill \mbox{ }
\vspace{4.6 cm}
\end{uncoverenv}
\end{frame}
\begin{frame}{Narrow in on physicists, selecting by their profile bios}
\vspace{0.15 cm}
\small
\begin{columns}
\column{1.07\linewidth}
Regex \mintinline{python}{(phys|analy|hep|particle|cern|cms|atlas|alice|lhc)} selects \textcolor{darkblue}{7.6\% of users}.
\end{columns}
\begin{columns}
\column{0.58\linewidth}
\includegraphics[width=\linewidth]{analysis/github-language-cmsswseed-tight-fraction.pdf}
\column{0.58\linewidth}
\hspace{-0.25 cm}\includegraphics[width=\linewidth]{analysis/github-package-cmsswseed-tight-fraction.pdf}
\end{columns}
\vspace{-0.25 cm}
\begin{columns}
\column{0.58\linewidth}
\includegraphics[width=\linewidth]{analysis/github-language-rootseed-tight-fraction.pdf}
\column{0.58\linewidth}
\hspace{-0.25 cm}\includegraphics[width=\linewidth]{analysis/github-package-rootseed-tight-fraction.pdf}
\end{columns}
\begin{uncoverenv}<2->
\vspace{-4.3 cm}
\mbox{ } \hfill \fcolorbox{darkblue}{white}{\begin{minipage}{0.5\linewidth}
\textcolor{darkblue}{Although selecting a pure sample of physicists cuts more than 90\% of the data, the same trends are still visible.}
\end{minipage}} \hfill \mbox{ }
\vspace{4.3 cm}
\end{uncoverenv}
\end{frame}
\begin{frame}{Now actually parse the repos: Python 3 adoption among physicists}
\vspace{0.5 cm}
\begin{columns}
\column{1.15\linewidth}
\includegraphics[width=\linewidth]{analysis/github-python-2-3-fraction.pdf}
\end{columns}
\end{frame}
\begin{frame}[fragile]{Ask specific questions: Awkward 1 adoption by function name}
\vspace{0.15 cm}
\begin{columns}
\column{0.7\linewidth}
\includegraphics[width=\linewidth]{analysis/github-ast-awkward-0-1.pdf}
\column{0.5\linewidth}
\hspace{-0.7 cm}\begin{minipage}{\linewidth}
\scriptsize
\begin{minted}{python}
def is_awkward0(obj):
return obj.function.name.startswith(
"ak.JaggedArray"
) or obj.function.name.startswith(
"ak.array.jagged.JaggedArray"
) or obj.function.name in (
"ak.IndexedArray",
"ak.Table",
"ak.fromarrow",
"ak.fromiter",
"ak.hdf5",
"ak.load",
"ak.save",
"ak.toarrow",
"ak.topandas",
"ak.util.concatenate",
)
\end{minted}
\end{minipage}
\end{columns}
\end{frame}
\begin{frame}[fragile]{Most common function calls/argument patterns}
\vspace{0.3 cm}
\small
\begin{columns}
\column{0.45\linewidth}
\mbox{\hspace{1.35 cm}{\large\bf Awkward Array}}
\vspace{0.05 cm}
\begin{tabular}{r l}
2832 & \verb|ak.flatten(?)| \\
2498 & \verb|ak.num(?)| \\
2193 & \verb|ak.to_numpy(?)| \\
874 & \verb|ak.sum(?, axis=1)| \\
865 & \verb|ak.flatten(?, axis=None)| \\
564 & \verb|ak.sum(?)| \\
455 & \verb|ak.ones_like(?)| \\
406 & \verb|ak.Array(?)| \\
283 & \verb|ak.concatenate(?)| \\
265 & \verb|ak.singletons(?)| \\
248 & \verb|ak.num(?, axis=1)| \\
246 & \verb|ak.concatenate(?, axis=1)| \\
235 & \verb|ak.any(?, axis=1)| \\
234 & \verb|ak.zip(?, with_name='str')| \\
233 & \verb|ak.to_pandas(?)| \\
226 & \verb|ak.unzip(?)| \\
221 & \verb|ak.firsts(?)| \\
\end{tabular}
\column{0.65\linewidth}
\mbox{\hspace{1.35 cm}{\large\bf Uproot}}
\vspace{0.05 cm}
\begin{tabular}{r l}
2150 & \verb|uproot.open(?)| \\
889 & \verb|uproot.open('str')| \\
198 & \verb|uproot.recreate(?)| \\
179 & \verb|uproot.tree.TBranchMethods.array(?)| \\
74 & \verb|uproot.lazy(?)| \\
58 & \verb|uproot.newtree(?)| \\
57 & \verb|uproot.pandas.iterate(?, 'str', ['strings'])| \\
44 & \verb|uproot.open(?, xrootdsource=?)| \\
23 & \verb|uproot.lazy(?, filter_name=?)| \\
22 & \verb|uproot.recreate('str')| \\
18 & \verb|uproot.create(?)| \\
15 & \verb|uproot.recreate(?, compression=?)| \\
13 & \verb|uproot.newbranch(?, size='str')| \\
11 & \verb|uproot.numentries(?, ?)| \\
11 & \verb|uproot.ArrayCache('str')| \\
10 & \verb|uproot.numentries(?, ?, total=False)| \\
10 & \verb|uproot.numentries(?, ?, executor=?, total=False)| \\
\end{tabular}
\end{columns}
\vspace{-5 cm}
\begin{uncoverenv}<2->
\begin{columns}
\column{1.2\linewidth}
\hspace{8.3 cm}\fcolorbox{darkblue}{white}{\begin{minipage}{0.4\linewidth}
\textcolor{darkblue}{Uproot relies more on object methods. We'd have to statically analyze {\it object types}, not functions on global modules, which is hard in a dynamically typed language.}
\end{minipage}}
\end{columns}
\end{uncoverenv}
\vspace{5 cm}
\vspace{-10.05 cm}
\begin{uncoverenv}<3->
\begin{columns}
\column{1.2\linewidth}
\hspace{7.1 cm}\fcolorbox{darkblue}{white}{\begin{minipage}{0.5\linewidth}
\textcolor{darkblue}{Compare to web traffic on awkward-array.org\ldots}
\vspace{0.1 cm}
\begin{tabular}{l r r r r}
function & \hspace{-1 cm}\#unique visitors & \#views & avg.\ time \\\hline
ak.Array & 785 & 1100 & 3m33s \\
ak.concatenate & 223 & 293 & 4m35s \\
ak.count & 210 & 265 & 4m20s \\
ak.flatten & 203 & 242 & 4m23s \\
ak.where & 202 & 262 & 3m54s \\
ak.num & 184 & 235 & 3m07s \\
ak.to\_numpy & 181 & 218 & 3m25s \\
ak.mask & 178 & 231 & 3m52s \\
ak.zip & 163 & 221 & 5m02s \\
ak.fill\_none & 162 & 214 & 3m11s \\
ak.broadcast\_arrays & 156 & 210 & 4m20s \\
ak.combinations & 136 & 171 & 3m58s \\
ak.sum & 136 & 165 & 4m42s \\
ak.behavior & 125 & 152 & 6m25s \\
ak.ArrayBuilder & 124 & 161 & 3m02s \\
ak.cartesian & 121 & 159 & 3m09s \\
ak.pad\_none & 114 & 146 & 3m00s \\
\end{tabular}
\end{minipage}}
\end{columns}
\end{uncoverenv}
\vspace{10.05 cm}
\end{frame}
\begin{frame}{Use feature adoption to make decisions about deprecation}
\vspace{0.5 cm}
The colon in \mintinline{python}{uproot.open("file.root:dir/tree")} causes many problems:
\vspace{0.25 cm}
\begin{columns}
\column{1.1\linewidth}
\includegraphics[width=\linewidth]{PLOTS/uproot-open-colon-issues.png}
\end{columns}
\begin{uncoverenv}<2->
\vspace{-6.5 cm}
\mbox{ } \hfill \fcolorbox{black}{white}{\begin{minipage}{0.7\linewidth}
\includegraphics[width=\linewidth]{analysis/github-ast-uproot-filename-colon.pdf}
\mbox{ } \hfill \begin{minipage}{0.9\linewidth}
\vspace{0.1 cm}
But removing it would upset at least 10\% of workflows.
\vspace{0.1 cm}
The deprecation period has to be {\it long}, if it is to be removed at all.
\vspace{0.1 cm}
\end{minipage} \hfill \mbox{ }
\end{minipage}} \hfill \mbox{ }
\vspace{6.5 cm}
\end{uncoverenv}
\end{frame}
\begin{frame}[fragile]{Focus on Uproot's array-fetching functions}
\vspace{0.5 cm}
How do people use the \mintinline{python}{library="??"} argument?
\begin{columns}
\column{0.5\linewidth}
\mbox{\hspace{0.75 cm}\includegraphics[width=\linewidth]{analysis/github-ast-uproot-array-function-library-argument.pdf}}
\vspace{0.5 cm}
\mbox{\hspace{1 cm}\begin{minipage}{0.85\linewidth}
When it's used, it's much more often used for NumPy than for Pandas.
\end{minipage}}
\column{0.7\linewidth}
\scriptsize
\begin{minted}{python}
if isinstance(tree, ast.Call):
name = ast.unparse(tree.func)
if ( # select Uproot functions only
(name.endswith(".array") and name not in (
"np.array", "np.ma.array", "numpy.array",
"NUMPY_LIB.array", "array.array",
"self.NUMPY_LIB.array", "cupy.array",
))
or name.endswith(".arrays")
or name.endswith(".iterate")
or (name.endswith(".concatenate") and name not in (
"np.concatenate", "ak.concatenate",
"awk.concatenate", "awkward.concatenate",
"awkward.JaggedArray.concatenate",
"JaggedArray.concatenate",
"tf.concatenate",
))
or name.endswith(".dask")
):
matches.append(tree)
\end{minted}
\end{columns}
\end{frame}
\begin{frame}{What libraries are Awkward and Uproot used {\it with}?}
\vspace{0.35 cm}
\small
\begin{columns}
\column{0.45\linewidth}
\mbox{ } \hfill \hfill \hfill {\large\bf Awkward Array} \hfill \mbox{ }
\vspace{0.05 cm}
\begin{columns}
\column{0.5\linewidth}
\setlength{\tabcolsep}{2 pt}
\begin{tabular}{rr}
numpy & 90.5\% \\
uproot & 56.9\% \\
matplotlib & 49.8\% \\
coffea & 35.6\% \\
pandas & 31.2\% \\
mplhep & 20.4\% \\
ROOT & 11.9\% \\
numba & 11.8\% \\
hist & 8.8\% \\
uproot\_methods & 8.4\% \\
yaml & 8.2\% \\
utils & 7.4\% \\
tqdm & 6.7\% \\
boost\_histogram & 5.8\% \\
tensorflow & 5.0\% \\
scipy & 4.8\% \\
vector & 4.3\% \\
\end{tabular}
\column{0.5\linewidth}
\setlength{\tabcolsep}{2 pt}
\begin{tabular}{rr}
torch & 4.2\% \\
seaborn & 3.7\% \\
yahist & 3.6\% \\
xgboost & 3.2\% \\
sklearn & 2.9\% \\
h5py & 2.9\% \\
memory\_profiler & 2.6\% \\
pympler & 2.3\% \\
psutil & 2.1\% \\
correctionlib & 1.9\% \\
sortedcontainers & 1.8\% \\
cycler & 1.7\% \\
networkx & 1.7\% \\
pylab & 1.5\% \\
PIL & 1.5\% \\
helpers & 1.4\% \\
tabulate & 1.4\% \\
\end{tabular}
\end{columns}
\column{0.025\linewidth}
\column{0.45\linewidth}
\mbox{ } \hfill \hfill \hfill {\large\bf Uproot} \hfill \mbox{ }
\vspace{0.05 cm}
\begin{columns}
\column{0.5\linewidth}
\setlength{\tabcolsep}{2 pt}
\begin{tabular}{rr}
numpy & 88.5\% \\
matplotlib & 59.4\% \\
pandas & 46.5\% \\
awkward & 31.7\% \\
ROOT & 23.6\% \\
coffea & 14.0\% \\
mplhep & 13.8\% \\
tqdm & 11.0\% \\
tensorflow & 9.4\% \\
scipy & 8.2\% \\
sklearn & 7.0\% \\
uproot\_methods & 6.2\% \\
xgboost & 6.0\% \\
yaml & 5.8\% \\
numba & 5.8\% \\
utils & 5.1\% \\
root\_numpy & 4.5\% \\
\end{tabular}
\column{0.5\linewidth}
\setlength{\tabcolsep}{2 pt}
\begin{tabular}{rr}
seaborn & 3.9\% \\
hist & 3.9\% \\
boost\_histogram & 3.9\% \\
keras & 3.5\% \\
CMS\_lumi & 3.5\% \\
histo\_utilities & 3.1\% \\
analysis\_utilities & 3.1\% \\
torch & 2.9\% \\
h5py & 2.8\% \\
progressBar & 2.8\% \\
cebefo\_style & 2.3\% \\
lumi\_utilities & 2.1\% \\
yahist & 1.9\% \\
common & 1.8\% \\
config & 1.8\% \\
root\_pandas & 1.8\% \\
psutil & 1.6\% \\
\end{tabular}
\end{columns}
\end{columns}
\end{frame}
\begin{frame}{Conclusions}
\vspace{0.35 cm}
\large
\begin{itemize}\setlength{\itemsep}{0.25 cm}
\item<1-> A lot of physics analysis code is public on GitHub and GitLab.
\item<2-> We can find it by crawling the network, seeded by a package that is well-known in the community, such as CMSSW or ROOT.
\item<3-> Studying tens of thousands of git repos is a modest data analysis (TB scale).\hspace{-1 cm}
\begin{itemize}\setlength{\itemsep}{0.1 cm}
\item \textcolor{gray}{Dask was very helpful!}
\end{itemize}
\item<4-> We can learn things that are useful for software library maintenance:
\begin{itemize}\setlength{\itemsep}{0.1 cm}
\item user adoption of new versions
\item most common function-call patterns
\item decide if and when a feature can be deprecated
\item discover which libraries are being used together, maybe motivate integrations
\end{itemize}
\item<5->{It's hard to identify class method calls in a dynamically typed language!}
\end{itemize}
\vspace{0.25 cm}
\uncover<6->{How to get the analysis code (source data are in public S3 buckets):}
\vspace{0.1 cm}
\scriptsize
\uncover<6->{\textcolor{blue}{\bf\url{https://github.com/jpivarski-talks/2023-05-09-chep23-analysis-of-physicists}}}
\end{frame}
\end{document}