Thursday, September 19, 2019

  • Supercontest.
    • Datetime, picks, leaderboard:
      • Updated all the datetimes in the database to pacific. Updated the database timezone to pacific.
      • Updated the url defaults. Season is current or max. Week is current or 17.
      • Added g.current_season next to the existing g.season (which is the requested season) and g.is_current_season. Same for weeks.
      • Switched everything to be perfectly clear: all datetimes in the database are utc, all westgate lines are written after conversion from pacific time, and all sqlalchemy reads convert to local.
      • Debug toolbar is helping a lot. Noticed that on RESULTS_DAYS, it was bloated by about 500ms due to excessive queries.score_exists/get_score calls. Consolidated all of them. You could even go further by conditioning commit_scores not just on RESULTS_DAYS, but on time as well to tighten the range in which the extra calls are made. Call fetch_scores protected by results_days, then only call commit if any of the statuses aren't P/F/FO.
        • Reduced total db queries for the endpoint by >30 and profile reduced by ~400ms.
      • Completed redefined the pick view and how it's sorted, including the core/results backend to calculate as such. Now returns number of picks, current total points, current possible points, etc. Looks very good now.
      • LB and graph only show completed games in the total now. I added a col for in-progress games so you call still check "what if it all ended right now" status.
      • Percentages are now based on the picks that you have submitted, not the total (5 per week).
      • Combined a lot of the route logic, keeping the endpoints as thin as possible. Most of them outsource to functions in the core.results module now.
      • Added tooltips all over leaderboard for submitted picks, help, more.
      • Universal color for a lot of things.
      • Renamed the matchups tab to your picks. Renamed the picks tab to all picks.
      • Graph and leaderboard are now bulletproof for completed games.
      • Added req compilation back as a requirement of the test step, and ensured that compreqs were installed into the testenv.
    • My make test-python recipe is heavy-handed; it will compile all reqs and recreate the testenv. On subsequent runs, just use tox.
    • Got the bandit tests running again. Pytest is still obsolete.
    • App behaved well over TNF.
    • Closed https://github.com/brianmahlstedt/supercontest/issues/84.
    • Closed https://github.com/brianmahlstedt/supercontest/issues/94.
    • Dashboard.
      • Added a conditional (on my account) navtab for the flask monitor.
  • Bools have to be filtered |tojson to pass through jinja from flask to js. They'll be properly typeof() = boolean in js.
  • Forcing NBA owners to change their titles to governors due to historical implications is the same false equivalence as telling a German that they can't use ovens. It's offensive. It's irrelevant. Race is being used as glue to compare situations which have absolutely no relation.  It's not just a "doesn't affect you" situation - it's discriminatory, and should not be ok to concede. Finding these parallels with your lens of virtuous sensitivity is not progressive; it's an overshot of true equality, which slows resolution (if it doesn't destabilize entirely).
  • Nested dicts are fine to pass through jinja's |tojson filter for use in js.
  • Fed mouse. First time she's ever been snappy when I opened the terrarium. Used a broomstick to move her to the feeding tank.
  • My digital ocean droplet is in Santa Clara.