• Wednesday

    • 5/7 days into the airthings calibration. CO2 modulation is good with the window. Low humidity though. Bought a humidifier.
    • Still feeling terrible after yesterday.
    • Little bit of private work.
    • Spacing guide for rise garden: https://support.risegardens.com/en_us/how-to:-space-out-your-gardens-B1yWSGyqc
    • Great little Shel Silverstein story: https://www.slideshare.net/cyaneum/the-missing-piece-meets-the-big-o
    • For gunicorn python autoreload in dev mode, I notice that often I have to restart twice (just save twice) for changes to take effect, not just once.
    • operator.itemgetter and attrgetter are excellent for basic sorts, but if you need to negate values (or do any calculation of any kind on any sort level), then just build a custom lambda.
    • A note on general building blocks, dict vs defaultdict. Use dict when you have expected keys, of course. Don’t just use it for coding convenience, because you can have unexpected results from the parents/callers.
      • Eg for sbsc game statuses, use a dict. For something like a user_id key (unknown, could be many in the future, unbound), use a defaultdict. Even for weeks, which can change / be dynamic.
      • Also: if the defaultdict has an value lambda of something like a list or a dict, that’s safer. A lambda of an int (which defaults to 0) or another value might be more misleading. An empty list will rarely break the caller silently (who would have gotten a keyerror). If the caller gets a 0.0 instead of a keyerror, that might break silently.
    • My sally lightfoot crab (adult) caught and ate my red fairy anthias (~3”) alive! I reached in with tongs to separate them, but the crab was able to scurry away to safety under a rock with the wriggling fish still in its front claws.
    • SBSC. More restructuring of the results module.
    • Very clean now.
    • Separated by week_results, season_results, and alltime_results. Each managing multiple views, as appropriate. Each following the same flow: query -> organize -> calculate -> sort -> inject -> toprow.
    • Did a little deepdive into conditional typing. You can use union | to indicate that a function can return multiple types, but what if the expected return is directly linked an input param? Eg return_email=True vs the default of returning user IDs. Use typing.overload! Details on ticket.