luminaire icon indicating copy to clipboard operation
luminaire copied to clipboard

Use dataclasses instead of tuples/dicts for passing data around

Open snazzyfox opened this issue 3 years ago • 0 comments

We should formalize our data interface by using dataclasses instead of tuples and dictionaries when returning data. This can help in many ways

  • eliminate the possibility of missing a key, mixing different casing, or making a typo by making these structure lintable
  • much easier to document the meaning and data types of fields
  • allows us to create computed properties that are only computed on demand instead of always generated with the model even if not always needed

snazzyfox avatar Aug 24 '20 20:08 snazzyfox