In this application, we're using a very simple filter. The entire filter process is embodied in the following function:
def anscombe_filter( set_id: str, raw_data_map: Dict[str, List[Pair]] ) -> List[Pair]: return raw_data_map[set_id]
We made this trivial expression into a function for three reasons:
- The functional notation is slightly more consistent and a bit more flexible than the subscript expression
- We can easily expand the filtering to do more
- We can include separate unit tests in the docstring for this function
While a simple lambda would work, it wouldn't be quite as convenient to test.
For error handling, we've done exactly nothing. We've focused on what's sometimes called the happy path: an ideal sequence of ...