feat(presentation): tweaks
This commit is contained in:
@@ -4,16 +4,21 @@
|
||||
title: "Midas: mieux typer Python",
|
||||
subtitle: "Présentation intermédiaire",
|
||||
short-title: "Midas",
|
||||
supervisor: "Superviseure",
|
||||
"context": "Contexte",
|
||||
problematic: "Problématique",
|
||||
case-1: [Cas 1 -- Type != sémantique],
|
||||
case-2: [Cas 2 -- Erreur de type _at runtime_],
|
||||
goal: "Objectif",
|
||||
gradual-typing: [Typage graduel (_gradual typing_)],
|
||||
static-type-checking: [Vérification statique],
|
||||
optional-typing: "Typage optionnel",
|
||||
static-type-checking: "Vérification statique",
|
||||
dynamic-checks: "Vérificiations dynamiques",
|
||||
runtime-assertions: [Assertions _at runtime_],
|
||||
value-constraints: "Contraintes de valeur",
|
||||
example: "Exemple",
|
||||
lat-lon-error: "Invalide, même si float+float est valide",
|
||||
planning: "Planification",
|
||||
initial-planning: "Planification initiale",
|
||||
week: "Semaine",
|
||||
objectives: "Objectifs",
|
||||
@@ -40,16 +45,21 @@
|
||||
title: "Midas: better type checking in Python",
|
||||
subtitle: "Halfway presentation",
|
||||
short-title: "Midas",
|
||||
supervisor: "Supervisor",
|
||||
"context": "Context",
|
||||
problematic: "Problematic",
|
||||
case-1: [Case 1 -- Type != semantic],
|
||||
case-2: [Case 2 -- Runtime type error],
|
||||
goal: "Goal",
|
||||
gradual-typing: "Gradual typing",
|
||||
optional-typing: "Optional typing",
|
||||
static-type-checking: "Static type checking",
|
||||
dynamic-checks: "Dynamic checks",
|
||||
runtime-assertions: "Runtime assertions",
|
||||
value-constraints: "Value constraints",
|
||||
example: "Example",
|
||||
lat-lon-error: "Invalid, even though float+float is valid",
|
||||
planning: "Planning",
|
||||
initial-planning: "Initial planning",
|
||||
week: "Week",
|
||||
objectives: "Objectives",
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#import "@preview/touying-unistra-pristine:1.4.3": *
|
||||
#import "@preview/codly:1.3.0": codly, codly-init
|
||||
#import "@preview/codly-languages:0.1.10": codly-languages
|
||||
#import "@preview/cetz:0.5.2": canvas, draw
|
||||
#import "langs.typ": i18n, i18n-date
|
||||
#import "utils.typ": title-slide
|
||||
|
||||
#let langs = (
|
||||
fr: ("fr", "ch"),
|
||||
@@ -74,9 +76,27 @@
|
||||
)
|
||||
|
||||
#title-slide(
|
||||
logo: image("logo_white.svg", height: 3em)
|
||||
logo: image("logo_white.svg", height: 3em),
|
||||
extra-body: place(
|
||||
bottom + right,
|
||||
dx: -2em,
|
||||
dy: -2em
|
||||
)[
|
||||
#text(
|
||||
fill: white,
|
||||
weight: "bold"
|
||||
)[#i18n("supervisor"): Dr D. Racordon]
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
#focus-slide(
|
||||
theme: "pink",
|
||||
show-counter: false,
|
||||
)[
|
||||
#i18n("context")
|
||||
]
|
||||
|
||||
== #i18n("context")
|
||||
|
||||
==== #i18n("case-1")
|
||||
@@ -84,13 +104,15 @@
|
||||
#[
|
||||
#set text(size: .8em)
|
||||
```python
|
||||
df = pd.read_csv()
|
||||
df = pd.read_csv(...)
|
||||
value = df["distance"] / df["time"]
|
||||
...
|
||||
value += df["age"]
|
||||
```
|
||||
]
|
||||
|
||||
#pause
|
||||
|
||||
==== #i18n("case-2")
|
||||
|
||||
#[
|
||||
@@ -105,10 +127,12 @@ TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
|
||||
== #i18n("goal")
|
||||
|
||||
- #i18n("gradual-typing")
|
||||
|
||||
- #i18n("static-type-checking")
|
||||
- #i18n("optional-typing")
|
||||
- #i18n("static-type-checking")
|
||||
- #i18n("dynamic-checks")
|
||||
|
||||
- #i18n("runtime-assertions")
|
||||
- #i18n("value-constraints")
|
||||
|
||||
|
||||
#let wah = place(
|
||||
@@ -137,7 +161,7 @@ df: Frame[
|
||||
birth_date: date,
|
||||
height: float & (0 < _ < 250),
|
||||
name: Optional[str],
|
||||
home: GeoLocation,
|
||||
home: GeoCoordinate,
|
||||
] = pd.read_csv(...)
|
||||
lat = df["home"].lat
|
||||
lon = df["home"].lon
|
||||
@@ -145,6 +169,11 @@ invalid = lat + lon # [[lat-lon-error]]
|
||||
```
|
||||
]
|
||||
|
||||
#focus-slide(
|
||||
theme: "yellow",
|
||||
show-counter: false
|
||||
)[#i18n("planning")]
|
||||
|
||||
== #i18n("initial-planning")
|
||||
|
||||
#table(
|
||||
@@ -181,6 +210,11 @@ invalid = lat + lon # [[lat-lon-error]]
|
||||
[*9*],
|
||||
)
|
||||
|
||||
#focus-slide(
|
||||
theme: "neon",
|
||||
show-counter: false
|
||||
)[#i18n("demo")]
|
||||
|
||||
== #i18n("demo")
|
||||
|
||||
=== #i18n("def-custom-types")
|
||||
@@ -217,3 +251,9 @@ speed += time # [[invalid]]
|
||||
```
|
||||
]
|
||||
|
||||
#focus-slide(
|
||||
theme: "mandarine",
|
||||
show-counter: false,
|
||||
)[
|
||||
Questions ?
|
||||
]
|
||||
100
halfway-presentation/utils.typ
Normal file
100
halfway-presentation/utils.typ
Normal file
@@ -0,0 +1,100 @@
|
||||
#import "@preview/touying:0.6.2": *
|
||||
#import "@preview/touying-unistra-pristine:1.4.3": *
|
||||
|
||||
// Redefine to allow extra-body
|
||||
#let title-slide(
|
||||
title: "",
|
||||
subtitle: "",
|
||||
logo: "",
|
||||
logos: (),
|
||||
hide: (),
|
||||
extra-body: [],
|
||||
..args,
|
||||
) = touying-slide-wrapper(self => {
|
||||
let info = self.info + args.named()
|
||||
|
||||
let nb-logos = logos.len()
|
||||
|
||||
if logo != "" and nb-logos > 0 {
|
||||
panic("'logo' and 'logos' cannot be set at the same time.")
|
||||
}
|
||||
|
||||
let logo-body = none
|
||||
if nb-logos == 0 {
|
||||
logo-body = logo
|
||||
} else {
|
||||
logo-body = grid(
|
||||
columns: if nb-logos > 0 {
|
||||
nb-logos
|
||||
} else {
|
||||
1
|
||||
},
|
||||
..(logos).map(logo => logo),
|
||||
)
|
||||
}
|
||||
|
||||
let body = {
|
||||
set text(fill: white)
|
||||
set block(inset: 0mm, outset: 0mm, spacing: 0em)
|
||||
set align(top + left)
|
||||
_gradientize(
|
||||
self,
|
||||
block(
|
||||
fill: none,
|
||||
width: 100%,
|
||||
height: 100%,
|
||||
inset: (left: 2em, top: 1em),
|
||||
grid(
|
||||
columns: 1fr,
|
||||
rows: (6em, 6em, 4em, 4em),
|
||||
logo-body,
|
||||
_cell([
|
||||
#text(size: 2em, weight: "bold", if (title != "") {
|
||||
title
|
||||
} else {
|
||||
info.title
|
||||
})
|
||||
#linebreak()
|
||||
#text(size: 1.7em, weight: "regular", if (subtitle != "") {
|
||||
subtitle
|
||||
} else {
|
||||
info.subtitle
|
||||
})
|
||||
]),
|
||||
|
||||
_cell([
|
||||
#if ((none, "").all(x => x != info.subtitle)) {
|
||||
linebreak()
|
||||
}
|
||||
#set text(size: 1.5em, fill: self.colors.white)
|
||||
#text(weight: "bold", info.author)
|
||||
#if "email" in info {
|
||||
linebreak()
|
||||
text(info.email, size: 0.8em)
|
||||
}
|
||||
]),
|
||||
if "date" not in hide {
|
||||
_cell([
|
||||
#set text(fill: self.colors.white.transparentize(25%))
|
||||
#utils.display-info-date(self)
|
||||
])
|
||||
},
|
||||
),
|
||||
),
|
||||
c1: self.colors.nblue.E,
|
||||
c2: self.colors.cyan.E,
|
||||
)
|
||||
}
|
||||
|
||||
self = utils.merge-dicts(
|
||||
self,
|
||||
config-common(freeze-slide-counter: true),
|
||||
config-page(margin: 0em),
|
||||
config-common(subslide-preamble: none),
|
||||
)
|
||||
|
||||
touying-slide(
|
||||
self: self,
|
||||
body + extra-body,
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user