Skip to content

Commit fd1b2bd

Browse files
authored
Code structure update (#192)
* introduce pyproject * annotations * add optional exercise on apis testing * small updates to modules * update good coding practice to use ruff * update pre-commit and action to use ruff * ruff in pre-commit * annotation in command line * code structure * update code structure * update actions to ruff * fixes * fixes --------- Co-authored-by: Nicki Skafte Detlefsen <nsde@dtu.dk>
1 parent 73a4b0e commit fd1b2bd

File tree

12 files changed

+501
-184
lines changed

12 files changed

+501
-184
lines changed

figures/cookie_cutter.png

172 KB
Loading

figures/system_difference.drawio

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<mxfile host="Electron" modified="2023-11-01T14:39:49.245Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="f11-JNVVP3R3L51FsfxN" version="22.0.3" type="device">
2+
<diagram name="Page-1" id="6nIDLG34nHsw9krd193v">
3+
<mxGraphModel dx="1220" dy="827" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
<mxCell id="sHEHEselU_2R8SYliwzN-30" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
8+
<mxGeometry x="80" y="110" width="740" height="630" as="geometry" />
9+
</mxCell>
10+
<mxCell id="sHEHEselU_2R8SYliwzN-1" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Code&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#0050ef;fontColor=#ffffff;strokeColor=#001DBC;" vertex="1" parent="1">
11+
<mxGeometry x="224" y="160" width="160" height="130" as="geometry" />
12+
</mxCell>
13+
<mxCell id="sHEHEselU_2R8SYliwzN-2" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Running System&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#60a917;fontColor=#ffffff;strokeColor=#2D7600;" vertex="1" parent="1">
14+
<mxGeometry x="434" y="160" width="160" height="130" as="geometry" />
15+
</mxCell>
16+
<mxCell id="sHEHEselU_2R8SYliwzN-4" value="" style="html=1;shadow=0;dashed=0;align=center;verticalAlign=middle;shape=mxgraph.arrows2.arrow;dy=0.6;dx=40;notch=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
17+
<mxGeometry x="379" y="220" width="60" height="30" as="geometry" />
18+
</mxCell>
19+
<mxCell id="sHEHEselU_2R8SYliwzN-6" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Unit Tests&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#1ba1e2;fontColor=#ffffff;strokeColor=#006EAF;" vertex="1" parent="1">
20+
<mxGeometry x="234" y="270" width="110" height="40" as="geometry" />
21+
</mxCell>
22+
<mxCell id="sHEHEselU_2R8SYliwzN-7" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Integration Tests&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#1ba1e2;fontColor=#ffffff;strokeColor=#006EAF;" vertex="1" parent="1">
23+
<mxGeometry x="354" y="270" width="110" height="40" as="geometry" />
24+
</mxCell>
25+
<mxCell id="sHEHEselU_2R8SYliwzN-8" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;System Monitoring&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="1">
26+
<mxGeometry x="474" y="270" width="110" height="40" as="geometry" />
27+
</mxCell>
28+
<mxCell id="sHEHEselU_2R8SYliwzN-9" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Code&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#0050ef;fontColor=#ffffff;strokeColor=#001DBC;" vertex="1" parent="1">
29+
<mxGeometry x="136" y="500" width="160" height="130" as="geometry" />
30+
</mxCell>
31+
<mxCell id="sHEHEselU_2R8SYliwzN-10" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Model Training&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#a20025;fontColor=#ffffff;strokeColor=#6F0000;" vertex="1" parent="1">
32+
<mxGeometry x="346" y="500" width="160" height="130" as="geometry" />
33+
</mxCell>
34+
<mxCell id="sHEHEselU_2R8SYliwzN-26" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0;entryDx=30;entryDy=21;strokeWidth=4;entryPerimeter=0;sketch=1;curveFitting=1;jiggle=2;" edge="1" parent="1" source="sHEHEselU_2R8SYliwzN-11" target="sHEHEselU_2R8SYliwzN-18">
35+
<mxGeometry relative="1" as="geometry">
36+
<mxPoint x="800" y="380" as="targetPoint" />
37+
<Array as="points">
38+
<mxPoint x="800" y="565" />
39+
<mxPoint x="800" y="390" />
40+
<mxPoint x="466" y="390" />
41+
<mxPoint x="466" y="440" />
42+
</Array>
43+
</mxGeometry>
44+
</mxCell>
45+
<mxCell id="sHEHEselU_2R8SYliwzN-27" value="Feedback loop" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=14;" vertex="1" connectable="0" parent="sHEHEselU_2R8SYliwzN-26">
46+
<mxGeometry x="-0.0687" y="5" relative="1" as="geometry">
47+
<mxPoint y="10" as="offset" />
48+
</mxGeometry>
49+
</mxCell>
50+
<mxCell id="sHEHEselU_2R8SYliwzN-11" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Running System&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#60a917;fontColor=#ffffff;strokeColor=#2D7600;" vertex="1" parent="1">
51+
<mxGeometry x="554" y="500" width="160" height="130" as="geometry" />
52+
</mxCell>
53+
<mxCell id="sHEHEselU_2R8SYliwzN-12" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Unit Tests&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#1ba1e2;fontColor=#ffffff;strokeColor=#006EAF;" vertex="1" parent="1">
54+
<mxGeometry x="156" y="620" width="110" height="40" as="geometry" />
55+
</mxCell>
56+
<mxCell id="sHEHEselU_2R8SYliwzN-13" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Integration Tests&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#1ba1e2;fontColor=#ffffff;strokeColor=#006EAF;" vertex="1" parent="1">
57+
<mxGeometry x="286" y="620" width="280" height="40" as="geometry" />
58+
</mxCell>
59+
<mxCell id="sHEHEselU_2R8SYliwzN-14" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;System Monitoring&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="1">
60+
<mxGeometry x="586" y="620" width="110" height="40" as="geometry" />
61+
</mxCell>
62+
<mxCell id="sHEHEselU_2R8SYliwzN-15" value="" style="html=1;shadow=0;dashed=0;align=center;verticalAlign=middle;shape=mxgraph.arrows2.arrow;dy=0.6;dx=40;notch=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
63+
<mxGeometry x="291" y="550" width="60" height="30" as="geometry" />
64+
</mxCell>
65+
<mxCell id="sHEHEselU_2R8SYliwzN-16" value="" style="html=1;shadow=0;dashed=0;align=center;verticalAlign=middle;shape=mxgraph.arrows2.arrow;dy=0.6;dx=40;notch=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
66+
<mxGeometry x="501" y="550" width="60" height="30" as="geometry" />
67+
</mxCell>
68+
<mxCell id="sHEHEselU_2R8SYliwzN-18" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Training &lt;br&gt;Data&lt;/font&gt;" style="html=1;shadow=0;dashed=0;align=center;verticalAlign=middle;shape=mxgraph.arrows2.arrow;dy=0.6;dx=40;direction=south;notch=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
69+
<mxGeometry x="391" y="410" width="70" height="100" as="geometry" />
70+
</mxCell>
71+
<mxCell id="sHEHEselU_2R8SYliwzN-19" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;ML Infrastructure Tests&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#1ba1e2;fontColor=#ffffff;strokeColor=#006EAF;" vertex="1" parent="1">
72+
<mxGeometry x="260" y="470" width="110" height="40" as="geometry" />
73+
</mxCell>
74+
<mxCell id="sHEHEselU_2R8SYliwzN-17" value="&lt;font style=&quot;font-size: 15px;&quot;&gt;Data Tests&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#1ba1e2;fontColor=#ffffff;strokeColor=#006EAF;" vertex="1" parent="1">
75+
<mxGeometry x="312" y="390" width="110" height="40" as="geometry" />
76+
</mxCell>
77+
<mxCell id="sHEHEselU_2R8SYliwzN-20" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Skew Tests&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#1ba1e2;fontColor=#ffffff;strokeColor=#006EAF;" vertex="1" parent="1">
78+
<mxGeometry x="476" y="480" width="110" height="40" as="geometry" />
79+
</mxCell>
80+
<mxCell id="sHEHEselU_2R8SYliwzN-21" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Inference&lt;br&gt;Data&lt;/font&gt;" style="html=1;shadow=0;dashed=0;align=center;verticalAlign=middle;shape=mxgraph.arrows2.arrow;dy=0.6;dx=40;direction=south;notch=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
81+
<mxGeometry x="599" y="410" width="70" height="100" as="geometry" />
82+
</mxCell>
83+
<mxCell id="sHEHEselU_2R8SYliwzN-22" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Data Monitoring&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;curveFitting=1;jiggle=2;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="1">
84+
<mxGeometry x="669" y="480" width="110" height="40" as="geometry" />
85+
</mxCell>
86+
<mxCell id="sHEHEselU_2R8SYliwzN-28" value="&lt;font style=&quot;font-size: 20px;&quot;&gt;Traditional System Testing and Monitoring&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
87+
<mxGeometry x="219" y="330" width="380" height="30" as="geometry" />
88+
</mxCell>
89+
<mxCell id="sHEHEselU_2R8SYliwzN-29" value="&lt;font style=&quot;font-size: 20px;&quot;&gt;ML-Based System Testing and Monitoring&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
90+
<mxGeometry x="219" y="680" width="380" height="30" as="geometry" />
91+
</mxCell>
92+
</root>
93+
</mxGraphModel>
94+
</diagram>
95+
</mxfile>

figures/system_difference.drawio.png

407 KB
Loading

figures/understand_code_joke.jpg

92.4 KB
Loading

s1_development_environment/command_line.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ command line.
7272
1. Start by opening a terminal.
7373

7474
2. To navigate inside a terminal, we rely on the `cd` command and `pwd` command. Make sure you know how to go back and
75-
forth in your file system. HINT: try [tab-completion](https://en.wikipedia.org/wiki/Command-line_completion) to
76-
save some time.
75+
forth in your file system. (1)
76+
{ .annotate }
77+
78+
1. :man_raising_hand: Your terminal should support
79+
[tab-completion](https://en.wikipedia.org/wiki/Command-line_completion) which can help finish commands for you!
7780

7881
3. The `ls` command is important when we want to know the content of a folder. Try to use the command, and also try
7982
it with the additional option `-l`. What does it show?

s2_organisation_and_version_control/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ working in large groups that the difference in how different people organize and
1616
The topics in this session will focus on:
1717

1818
* Version control for helping tracking and managing changes to your code and data
19-
* Coding practices for staying organized in lar
19+
* Coding practices for staying organized in large projects
2020

2121
<figure markdown>
2222
![Image](../figures/wtf.jpeg){ width="700" }

0 commit comments

Comments
 (0)