forked from InterlabsOCWA/CodeDocumentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterlabsCodeGuidance.html
More file actions
1351 lines (1325 loc) · 92.1 KB
/
InterlabsCodeGuidance.html
File metadata and controls
1351 lines (1325 loc) · 92.1 KB
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
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.3.323">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="author" content="YJ, JH">
<title>Wastewater Surveillance Interlab Program Analytical Code Documentation</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>
<script src="InterlabsCodeGuidance_files/libs/clipboard/clipboard.min.js"></script>
<script src="InterlabsCodeGuidance_files/libs/quarto-html/quarto.js"></script>
<script src="InterlabsCodeGuidance_files/libs/quarto-html/popper.min.js"></script>
<script src="InterlabsCodeGuidance_files/libs/quarto-html/tippy.umd.min.js"></script>
<script src="InterlabsCodeGuidance_files/libs/quarto-html/anchor.min.js"></script>
<link href="InterlabsCodeGuidance_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="InterlabsCodeGuidance_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="InterlabsCodeGuidance_files/libs/bootstrap/bootstrap.min.js"></script>
<link href="InterlabsCodeGuidance_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="InterlabsCodeGuidance_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script src="InterlabsCodeGuidance_files/libs/htmlwidgets-1.6.2/htmlwidgets.js"></script>
<script src="InterlabsCodeGuidance_files/libs/d3-4.5.0/d3.min.js"></script>
<script src="InterlabsCodeGuidance_files/libs/sankey-1/sankey.js"></script>
<script src="InterlabsCodeGuidance_files/libs/sankeyNetwork-binding-0.4/sankeyNetwork.js"></script>
</head>
<body>
<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
<nav id="TOC" role="doc-toc" class="toc-active">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#introduction" id="toc-introduction" class="nav-link active" data-scroll-target="#introduction"><span class="header-section-number">0.1</span> Introduction</a></li>
<li><a href="#environment-structure" id="toc-environment-structure" class="nav-link" data-scroll-target="#environment-structure"><span class="header-section-number">1</span> Environment Structure</a>
<ul class="collapse">
<li><a href="#external-file-structure" id="toc-external-file-structure" class="nav-link" data-scroll-target="#external-file-structure"><span class="header-section-number">1.1</span> External File Structure</a></li>
<li><a href="#code-internal-structure" id="toc-code-internal-structure" class="nav-link" data-scroll-target="#code-internal-structure"><span class="header-section-number">1.2</span> Code Internal Structure</a></li>
</ul></li>
<li><a href="#operating-environment" id="toc-operating-environment" class="nav-link" data-scroll-target="#operating-environment"><span class="header-section-number">2</span> Operating Environment</a>
<ul class="collapse">
<li><a href="#general-software" id="toc-general-software" class="nav-link" data-scroll-target="#general-software"><span class="header-section-number">2.1</span> General Software</a></li>
<li><a href="#r-environment" id="toc-r-environment" class="nav-link" data-scroll-target="#r-environment"><span class="header-section-number">2.2</span> R Environment</a>
<ul class="collapse">
<li><a href="#package-dependencies" id="toc-package-dependencies" class="nav-link" data-scroll-target="#package-dependencies"><span class="header-section-number">2.2.1</span> Package Dependencies</a></li>
</ul></li>
<li><a href="#python" id="toc-python" class="nav-link" data-scroll-target="#python"><span class="header-section-number">2.3</span> Python</a></li>
</ul></li>
<li><a href="#version-control" id="toc-version-control" class="nav-link" data-scroll-target="#version-control"><span class="header-section-number">3</span> Version Control</a>
<ul class="collapse">
<li><a href="#installation-and-setup" id="toc-installation-and-setup" class="nav-link" data-scroll-target="#installation-and-setup"><span class="header-section-number">3.1</span> Installation and setup</a></li>
<li><a href="#branch_workflow" id="toc-branch_workflow" class="nav-link" data-scroll-target="#branch_workflow"><span class="header-section-number">3.2</span> Fundamentals branch workflow</a>
<ul class="collapse">
<li><a href="#gitignore" id="toc-gitignore" class="nav-link" data-scroll-target="#gitignore"><span class="header-section-number">3.2.1</span> gitignore file</a></li>
</ul></li>
<li><a href="#vc-project-workflow" id="toc-vc-project-workflow" class="nav-link" data-scroll-target="#vc-project-workflow"><span class="header-section-number">3.3</span> Version control project workflow</a>
<ul class="collapse">
<li><a href="#main-branch" id="toc-main-branch" class="nav-link" data-scroll-target="#main-branch"><span class="header-section-number">3.3.1</span> Main branch</a></li>
<li><a href="#round-branch" id="toc-round-branch" class="nav-link" data-scroll-target="#round-branch"><span class="header-section-number">3.3.2</span> Round branch</a></li>
<li><a href="#develop-branch" id="toc-develop-branch" class="nav-link" data-scroll-target="#develop-branch"><span class="header-section-number">3.3.3</span> Develop branch</a></li>
</ul></li>
</ul></li>
<li><a href="#issues-tracking" id="toc-issues-tracking" class="nav-link" data-scroll-target="#issues-tracking"><span class="header-section-number">4</span> Issues Tracking</a></li>
<li><a href="#linting-code-style-guide" id="toc-linting-code-style-guide" class="nav-link" data-scroll-target="#linting-code-style-guide"><span class="header-section-number">5</span> Linting / Code Style Guide</a></li>
<li><a href="#refactoring" id="toc-refactoring" class="nav-link" data-scroll-target="#refactoring"><span class="header-section-number">6</span> Refactoring</a>
<ul class="collapse">
<li><a href="#unit-testing-approaches-practices" id="toc-unit-testing-approaches-practices" class="nav-link" data-scroll-target="#unit-testing-approaches-practices"><span class="header-section-number">6.1</span> unit testing approaches & practices</a></li>
<li><a href="#unit-testing-framework" id="toc-unit-testing-framework" class="nav-link" data-scroll-target="#unit-testing-framework"><span class="header-section-number">6.2</span> Unit Testing Framework</a>
<ul class="collapse">
<li><a href="#table-3---milestone-deliverables-tentative-schedule" id="toc-table-3---milestone-deliverables-tentative-schedule" class="nav-link" data-scroll-target="#table-3---milestone-deliverables-tentative-schedule"><span class="header-section-number">6.2.1</span> Table 3 - Milestone Deliverables & Tentative Schedule</a></li>
</ul></li>
</ul></li>
<li><a href="#references" id="toc-references" class="nav-link" data-scroll-target="#references"><span class="header-section-number">7</span> References</a></li>
<li><a href="#appendixreference-extracts" id="toc-appendixreference-extracts" class="nav-link" data-scroll-target="#appendixreference-extracts"><span class="header-section-number">8</span> Appendix/Reference Extracts</a>
<ul class="collapse">
<li><a href="#dark-modelight-mode-technique" id="toc-dark-modelight-mode-technique" class="nav-link" data-scroll-target="#dark-modelight-mode-technique"><span class="header-section-number">8.1</span> Dark Mode/Light Mode Technique</a></li>
<li><a href="#typical-code-issues-correspondent-refactoring" id="toc-typical-code-issues-correspondent-refactoring" class="nav-link" data-scroll-target="#typical-code-issues-correspondent-refactoring"><span class="header-section-number">8.2</span> Typical Code Issues & Correspondent Refactoring</a>
<ul class="collapse">
<li><a href="#refactoring-methods" id="toc-refactoring-methods" class="nav-link" data-scroll-target="#refactoring-methods"><span class="header-section-number">8.2.1</span> Refactoring methods</a></li>
</ul></li>
<li><a href="#handling-commented-out-code" id="toc-handling-commented-out-code" class="nav-link" data-scroll-target="#handling-commented-out-code"><span class="header-section-number">8.3</span> Handling Commented-out code</a></li>
<li><a href="#unit-testing-notes" id="toc-unit-testing-notes" class="nav-link" data-scroll-target="#unit-testing-notes"><span class="header-section-number">8.4</span> Unit testing notes</a>
<ul class="collapse">
<li><a href="#misc.-heap-of-code" id="toc-misc.-heap-of-code" class="nav-link" data-scroll-target="#misc.-heap-of-code"><span class="header-section-number">8.4.1</span> Misc. heap of code</a></li>
</ul></li>
</ul></li>
</ul>
</nav>
</div>
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">Wastewater Surveillance Interlab Program Analytical Code Documentation</h1>
</div>
<div class="quarto-title-meta">
<div>
<div class="quarto-title-meta-heading">Author</div>
<div class="quarto-title-meta-contents">
<p>YJ, JH </p>
</div>
</div>
</div>
</header>
<div class="cell">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co">#library(kableExtra)#for dataframe generated tables</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(networkD3) <span class="co">#for flowcharts</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(reticulate)<span class="co">#to run python in this file</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<section id="introduction" class="level2" data-number="0.1">
<h2 data-number="0.1" class="anchored" data-anchor-id="introduction"><span class="header-section-number">0.1</span> Introduction</h2>
<p>Within the OCWA interlabs program, R code processes data, and generates plots and descriptive statistics. The R code (“base code”) continues to evolve to serve the new requirements and exploratory analysis in the interlabs program. An ancillary collection of spreadsheets with Excel code and python code are used in sample preparation and pre-processing.</p>
<p>The purpose of this document is: 1. To serve as documentation accompanying the base code, and to be continually updated with periodic major review & team refresher training as mandated by the QMS<br>
2. Set out practice standards for the team to collectively continue hygienic data handling & coding following the refactoring project in 2023; serve as on-boarding training for new team members</p>
</section>
<section id="environment-structure" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Environment Structure</h1>
<section id="external-file-structure" class="level2" data-number="1.1">
<h2 data-number="1.1" class="anchored" data-anchor-id="external-file-structure"><span class="header-section-number">1.1</span> External File Structure</h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="do">### I. Code Documentation</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co">#1. Inventory existing external file dependencies and working procedures outside of main codebase, e.g. the python snippets, address books, flow of sample notes, raw, and clean data *(4 weeks / July 2023)*\</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>An inventory of file and code relationships external to the main codebase is currently is shown in Table 1 and Figure 1 below.</p>
<section id="table-1-spreadsheets-inventory" class="level4" data-number="1.1.0.1">
<h4 data-number="1.1.0.1" class="anchored" data-anchor-id="table-1-spreadsheets-inventory"><span class="header-section-number">1.1.0.1</span> Table 1: Spreadsheets Inventory</h4>
<div class="cell">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co">#Yuhan - please load into your excel table as df, then use kable package to format it </span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>: Existing Spreadsheets</p>
</section>
</section>
<section id="code-internal-structure" class="level2" data-number="1.2">
<h2 data-number="1.2" class="anchored" data-anchor-id="code-internal-structure"><span class="header-section-number">1.2</span> Code Internal Structure</h2>
<p>The base code is in the Rmarkdown format with the process and optional analysis codes segmented as chunks. Explanatory notes are primarily written in markdown prefacing each chunk of code, alongside minor comments in-line within the code chunk. The chunks should be run from top-down to ensure that prerequisite objects are generated; part of the explanatory notes prefacing each chunk details the prerequisite requirements, and is summarized below.</p>
<section id="figure-1-intra-base-code-relationships" class="level4" data-number="1.2.0.1">
<h4 data-number="1.2.0.1" class="anchored" data-anchor-id="figure-1-intra-base-code-relationships"><span class="header-section-number">1.2.0.1</span> Figure 1: Intra-base code relationships</h4>
<div class="cell">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="co">#Yuhan to insert flowchart code and execute the code to show figure</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="co">#*Deliverable: Inventory & flowchart of external relationships*</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="co">#2. Inventory existing internal code dependencies and timelines (in-progress work shown in Figure 1) *(4 weeks / July 2023)*\</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="co"># **Deliverable: Inventory & flowchart of intra-basecode relationships**</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>: Intra-base code relationships</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>nodes <span class="ot">=</span> <span class="fu">data.frame</span>(<span class="st">"name"</span> <span class="ot">=</span> </span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">"Emails"</span>, <span class="co"># 0</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="st">"Raw data"</span>, <span class="co"># 1</span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> <span class="st">"Clean data"</span>, <span class="co"># 2</span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> <span class="st">"20230529_Sample_Notes.xlsm"</span>, <span class="co"># 3</span></span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> <span class="st">"WBE_Sample_Phasma-CA_20230511.Rmd"</span>, <span class="co"># 4</span></span>
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> <span class="st">"plots"</span>, <span class="co"># 5</span></span>
<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a> <span class="st">"dataframe"</span>, <span class="co"># 6</span></span>
<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a> <span class="st">"report"</span>)) <span class="co"># 7</span></span>
<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a>links <span class="ot">=</span> <span class="fu">as.data.frame</span>(<span class="fu">matrix</span>(<span class="fu">c</span>(</span>
<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a> <span class="dv">0</span>, <span class="dv">1</span>, <span class="dv">1</span>, <span class="co"># Each row represents a link. The first number</span></span>
<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a> <span class="dv">1</span>, <span class="dv">2</span>, <span class="dv">1</span>, <span class="co"># represents the node being conntected from. </span></span>
<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a> <span class="dv">2</span>, <span class="dv">3</span>, <span class="dv">1</span>, <span class="co"># the second number represents the node connected to.</span></span>
<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a> <span class="dv">2</span>, <span class="dv">4</span>, <span class="dv">1</span>, <span class="co"># The third number is the value of the node</span></span>
<span id="cb5-16"><a href="#cb5-16" aria-hidden="true" tabindex="-1"></a> <span class="dv">4</span>, <span class="dv">5</span>, <span class="dv">1</span>,</span>
<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a> <span class="dv">4</span>, <span class="dv">6</span>, <span class="dv">1</span>,</span>
<span id="cb5-18"><a href="#cb5-18" aria-hidden="true" tabindex="-1"></a> <span class="dv">5</span>, <span class="dv">7</span> ,<span class="dv">1</span>,</span>
<span id="cb5-19"><a href="#cb5-19" aria-hidden="true" tabindex="-1"></a> <span class="dv">6</span>, <span class="dv">7</span>, <span class="dv">1</span>),</span>
<span id="cb5-20"><a href="#cb5-20" aria-hidden="true" tabindex="-1"></a> <span class="at">byrow =</span> <span class="cn">TRUE</span>, <span class="at">ncol =</span> <span class="dv">3</span>))</span>
<span id="cb5-21"><a href="#cb5-21" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-22"><a href="#cb5-22" aria-hidden="true" tabindex="-1"></a><span class="fu">names</span>(links) <span class="ot">=</span> <span class="fu">c</span>(<span class="st">"source"</span>, <span class="st">"target"</span>, <span class="st">"value"</span>)</span>
<span id="cb5-23"><a href="#cb5-23" aria-hidden="true" tabindex="-1"></a><span class="fu">sankeyNetwork</span>(<span class="at">Links =</span> links, <span class="at">Nodes =</span> nodes,</span>
<span id="cb5-24"><a href="#cb5-24" aria-hidden="true" tabindex="-1"></a> <span class="at">Source =</span> <span class="st">"source"</span>, <span class="at">Target =</span> <span class="st">"target"</span>,</span>
<span id="cb5-25"><a href="#cb5-25" aria-hidden="true" tabindex="-1"></a> <span class="at">Value =</span> <span class="st">"value"</span>, <span class="at">NodeID =</span> <span class="st">"name"</span>,</span>
<span id="cb5-26"><a href="#cb5-26" aria-hidden="true" tabindex="-1"></a> <span class="at">fontSize=</span> <span class="dv">12</span>, <span class="at">nodeWidth =</span> <span class="dv">30</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<div class="sankeyNetwork html-widget html-fill-item-overflow-hidden html-fill-item" id="htmlwidget-a106c4adc95b2439d431" style="width:100%;height:464px;"></div>
<script type="application/json" data-for="htmlwidget-a106c4adc95b2439d431">{"x":{"links":{"source":[0,1,2,2,4,4,5,6],"target":[1,2,3,4,5,6,7,7],"value":[1,1,1,1,1,1,1,1]},"nodes":{"name":["Emails","Raw data","Clean data","20230529_Sample_Notes.xlsm","WBE_Sample_Phasma-CA_20230511.Rmd","plots","dataframe","report"],"group":["Emails","Raw data","Clean data","20230529_Sample_Notes.xlsm","WBE_Sample_Phasma-CA_20230511.Rmd","plots","dataframe","report"]},"options":{"NodeID":"name","NodeGroup":"name","LinkGroup":null,"colourScale":"d3.scaleOrdinal(d3.schemeCategory20);","fontSize":12,"fontFamily":null,"nodeWidth":30,"nodePadding":10,"units":"","margin":{"top":null,"right":null,"bottom":null,"left":null},"iterations":32,"sinksRight":true}},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
</section>
</section>
<section id="operating-environment" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Operating Environment</h1>
<p>All work must be done on OCWA-provided Windows laptops in conformance with public service technology policies. Overall restrictions applicable to OCWA operating environment will restrict software installation - manager approvals as well as IT “white-list” may be required.</p>
<p>Working file may be located in the users OCWA laptop local drive, but also available in the Wastewater surveillance team network folder, which is backed-up by IT:<br>
<a href="//ocwfileeng/eng/Innov%20and%20Infra%20Services/WasteWater%20Surveillance">//ocwfileeng/eng/Innov and Infra Services/WasteWater Surveillance</a></p>
<div class=".call-out-note">
<p>To avoid issues, the whole path to local working project directory and names of script files should not have empty spaces. (The configuration of the base network directory preceding “WasteWater Surveillance” cannot be changed unfortunately)</p>
</div>
<section id="general-software" class="level2" data-number="2.1">
<h2 data-number="2.1" class="anchored" data-anchor-id="general-software"><span class="header-section-number">2.1</span> General Software</h2>
<table class="table">
<caption>Software and Versions used {#software-version}</caption>
<colgroup>
<col style="width: 21%">
<col style="width: 18%">
<col style="width: 31%">
<col style="width: 28%">
</colgroup>
<thead>
<tr class="header">
<th>Software</th>
<th>Purpose</th>
<th>Min. Version</th>
<th>(Extensions)</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Notepad ++</td>
<td>version control: pre-merging manual comparison</td>
<td>v8.5</td>
<td>Plugin: Compare v2</td>
</tr>
</tbody>
</table>
</section>
<section id="r-environment" class="level2" data-number="2.2">
<h2 data-number="2.2" class="anchored" data-anchor-id="r-environment"><span class="header-section-number">2.2</span> R Environment</h2>
<p>A reproducible environment for the project inside R is managed using the renv package. renv() package is used to manage project-local R dependency, with capability to also capture Python dependency (where the latter is run off RStudio using <em>reticulate</em>). Detailed initial set-up <a href="#renv-setup">steps</a> should be executed by authorized lead only. All other users can make use of the <em>renv.lock</em> file and project library <em>renv/library</em> to align with the working R and package versions. Different project and branches may use different versions of packages without affecting each other.</p>
<section id="package-dependencies" class="level3" data-number="2.2.1">
<h3 data-number="2.2.1" class="anchored" data-anchor-id="package-dependencies"><span class="header-section-number">2.2.1</span> Package Dependencies</h3>
<p>Based on line-by-line run of the <a href="https://github.com/InterlabsOCWA/Base_code/commit/1a4da2e5cbb78f3b97cf4cabb2dd783d574a163e">base code</a>, otherwise named as “WBE_Sample_Phasma-CA_20230607 - facet_fractionplusHK.Rmd”, the necessary packages were determined to be (flag jh - maybe take from renv.lock/github main):<br>
* ggplot2<br>
* tidyverse * fs * janitor * readxl * ggh4x * RColorBrewer * scales * writexl * devEMF * DescTools * ggpubr * officer</p>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Caution
</div>
</div>
<div class="callout-body-container callout-body">
<p>If your work requires changing versions of or adding packages, please refer to <a href="#renv-setup">steps</a> steps 2 and 3 as well as consult the team in a timely manner.</p>
<p>Any package update as well as the initial set-up should be done in consultation with the team, as it may force update of certain packages if the versions logged in the controlled lock file are no longer available from the download source. (https://stackoverflow.com/questions/60779096/error-installing-packages-using-renvrestore)</p>
</div>
</div>
<p>The following steps are referenced from <a href="https://sites.google.com/nyu.edu/nyu-hpc/hpc-systems/greene/software/r-packages-with-renv/">NYU’s introduction to renv</a>.</p>
<ol type="1">
<li>Check your version of R matches the below [flag to update periodically], using the GUI’s or by inputting:</li>
</ol>
<div class="cell">
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="in">```{r}</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a>version</span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="co"># not as necessary, but the IDE version can be checked using RStudio.Version()</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="in">```</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code> _
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 2.3
year 2023
month 03
day 15
svn rev 83980
language R
version.string R version 4.2.3 (2023-03-15 ucrt)
nickname Shortstop Beagle </code></pre>
</div>
</div>
<ol start="2" type="1">
<li><p>Make sure you have the renv installed to allow usage of renv commands below. Version 1.0.0 recommended (this version is also logged in the lockfile)</p></li>
<li><p>As part of cloning the project from version controlled branch you are working on, the <em>renv.lock</em> (as well as the renv/library, .Rprofile, renv/settings.json, and renv/activate.R files) should be found in your local repository location. Opening the cloned project at the new location, by executing the below, renv will prepare what is needed for your system to run the project, as long as the same version of R exists between systems:</p></li>
</ol>
<div class="cell">
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="do">## Reproduce environment</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>renv<span class="sc">::</span><span class="fu">restore</span>()</span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a>renv<span class="sc">::</span><span class="fu">init</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<ol start="4" type="1">
<li>If package versions in project lockfile do not match the your local library, you can follow the console instruction to generate a list of packages out of sync:</li>
</ol>
<div class="cell">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>renv<span class="sc">::</span><span class="fu">status</span>() </span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="renv-setup" class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Set up / Package library updates
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<p>The general workflow for the technical lead to initially set up with renv is:</p>
<ol type="1">
<li>Call renv::init() to initialize a new project-local environment with a private R library. The console should report back it has linked packages into the project library and written the renv.lock lockfile. Three new files and directories are created:</li>
</ol>
<ul>
<li><ol type="i">
<li>renv/library containing all packages used by the project. Each project refers to its own isolated library rather than using a common library<br>
</li>
</ol></li>
<li><ol start="2" type="i">
<li>the lockfile <em>renv.lock</em> recording metadata about every package to enable re-installation on other machines<br>
</li>
</ol></li>
<li><ol start="3" type="i">
<li>the project R profile <em>.Rprofile</em> which auto-runs when the project is started in R as a configuration file.</li>
</ol></li>
</ul>
<ol start="2" type="1">
<li><p>As the project progress, new R packages may be installed, removed or updated. After validated package changes, call renv::snapshot() to save the state of the project library to the lockfile.<br>
Option - call renv::restore() to revert to the previous state as encoded in the lockfile if the package change introduced some new problems*</p></li>
<li><p>A new commit should be made on github so that the team can update their respective local project environment. These three components must be committed to version control:<br>
</p></li>
</ol>
<ul>
<li><ol type="i">
<li>renv.lock</li>
</ol></li>
<li><ol start="2" type="i">
<li>.Rprofile</li>
</ol></li>
<li><ol start="3" type="i">
<li>renv/settings.json</li>
</ol></li>
<li><ol start="4" type="i">
<li>renv/activate.R<br>
A git-ignore file within the renv subdirectory instructs all other non-necessary files <strong>not</strong> to be saved to version control<br>
</li>
</ol></li>
</ul>
</div>
</div>
</div>
<p>For troubleshooting requiring package version check, besides cross-checking renv.lock files, refer to the package window in the corner of RStudio.</p>
<p>TBD - Currently referenced from referenced from <a href="https://sites.google.com/nyu.edu/nyu-hpc/hpc-systems/greene/software/r-packages-with-renv/">NYU’s introduction to renv</a>.<br>
When renv’s Python integration is active, a couple extra features will activate:<br>
- renv will instruct reticulate to load your project-local version of Python by default, avoiding some of the challenges with finding and selecting an appropriate version of Python on the system.<br>
- Calling reticulate::py_install() will install packages into the project’s Python environment by default.<br>
- When renv::snapshot() is called, your project’s Python library will also be captured into requirements.txt (for virtual environments) / environment.yml (for Conda environments).<br>
- Similarly, renv::restore() will also attempt to restore your Python environment, as encoded in requirements.txt / environment.yml from a previous snapshot.</p>
</section>
</section>
<section id="python" class="level2" data-number="2.3">
<h2 data-number="2.3" class="anchored" data-anchor-id="python"><span class="header-section-number">2.3</span> Python</h2>
<ul>
<li>To check your version of python, use command line or in python:</li>
</ul>
<div class="cell">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> sys</span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(sys.version)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>3.10.9 | packaged by Anaconda, Inc. | (main, Mar 1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)]</code></pre>
</div>
</div>
</section>
</section>
<section id="version-control" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Version Control</h1>
<div class="cell">
<div class="sourceCode cell-code" id="cb12"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="co">#Yuhan's section</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="do">#### II. Training/Establishing Guidelines</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a><span class="co">#1. Acquire training on and establish version control on Github *(2 weeks/July 2023)* *Deliverable: Training/Guidance document section, specifically method for & train team as soon as possible on version control/change management**\</span></span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a><span class="do">### III. Preparatory Version Control & Unit Tests</span></span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a><span class="co">#1. Establish version control on Github. All team members to abide by training guidelines when introducing changes to main code base *(2 weeks/July 2023)*\</span></span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a><span class="co"># **Deliverable: Version control workflow graphic (to incl. in Training/Guidance document)**\</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>Generic information is provided in this section, with interlabs specific practice at the next section. If you need to run any of the steps in this section, it is recommended to do so in consultation with the team (e.g. adding a new branch, new repository). Otherwise you should only need to follow the <a href="#vc-project-workflow">project specific version control steps</a> for typical work.</p>
<section id="installation-and-setup" class="level2" data-number="3.1">
<h2 data-number="3.1" class="anchored" data-anchor-id="installation-and-setup"><span class="header-section-number">3.1</span> Installation and setup</h2>
<p><strong>1. Install Git from website </strong></p>
<p>Go to <a href="https://gitforwindows.org/">Git website</a> to download and install it.</p>
<p><strong>2. Check/update git version</strong></p>
<ul>
<li>Go to the Start menu</li>
<li>In the Search or Run line type ”cmd” and press enter</li>
<li>Check git version: <code>git --version</code></li>
<li>Update git version if have git but not the latest version:<code>git update-git-for-windows</code></li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="src/versionUpdate.gif" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">git</figcaption><p></p>
</figure>
</div>
<p><strong>3. Introduce yourself to Git</strong></p>
<ul>
<li>Type the following in cmd, replacing that text in quote with your email and name, respectively:<br>
<code>git config --global user.email "you@youremail.com"</code><br>
<code>git config --global user.name "Your Name"</code></li>
<li>See result: <code>git config --global --list</code></li>
</ul>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>Note: This <strong>must</strong> be the email associated with your GitHub account.</p>
</div>
</div>
<p><strong>4. Install a Git client</strong></p>
<p>“A Git client and an integrated development environment, such as RStudio, are not necessary to use Git or R, respectively. But they make the experience more pleasant because they reduce the amount of command line and provide a richer visual representation of the current state.” (from Happy Git with R)</p>
<p>We can use Git client (e.x. <a href="https://www.gitkraken.com/">GitKraken</a>) to get a nice graphical overview of the recent commit history, branches, and diffs.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="src/gitkrakenScreenshot.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">gitkraken</figcaption><p></p>
</figure>
</div>
<p><em>Connect to Git, GitHub and RStudio</em></p>
<div class="cell">
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="co">#Comments for Yuhan </span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a><span class="co"># I would suggest that we don't need to give information on setting up new repository or branches in this doc (besides a general reference link) because we don't want people starting random repository/branches different from what you set up.</span></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a><span class="co"># instead can you walk through git clone process which Alex & Chris will need to use? </span></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a><span class="co"># if they git clone do they need to set up connection in RStudio (or command line)? if not then the current connection step can be moved away alongside making new repositories and branches</span></span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a><span class="co"># need a brief paragraph on rollback - how to use old commit hash to bring back an older version if a new commit has severe issues</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p><strong>5. Setup a new remote repository in GitHub</strong><br>
A new repository may be set up for discrete projects. (For the most part, we will be working in the base code repository at https://github.com/InterlabsOCWA/base_code) <img src="src/SetRepo.gif" class="img-fluid" alt="repo"></p>
<p><strong>6. Create branches</strong></p>
<p>To work on different versions of the base code at one time, we need to branch off the specific branch we want to work on. It will copy all the files in the branch at that point in time.</p>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>Remember to select which branch you want to branch off <strong>AND</strong> Pull it to your local after you create branch !!</p>
</div>
</div>
<p>There are two ways to create a new branch in both local and remote:</p>
<ul>
<li><p>From GitHub:</p>
<img src="src/GitHubBranch.gif" class="img-fluid" alt="gitbranch"></li>
<li><p>From Rstudio:</p>
<p>Switch to the branch you want to branch off (<a href="#branch_workflow">see switch branch section in</a>in branch workflow) then create branch followed by below image.</p>
<img src="src/RBranch.png" class="img-fluid" alt="Rbranch"></li>
</ul>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>For Rstudio method, you need to finish <strong>step 3</strong> below first.</p>
</div>
</div>
<p><strong>7. Connect Rstudio to GitHub and clone the repo to local</strong> <img src="src/RStudioConnectGitHub.gif" class="img-fluid" alt="connect"></p>
<p>After click “Create Project” to create a new directory, which will be all of these things:</p>
<ul>
<li>a folder with same remote repository name on your computer</li>
<li>a .gitignore file</li>
<li>an RStudio Project</li>
<li>any files you upload into remote rpository</li>
</ul>
<p><strong>8. Detect Git from RStudio</strong></p>
<ul>
<li>Type <code>where git</code> in cmd to get the git executable path</li>
<li>From RStudio, go to <em>Tools > Global Options > Git/SVN</em> and make sure that the box <em>Git executable</em> points to your Git executable. <img src="src/detect.png" class="img-fluid" alt="detect"></li>
</ul>
</section>
<section id="branch_workflow" class="level2" data-number="3.2">
<h2 data-number="3.2" class="anchored" data-anchor-id="branch_workflow"><span class="header-section-number">3.2</span> Fundamentals branch workflow</h2>
<p><strong>Overall flow chart</strong></p>
<p>The image below shows a overall git flow chart. <img src="src/flow.png" class="img-fluid" alt="flow"></p>
<p><strong>1. Switch to corresponding branch</strong></p>
<p>Since different people can be working on different branches, before starting our work, we need to switch to our <a href="#vc-project-workflow">working branch</a>. There are two methods to switch between branch:</p>
<ul>
<li><p>In Rstudio:</p>
<p>Select the remote branch you want to work on by clicking the bottom (see image below), it will automatically create and switch to that local branch.</p>
<img src="src/SwitchBranch.png" class="img-fluid" alt="Rbranch"></li>
<li><p>In Shell: type <code>$ git checkout <branch_name></code> in terminal</p></li>
</ul>
<p><strong>2. Pull from remote</strong></p>
<p>To start working on a project, pull any new changes to update local copy. If there is a merge conflict see <a href="#merge_conflict">merge_conflict section</a>.</p>
<ul>
<li><p>In Rstudio: Click the <strong>Pull</strong> bottom in the <strong>Git</strong> tab section</p></li>
<li><p>In Shell: type <code>$ git pull</code> in terminal</p></li>
</ul>
<p><strong>3. Make changes and commit</strong></p>
<ul>
<li>After finishing changes, click on the <strong>Git</strong> tab in RStudio. It will show the files that have changed or added.</li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="src/git.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">git</figcaption><p></p>
</figure>
</div>
<ul>
<li>Click on the <strong>Commit</strong>, it will show the window in below image. Click the staged box to stage the file you want to push to remote. You can see the difference between the files after you click the file (show blue line). Lines that have been added are green. Lines that have been removed are red.</li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="src/diff.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">diff</figcaption><p></p>
</figure>
</div>
<ul>
<li><p>Add a commit message and click on <strong>Commit</strong> in this window. Every time make a commit, must also write a short <strong>commit message</strong>.</p></li>
<li><p>You can view the history of your commit after click the left corner <strong>History</strong> beside the change. You can also view the commit history in other Git client app. Or check your past commits though type <code>git log</code> in terminal.</p></li>
<li><p>Check on the state of the Git world: type <code>git status</code> in terminal</p></li>
</ul>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>For the files you don’t want to push to Github you can list the them in <a href="#gitignore"><strong>.gitignore</strong> file</a>.</p>
</div>
</div>
<p><strong>4. Push</strong></p>
<p>When you are finished and committed, remember to <strong>Push</strong> these changes to the remote repository (e.g., GitHub). Should see ‘branch -> branch’ if successfully pushed.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>You might need to pull again before push, if someone pushed their work to remote during your work.</p>
</div>
</div>
<section id="pullrequest" class="level4" data-number="3.2.0.1">
<h4 data-number="3.2.0.1" class="anchored" data-anchor-id="pullrequest"><span class="header-section-number">3.2.0.1</span> Pull Request and Merge Changes between branches</h4>
<p>Each time you want to merge/pull a branch from another branch, you will need to create a pull request. Sometimes it will show up automatically in the branch web page after you push, if not you need to do it manually.</p>
<ul>
<li><p>For the first auto case, you will see a notice to create a pull request (see the image below). Then click on the button that says <strong>Compare and pull request</strong> to go next step. <img src="src/pullrequest.png" class="img-fluid" alt="pull_auto"></p></li>
<li><p>For the manual case, first need to click the <strong>Pull request</strong> tab. Then click the button that says <strong>New pull request</strong>. It will show up the <strong>Compare changes</strong> page, you need to decide the pull direction. The compare branch is the one you want to pull from. After decide the branches, click <strong>Create pull request</strong> button and go next step.</p></li>
<li><p>Now both case are in the same <strong>Open a pull request</strong> page, and click on <strong>Create pull request</strong> to compare and merge them.</p></li>
<li><p>GitHub has now compared the two versions of the project that are in the two branches. If there is no conflict it is telling us that there are no conflicts between the two versions and you can click the green <strong>Merge pull request</strong> button to merge the changes.</p></li>
<li><p>If you don’t need the branch (e.x. feature branch), click <strong>Confirm merge</strong>. Go ahead and delete the branch, since its changes have been incorporated, with the <strong>Delete branch</strong> button in the purple box. <img src="src/successMerge.png" class="img-fluid" alt="success"></p></li>
</ul>
<p>The manual pull request process: <img src="src/manualpullrequest.gif" class="img-fluid" alt="manual"></p>
</section>
<section id="merge_conflict" class="level4" data-number="3.2.0.2">
<h4 data-number="3.2.0.2" class="anchored" data-anchor-id="merge_conflict"><span class="header-section-number">3.2.0.2</span> Merge conflict</h4>
<p>There will be a merge conflict when you pull from the remote but have done some new work locally since the last time you pulled:</p>
<ul>
<li><p>Recent commit history of origin/main: A–B–C</p></li>
<li><p>Recent commit history of the local main branch: A–B–D</p></li>
</ul>
<p>It will show the warning below and automatically add the two version with markers in that file.</p>
<pre><code>'CONFLICT (content): Merge conflict in ...(the file have conflict)
Automatic merge failed; fix conflicts and then commit the result.'
</code></pre>
<ul>
<li>The code between the <<<<<<< HEAD and ======= line is the content you committed in your local and the code between the ======= and >>>>>>> line is the content in the current remote branch.</li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="src/mergeconflict.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">marker</figcaption><p></p>
</figure>
</div>
<ul>
<li>Keep the version you want and remove the all the markers line (<<<<<<< HEAD:, ======, >>>>>>) inserted to demarcate the conflicts then save the file and do the following commit and push again.</li>
</ul>
</section>
<section id="gitignore" class="level3" data-number="3.2.1">
<h3 data-number="3.2.1" class="anchored" data-anchor-id="gitignore"><span class="header-section-number">3.2.1</span> gitignore file</h3>
<p>The .gitignore file can tell Git which files and directories to ignore when you make a commit. You can commit and push the .gitinore file to share the ignore rules with other users.</p>
<p>The .gitigonre content writing reference: <a href="https://swcarpentry.github.io/git-novice/06-ignore.html" class="uri">https://swcarpentry.github.io/git-novice/06-ignore.html</a></p>
<p>The data/files we don’t want to commit to GitHub:</p>
<ul>
<li>all the data spread sheet</li>
<li>plots</li>
<li>reports</li>
</ul>
</section>
</section>
<section id="vc-project-workflow" class="level2" data-number="3.3">
<h2 data-number="3.3" class="anchored" data-anchor-id="vc-project-workflow"><span class="header-section-number">3.3</span> Version control project workflow</h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="co">#Comments for Yuhan </span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="co">#- need the graphic cleaned up so it makes sense to a regular reader like Alex - e.g. what does it mean CA will mainly work here? next round could be you or I, need the description for the task not a person</span></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a><span class="co"># what is JIRA-35 example feature? can you change this example to match something we might see in interlabs. also use our naming convention which applies to branches as well (so the double dash and space are not acceptable)</span></span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a><span class="co"># bottom comment - "feel free [...]" can you add the note about how the feature or develop branch gets merged? It's a note to yourself (I think) so don't leave it for the reader)</span></span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a><span class="co">#TBD</span></span>
<span id="cb15-7"><a href="#cb15-7" aria-hidden="true" tabindex="-1"></a><span class="co"># explain bare min. information you need with commit message like you started with the annotation under the round dots. Initial name is probably the least important info in the commit since git would track who pushed the change anyways? not sure</span></span>
<span id="cb15-8"><a href="#cb15-8" aria-hidden="true" tabindex="-1"></a><span class="co"># explain how each dot is a commit like a save point we can revert to by knowing the commit hash e.g. commit ba9da59 </span></span>
<span id="cb15-9"><a href="#cb15-9" aria-hidden="true" tabindex="-1"></a><span class="co"># I moved the home folder description up right beneath the diagram. We need a description of the normal working "place" (the git clone local - you mentioned in the general set up for setting up a new repository but can you add description of how it would be like for our project base code? especially with branches - does the user need to git clone each branch into a separate folder, or can they switch after git cloning the main? this needs to be very clear assuming the reader is a new student , for example). How often are we to sync/commit to github from local? Then, back to the network folder home locations - how often are these to be "synced" with the github versions? Decide on a frequency and that will become part of the QMS requirement for data management.</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p><strong>The overall workflow graph of version control</strong></p>
<p>The diagram below shows the overall version control workflow for each round.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="src/workflow.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">workflow</figcaption><p></p>
</figure>
</div>
<p>The corresponding locations for the branches in the network drive are as follows (Flag: Need to confirm).</p>
<ul>
<li><p>The home folder locations for <strong>main</strong> branch:</p>
<p>//ocwfileeng/eng/Innov and Infra Services/WasteWater Surveillance/3_Templates_References/Round_codes</p></li>
<li><p>The home folder locations for <strong>Round</strong> branch:</p>
<p>//ocwfileeng/eng/Innov and Infra Services/WasteWater Surveillance/4_WIP/O103-Interlabs/d_Code</p></li>
<li><p>The home folder locations for <strong>develop</strong> branch:</p>
<p>//ocwfileeng/eng/Innov and Infra Services/WasteWater Surveillance/1_QMS</p></li>
</ul>
<section id="main-branch" class="level3" data-number="3.3.1">
<h3 data-number="3.3.1" class="anchored" data-anchor-id="main-branch"><span class="header-section-number">3.3.1</span> Main branch</h3>
<p>The main branch contains the base code template that will be updated during each round, so we need to upload/ push the initial files at beginning. A workshop will be hold to compare the files using <a href="#notepad">Notepad++</a> and decide the merge request before merging the subbranch to main.</p>
<div id="notepad" class="quarto-figure quarto-figure-center anchored">
<figure class="figure">
<p><img src="img/premergeDiffNotepad.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Cross-checking in Notepad++ prior merge</figcaption><p></p>
</figure>
</div>
<div class="callout callout-style-default callout-warning callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Warning
</div>
</div>
<div class="callout-body-container callout-body">
<p>People should not switch to main branch and make changes to it during work.</p>
</div>
</div>
</section>
<section id="round-branch" class="level3" data-number="3.3.2">
<h3 data-number="3.3.2" class="anchored" data-anchor-id="round-branch"><span class="header-section-number">3.3.2</span> Round branch</h3>
<p>The round branch contains current round code, it will be update during each round.</p>
<p>The workflow for round branch:</p>
<ol type="1">
<li>Create manual <a href="#pullrequest">pull request</a> to update the round branch from main in GitHub.</li>
<li>Do the <a href="#branch_workflow">branch workflow</a> steps.</li>
<li>After finished this round code, create pull request to merge to main branch.</li>
</ol>
<p>Q: need feature branch for this?</p>
<div class="callout callout-style-default callout-warning callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Warning
</div>
</div>
<div class="callout-body-container callout-body">
<p>For step 3, only need to create pull request. Do not need to merge it!</p>
</div>
</div>
</section>
<section id="develop-branch" class="level3" data-number="3.3.3">
<h3 data-number="3.3.3" class="anchored" data-anchor-id="develop-branch"><span class="header-section-number">3.3.3</span> Develop branch</h3>
<p>The code refactoring work will in this branch.</p>
<p>The workflow for round branch:</p>
<ol type="1">
<li>Create manual <a href="#pullrequest">pull request</a> to update the round branch from main in GitHUb.</li>
<li>Do the <a href="#branch_workflow">branch workflow</a> steps.</li>
<li>Might need to create feature branch to add new feature to the base code.</li>
<li>After finished this round code, create pull request to merge to main branch.</li>
</ol>
<div class="callout callout-style-default callout-warning callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Warning
</div>
</div>
<div class="callout-body-container callout-body">
<p>For step 4, only need to create pull request. Do not need to merge it!</p>
</div>
</div>
<section id="unsolved-questions" class="level4" data-number="3.3.3.1">
<h4 data-number="3.3.3.1" class="anchored" data-anchor-id="unsolved-questions"><span class="header-section-number">3.3.3.1</span> Unsolved questions</h4>
<ul>
<li>Zombie code: cut off but might come back?</li>
</ul>
</section>
</section>
</section>
</section>
<section id="issues-tracking" class="level1" data-number="4">
<h1 data-number="4"><span class="header-section-number">4</span> Issues Tracking</h1>
<p>For most cases, the project issues tab in GitHub should be used to log issues (including bugs and features suggestions) and assign staff to resolve, using this <a href="https://docs.github.com/en/issues/tracking-your-work-with-issues/quickstart">workflow</a> within repositories set up as projects.</p>
<p>Issues are repository wide (i.e. cannot be “created” specific to a branch). To aid tracking, the title of the issue should state the specific branch it is for. Additionally, it is encouraged to add labels to help identify type of issue and the branch it is for. A partial exception is features request which, after being created as an issue in the appropriate parent branch, should be made its own branch to differentiate it even more.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="img/githubIssuesCreate.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Issues creation and syntax</figcaption><p></p>
</figure>
</div>
<ol type="1">
<li><p><a href="https://github.com/InterlabsOCWA/base_code/issues">Creating an issue</a><br>
The required syntax for issues title is as follows:<br>
Title: <em>Branch</em>-<em>Type</em>_<em>Descriptor</em><br>
Where Branch = <em>branch name</em> e.g. should primarily develop unless you are reporting a bug on the round branch Where Type = feature OR bug OR refactor, for example Where Descriptor = short human-readable descriptor of request</p></li>
<li><p>Adding details (click on the gear icons on the right panel of the github issue page to add the following)<br>
</p></li>
</ol>
<ul>
<li><em>Label</em> appropriately by branch and any other help tags at the right panel</li>
<li>Assign <em>Project</em> (usually the “<span class="citation" data-cites="InterlabsOCWA">@InterlabsOCWA</span>’s BaseCode”) at the right panel</li>
<li>Assign <em>Assignee</em> as the lead staff responsible</li>
<li>Provide sufficient context in the <em>comment</em> box in case other staff need to follow up on the issue</li>
<li>if this is a new feature, once the issue is submitted and there is to resource to tackle the feature addition, the user should (reload the issue page) create a new branch for it under the development section, right panel. The branch should be a branch off from the develop branch, as illustrated below.<br>
<img src="img/githubIssuesBranch.gif" class="img-fluid" alt="Issues creation and syntax"></li>
</ul>
<ol start="3" type="1">
<li><p>Update as appropriate, with commit hash if it is tied to a specific upload version. By placing a commit hash, github will automatically provide a link to that committed version.</p></li>
<li><p>Resolve and close.<br>
</p></li>
</ol>
<ul>
<li>Bugs: When resolved, staff should closed issue with sufficiently detailed comment for potential future reference, and include the git commit hash of the version pre/post-fix if appropriate. Bugs should be resolved at the develop or round branches; for merges into the main branch, consult the team or wait until the milestone merges.</li>
<li>Features request & refactoring tasks: these changes are to be reviewed by staff other than the coder to validate functionality & impacts. Reviewer should close the issue once that is confirmed. The git commit hash should be logged in the closure comment.</li>
</ul>
</section>
<section id="linting-code-style-guide" class="level1" data-number="5">
<h1 data-number="5"><span class="header-section-number">5</span> Linting / Code Style Guide</h1>
<p><em>General</em> The <a href="https://style.tidyverse.org/">tidyverse style</a> will be the default style, and aligns with the lintr package used below. It is recommended for all users to review the guide. Some general format rules include:<br>
* camelCase recommended (note tidyverse style guide prefers snake case but both are acceptable) * tab indentation by two spaces <em>Linting - continuous integration</em> In RStudio IDE:<br>
<em>-</em> some linting is included, however it is for errors only <em>-</em> selecting code and hitting Ctrl + I will re-indent code for you</p>
<p><em>lintr</em>:<br>
lintr package will be set up with the main code to provide diagnostic linting (i.e. as opposed to auto-correction using stylr package), recommending but not enforcing stylistic changes. It will activate with github upload workflows following this set up command, which also creates a <strong>.github/workflows</strong> folder with <strong>lint.yaml</strong></p>
<div class="cell">
<div class="sourceCode cell-code" id="cb16"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>usethis<span class="sc">::</span><span class="fu">use_github_action</span>(<span class="st">"lint"</span>)</span>
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a><span class="co"># for context, check in console - vignette("continuous-integration")</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>Once lintr is installed, it can be accessed in RStudio. In order to see the diagnostic results, first enable the “Markers” pane by > “Tools” > “Global Options…” > go to “Code” on the left-hand-side > “Diagnostics” tab > check “Show diagnostics for R”. The Markers pane will then be available tabbed next to Console/Terminal/Background Jobs to display lint results.</p>
<p>To run lintr, open Tools > Addins. From the pop-up window, select lintr from the addin’s list and execute on the open code file.<br>
<img src="img/lintrRStudio.png" class="img-fluid"></p>
<p>::: {.callout-note} You can bind this linting process to a keyboard shortcut in RStudio in the addin’s window, with Shift+Alt+L recommended * The user may then use the lintr result in the Markers pane as a guide to modify code format. Automated linting (e.g. styler package) is not recommended at this point. More options for linting and details are available for reference at https://blog.r-hub.io/2022/03/21/code-style/ :::</p>
</section>
<section id="refactoring" class="level1" data-number="6">
<h1 data-number="6"><span class="header-section-number">6</span> Refactoring</h1>
<ul>
<li>recommend every x period</li>
<li>workflow</li>
</ul>
<section id="unit-testing-approaches-practices" class="level2" data-number="6.1">
<h2 data-number="6.1" class="anchored" data-anchor-id="unit-testing-approaches-practices"><span class="header-section-number">6.1</span> unit testing approaches & practices</h2>
<p>*At the minimum, we should aim to write tests for the “happy path” of our application.</p>
<p>What is a “happy path” test? “Happy path” tests are very useful, because they catch the most critical bugs, but are definitely not sufficient for building reliable and robust applications.* https://effectivecio.com/2009/11/02/the-happy-path/</p>
<p>The happy path is the path through a system where everything works, the data is correct, the system stays up, and the users are well-behaved. We tend to test the happy path first because we understand how the system should function and want to ensure that the basic features should work. We need to move off the happy path and wander in the weeds. What if the quantity exceeds stock on hand? What if the user enters too few digits from their credit card? Or too many? Or adds a space, or a dash? What if the zip code doesn’t match the state? What if? What if? What if?</p>
<p>It doesn’t take long to test the happy path. It takes forever to test everything off the happy path. You need to spend a lot of time wandering away from the happy path, and maybe there is a reverse rule for testing: 20% of your time on the happy path; 80% of your time off of it.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="http://codeutopia.net/blog/2015/04/11/what-are-unit-testing-integration-testing-and-functional-testing/.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">What are Unit Testing, Integration Testing and Functional Testing?</figcaption><p></p>
</figure>
</div>
<p>Automated testing is the practice of writing code to programmatically test the actual code we want to write.</p>
<p>It offers several benefits over manual testing:</p>
<p>it saves testing time (by not having to perform manual tests over and over) it saves debugging time (by catching bugs earlier) it makes it easier to program (because we don’t need to keep the entire application in our heads, just the part that we’re working on… if we break something, our tests will let us know) it makes it easier to come back to a program after some time (programmers forget things, but tests do not) it makes it easier to work together (we wrote some widget and know how it works, but our team-mates probably don’t; our tests will catch bugs introduced by others on our team, and vice versa) it acts as documentation (readings tests is a great way to learn about how code is meant to be used) it improves the quality of our code (writing code that is easy to test often requires us to change how our code is structured – for the better) ## Issues-tracking method</p>
<ol start="7" type="1">
<li>Document the procedures for above practices and create training presentations for the team <em>(3 weeks)</em><br>
<strong>Deliverable: Training/Guidance document</strong><br>
<strong>Deliverable: Training session</strong></li>
</ol>
</section>
<section id="unit-testing-framework" class="level2" data-number="6.2">
<h2 data-number="6.2" class="anchored" data-anchor-id="unit-testing-framework"><span class="header-section-number">6.2</span> Unit Testing Framework</h2>
<ol start="2" type="1">
<li>Set up formal testing, enabling validation of no-loss-of-function and establishing built-in “bases” during refactoring. <em>(August 2023)</em> <strong>Deliverable: Test framework & test-suite code</strong></li>
</ol>
<p>Cursory review in June 2023 found that base code functions (more suitable for testing) are few and generally used to generate plots (unsuitable for testing). Testing may be adapted to instead inspect dataframe size & output value spot-check.</p>
<hr>
<ol type="1">
<li>Packages/Libraries organization <em>(3 weeks / July 2023)</em>:
<ol type="1">
<li>create reference document of package purpose/usage in the program (including any removed but potentially useful)</li>
<li>remove any currently unused packages, narrowing list/call to just the necessary ones</li>
<li>create packrat compilation or Docker of used packages to preserve running versions<br>
<strong>Metric: Number of superfluous packages/libraries, number TBD to 0</strong><br>
<strong>Deliverable: One packrat / docker with all in-use packages including versions</strong></li>
</ol></li>
<li>Linting for consistent style <em>(1 week; August 2023)</em><br>
<strong>Deliverable: Commit [track number]</strong><br>
</li>
<li>Refactoring cycle, which will be repeated for each issue/potential improvment. As adapted from Fowler: 0.1 Select issue/potential improvement to work on. Create branch on version control 0.2 Introduce comments/pseudo-code for changes. Obtain consensus with <em>reviewer</em><br>
<strong>Deliverable: Branch & Commit [track number]</strong>
<ol type="1">
<li>Create getters and setters for the field<br>
</li>
<li>Locate all references: replace access with calls to the getter, and changes to the field with calls to the setter<br>
</li>
<li>Compile and test after changing each reference<br>
</li>
<li>Declare the field as private<br>
</li>
<li>Compile and test. Switch to light mode for coder & reviewer<br>
</li>
<li><em>Reviewer</em> checks pull request, code and merge. Light mode for all users<br>
<strong>Deliverable: Commit [track number]</strong></li>
</ol></li>
<li>Documentation updates<br>
<strong>Deliverable: Code & Guidance Documentation Updates, Inventory of updated intra/external code relationships </strong></li>
</ol>
<section id="table-3---milestone-deliverables-tentative-schedule" class="level3" data-number="6.2.1">
<h3 data-number="6.2.1" class="anchored" data-anchor-id="table-3---milestone-deliverables-tentative-schedule"><span class="header-section-number">6.2.1</span> Table 3 - Milestone Deliverables & Tentative Schedule</h3>
<table class="table">
<colgroup>
<col style="width: 61%">
<col style="width: 31%">
<col style="width: 6%">
</colgroup>
<thead>
<tr class="header">
<th>Deliverable</th>
<th>Timeline [In Progress/Completed]</th>
<th>Resp./Review</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Code Documentation</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>1.Inventory & flowchart of external relationships</td>
<td>Summer 2023 / July 2023</td>
<td></td>
</tr>
<tr class="odd">
<td>2.Inventory & flowchart of intra-basecode relationships</td>
<td>Summer 2023 / July 2023</td>
<td></td>
</tr>
<tr class="even">
<td>3.Packages/Libraries Listing</td>
<td>Summer 2023 / July 2023</td>
<td></td>
</tr>
<tr class="odd">
<td>4.Code Documentation - existing code comments archival</td>
<td>Summer 2023 / July 2023</td>
<td></td>
</tr>
<tr class="even">
<td>5.Kaban battle board (initial version)</td>
<td>Summer 2023 / July 2023</td>
<td></td>
</tr>
<tr class="odd">
<td>Training/Guidelines</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>6a.Guidance Documentation - Version Control & Issues resolution</td>
<td>Summer 2023 / July 2023</td>
<td></td>
</tr>
<tr class="odd">
<td>6b.Guidance Documentation - Refactoring & Unit Testing</td>
<td>Summer 2023 / August 2023</td>
<td></td>
</tr>
<tr class="even">
<td>6c.Guidance Documentation - Linting, Selected Style</td>
<td>Summer 2023 / July 2023</td>
<td></td>
</tr>
<tr class="odd">
<td>Preparatory Staging</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>7.Version control established, team training session</td>
<td>August 2023</td>
<td></td>
</tr>
<tr class="odd">
<td>8.Testing framework</td>
<td>August / September 2023</td>
<td></td>
</tr>
<tr class="even">
<td>Refactoring</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>9.Refactoring cycles</td>
<td>Autumn 2023 / November 2023?</td>
<td></td>
</tr>
<tr class="even">
<td>10a.Code & Guidance Documentation Updates</td>
<td>Autumn 2023 / November 2023?</td>
<td></td>
</tr>
<tr class="odd">
<td>10b.Inventory of updated intra/external relationships, packages</td>
<td>Ongoing / December 2023</td>
<td></td>
</tr>
<tr class="even">
<td>11.Training sessions, monthly</td>
<td>Ongoing</td>
<td></td>
</tr>
<tr class="odd">
<td>12.Project Completion Memo, performance metric</td>
<td>January 2023</td>
<td></td>
</tr>
<tr class="even">
<td></td>
<td></td>
<td></td>
</tr>