Samples and Their States
Explore how to track and manage different states of samples using Python classes. Understand the distinctions between UnknownSample and KnownSample subclasses, state changes, and class responsibilities, helping you design clearer object-oriented programs in Python.
We'll cover the following...
We'll cover the following...
Why do we need to track the state?
The diagram in the previous lesson shows the Sample class and an extension, the KnownSample class. This doesn’t seem to be a complete decomposition of the various kinds of samples. When we review the user stories and the process views, there seems to be
a gap: specifically, the “make classification request” by a User requires an unknown sample. This has the same flower measurements attributes as a Sample, but doesn’t have the assigned species attribute ...