Chalk home page
Docs
API
CLI
  1. Notebooks
  2. Inline Syntax

In notebooks, you can define features inline using the syntax shown below.

Consider the following feature class definition for RocketEngine

notebook.ipynb
from chalk.features import features

@features
class RocketEngine:
    id: int
    mass: float
    volume: float
    thrust: float

If we wanted to define a feature inline in a notebook cell, we could do so using the underscore syntax below:

notebook.ipynb
RocketEngine.density: float = _.mass / _.volume