Git Product home page Git Product logo

bbq-first's Introduction

BBQ-FIRST

BBQ FIRST was started in 2015 as a way to track FIRST Robotics Competition (FRC) event strength via thematically named statistical metrics. While the metrics themselves are humorous, the data gives insight into the strength of any given event by ranking them against each other using historic team performance.

In lieu of a software architecture document (work in progress): The current website uses the Vue.js framework with Vite as the local development server. The public site is hosted on vercel. The database and any backend services are on supabase. Python is used to periodically update the data, as managed by Github Actions.

Roadmap

Github milestones are the best way to get visibility into the project roadmap at this time. If you have an idea for a feature, please make a Github issue so it can be added to the appropriate milestone!

Contributing

Contributions from the community are encouraged! Please remember to follow the code of conduct whenever contributing or interacting with the community.

An example git workflow for contributing can be found below.

Feature Requests

If you have an idea for a new feature of BBQ FIRST, let us know by creating a Github issue.

While it is not guaranteed that a feature request will be incorporated into the website, we are always looking for great ideas. A feature is far more likely to be prioritized if it:

  • Improves the user experience of the site
  • Adds value through new insights, predictive analysis, or fun statistics
  • Optimizes the data update process
  • Adds robustness to the project (automated testing, workflow improvements, CI improvements, etc.)

Bug Reports

If you find something isn't working, please create a Github issue that includes the steps to reproduce, as well as any evidence/screenshots/print outs that may be helpful in diagnosing the root cause.

Git workflow

Things that only need to be done once:

  1. Create a fork of this repository.
  2. Clone the fork.

Then, the following steps are repeated for each Github issue:

  1. Checkout the main branch.
  2. Pull the latest updates.
  3. Create and checkout a new feature branch.
  4. Write code / documentation / etc.
  5. Push code to the fork.
  6. Create a pull request to get the feature into this repository.

At this point, if the pull request is for a prioritized issue (i.e. it is associated with a Github issue that has a tracked milestone), it will be reviewed by a project admin. If it is not a prioritized issue, it may still be reviewed depending on the project admins availability.

A pull request review is an iterative process. This is an open source project run by volunteers, so patience and gracious professionalism is requested.

Running Locally

Website

Hosting the website locally requires a node.js and npm installation.

With those prerequisites satisfied, run the following command from your repository root in the terminal to install all the dependencies:

npm install

Then to host locally in development mode, run

npm run dev

Data Update Scripts

Running the data update scripts requires python to be installed, and the use of poetry as a package manager. Other package managers would work as well, however poetry is the chosen package manager / virtual environment for this project.

To perform any update to the database itself, you must have write permissions to the database. These permissions are not being given out for the production database at this time. However, there is planned work for a development database that will have more permissive settings for community members to contribute to.

First, navigate to the util/ directory and install all dependencies for the python update scripts using

poetry update

Running the data update scripts can be done with the following call:

poetry run python main.py

and then adding in the appropriate mode and configuration settings per the argument parser in main.py

bbq-first's People

Contributors

jkleiber avatar dependabot[bot] avatar yabberyabber avatar

Stargazers

cmd / Ada avatar Joseph Norman avatar Alex Ryker avatar Jeremy Paul Germita avatar

Watchers

James Cloos avatar  avatar

Forkers

aryker

bbq-first's Issues

Add a contribution guide to the docs

Summary
It would be helpful to have a guide for how people can contribute to the repository. This would include including how to set everything up locally in the README, and more detailed information on the design / architecture of the website as part of the Wiki

Improve stat hints

Stat hints don't work great on mobile. Additionally, stat hints should be displayed in the sortable table

Event BBQ does not include blue banners won earlier in the day

Summary
BBQ is currently only computed by checking if a given banner is won strictly prior to the event start date. This means that most of Einstein results are slightly wrong due to banners being awarded the same day as Einstein field.

The objective of this issue is to fix the problem by allowing banners to be won on the same day as the given event provided that they were not won at the given event. This is an update to the python scripts and should have no frontend impact.

Revisit RIBS and BRIQUETTE calculation methodology

Summary
RIBS and BRIQUETTE are not calculated intuitively. This is most obvious in the case of RIBS, where later events in a season are almost guaranteed to have higher scores because 1.x seasons are considered in the calculation. It also doesn't make much sense to only count a part of the previous season. Perhaps RIBS should be a weighted interpolation between seasons where the previous season's banners all count equally to each other, but are linearly interpolated out as the current season progresses. For example:

t = normalized progress through current season
RIBS = (1 - t) * prev season banners + t * cur season banners

Team A
2024 (going into week 3, approximately halfway): 1 robot banner -> RIBS = (0.5 * 3) + 1 = 2.5
2024 (going into week 1): 0 robot banners (it's week 1 after all) -> RIBS = 3
2023: 2 robot banners

Similarly, for BRIQUETTE we could do a weighted average over the last 4 seasons that fades out the least recent season for the active season over the course of the active season. So at the beginning of the season we'd have:

BRIQUETTE = 0.25*season1 + 0.25*season2 + 0.25*season3 + 0.25*season4 + 0*currentSeason

Then over time the value from season1 would transfer to currentSeason linearly as shown above

Work Scope

  • Add interpolation of seasons to RIBS and BRIQUETTE stat calculations in bbq_stats.py
  • Update About page to explain this calculation

Parse Einstein participation better

Summary
TBA API lists teams as being on Einstein field if they are competing for team attribute awards. Likewise, teams on Einstein due to the robot may not be in the running for a team attribute award. The objective of this ticket is to make that distinction in the data calculations for Einstein, as well as in the display of the teams in the team list on the front end.

Work Scope

  • Improve the data update scripts to only count team attribute awards for eligible teams (and likewise for the robot) on Einstein fields
  • Update the front end to distinguish between teams in robot/team attribute/both sections (if both, they should probably get special recognition because that is impressive)

Change blue banner appearance on website based on award type

Summary
In order to better highlight teams' accomplishments, awards that are won at different levels should be displayed slightly differently. The objective of this ticket is to specify the theme of the blue banners appearance on the site based on award level (district, regional/district championship, worlds)

This will help set the foundation to add stats that weight harder-to-win banners heavily, as well as possibly allow for an offseason tier of awards to be shown

Work Scope

  • Award appearance based on competition level proposed and acceptable
  • Changes implemented on site

Revisit team stats for inactive teams

Teams that have inactivity probably should not take a hit to their BBQ or their SAUCE, since they were not attempting to win blue banners during a hiatus / retirement. To reflect this, BBQ and SAUCE should be recomputed for teams that have periods of inactivity or who have ceased operations for the foreseeable future

Refresh appearances if event data is updated

Summary
When event data gets updated, team appearances should be added/deleted appropriately. For 2024cmptx, the teams initially were every team that made worlds, but then TBA changed it to be the 49 teams on Einstein during the event. The Appearances remained stale though so while the stats were updated correctly, the display was not.

Create API docs and add them to this repository

Summary
Supabase auto creates documentation for interacting with the database. For ease of use by other developers, these docs should be linked to this repo via the README or some other means.

Show team and event BBQ percentiles in respective pages

The percentile for a team/event (and/or rankings) would be interesting to see on the respective page.

For events:

  • percentile / rank all time
  • rank in its competition year

For teams

  • percentile / rank all time
  • percentile / rank in the last 4 years
  • percentile / rank in current season

Make website work on mobile

The website is not amazing on mobile. In particular:

  • the nav bar is semi broken
  • things don't fit in their containers
  • dropdowns don't show everything (too small somwhow)

There are likely many other issues to fix

Stop testing database scripts in production

Currently all testing is done in production. The objective of this ticket is to make a staging area for data script testing.

It would probably be best to have a cloned schema on supabase named "staging".

Determine if site can be hosted on github pages instead of vercel

Summary
Vercel is only free for one user, so the purpose of this ticket is to determine if github pages can be used instead to run the app

Work Scope

  • Try to get a prototype working on github pages
  • Add deploy and preview actions for github pages
  • Remove vercel from project if these things work well

Blue Banner Count Out of Date

When I look at the team info page for team 868, I see a list of awards that are up to date with District State Champs in the A1 Awards section. These awards include several event wins that should contribute to the banner count. However, the "Banners won in 2018" field reads zero.

image

Automatically update current year statistics nightly in github actions

Summary
The data should be updated nightly in Github actions rather than manually from the terminal.

Work Scope

  • Update the python script to accept credentials on the command line so Github actions can update the database
  • Set up a workflow to run the award updater in github actions

Add event rankings page

Summary
The old BBQ FIRST had rankings pages for each metric, with various filters. These were all in different pages and much of the code was duplicated.

The objective of this issue is to implement an event ranking page that filters on: year (or since year), team vs. robot BBQ, official vs unofficial event. This should show the top N events (probably 100). Ideally this would also be sortable by the user in order to show the events in ascending/descending order as desired.

Add an About / Frequently Asked Questions (FAQ) page

Summary
The old website had a page that explained what all the stats were and why the website was created. In the new site, we should re-create that concept.

Some possibilities:

  1. Make a section in the homepage an about section, and have a nav bar link that auto-scrolls the page to the relevant about section
  2. Add an about page that stands alone and is linked in the homepage

Add the original website stats back

Summary
The original website had the following stats:

  • BBQ (we have this one)
  • BRIQUETTE - basically BBQ but only counting banners since 2005, when the 3 team alliance became the baseline in FRC
  • SAUCE - BBQ only considering the last 4 years
  • RIBS - BBQ only considering the current and previous season

The objective of this ticket is to add these stats back to the website

Work Scope

  • Update the EventData table in the database to include columns for these stats (for team and robot)
  • Update the python scripts to run the correct calculations for these metrics
  • Make a first order update to the front end to show the stats on the event page and event rankings page

Add predictive analytics for a team's chances of making worlds

Summary
The objective of this ticket is to build up a system that predicts each team's chances of making worlds for the current/upcoming season based on their historical results and their path to championships.

Prediction
Districts advancement would be computed via Monte Carlo based on events remaining to determine district championships attendance / final district points / awards.
Regional advancement would be computed by simulating all remaining regional events and compiling the outcomes for each team

Modeling
We could use Elo or some sort of Bayesian update model to build a system for predicting event results. We can lean on blue banner history at first since that is the theme of this website.

Database Updates
The database will need to be updated to include additional team modeling information (if any additional information is needed besides blue banners).

UI Updates
The UI needs to be updated for each team to include the predictive stats. Each event should have a list of favorites to win as well.

Add team BBQ

Summary
Each team should have a BBQ associated with the blue banners they have won per year of existence. This needs to be added to the python scripts and the database schema will likely need to be updated to add a TeamData table

Event rankings do not work for filter if end year is earlier than 2005

Summary
If the event ranking view is set to filter years 1992-2004, no events show up. However if the upper limit is raised to 2005, events appear and are ranked correctly.

This is likely due to SAUCE not working for events prior to 2005, however it does impact all event metrics.

Work Scope

  • Fix filtering logic to allow events pre-2005 to appear
  • Auto-disable SAUCE if the top of the range is below 2005, and do not allow it to be selected

Make "enter" keypress auto-navigate to the top search result

Summary
The search bar currently doesn't do anything if you hit enter without first pressing the down arrow. This was initially done by design, but after testing more it would be better to always have the first result highlighted unless the user moves the autocomplete focus with the arrow keys manually.

Work Scope

  • Set the default starting autocomplete index to 0 rather than -1
  • Test that this does not regress the autocomplete feature

Make the python loading scripts exit gracefully upon failure

Summary
If the data loader python script fails to an exception, it will simply hang in the console and need to be force killed. This is not good for GitHub actions usage as the script will sit there for 6 hours until GitHub times out the workflow. This is partially due to the supabase client not destructing gracefully, and also due to a lack of exception handling throughout the code.

The objective of this ticket is to address the problem in the short and long terms

Short term solution

  • Make the github action workflow timeout shorter in order to protect against script runaway

Long term solution

  • Add exception handling to joblib parallelization
  • Add exception handling to any third party API calls
  • Figure out how to destruct the supabase API client correctly

Generalize the logic in the team and event rankings pages

Summary
There's a lot of duplicate code in the team and event rankings pages. The objective of this ticket is to heavily refactor those views to be as general as possible, and to unify them with a single library of functions

Work Scope

  • Refactor repeated code into a library for team and event rankings
  • Create a library for handling filters and use that in both pages
  • Create components for filters rather than having them be copypasta'd in both files. These components should be configurable.

Add teams ranking page

Summary
The objective of this issue is to allow users to interactively rank teams based on team BBQ, total banners, robot/team banners, etc. The users should be able to filter based on those fields, as well as "since year" and country/state.

This depends on #11 for Team BBQ, but the rest of the implementation is possible without that issue

Make table rows smart enough to handle ties

Summary
The table rows in rankings pages do not handle ties at all. The objective of this ticket is to improve table row rankings to recognize and group tied teams/events with an obvious indicator (such as T-X, where X is the rank the items are tied for) and then pick up the numbering appropriately after the tie.

For example:
1
T-2
T-2
4

Work Scope

  • Process rank ties as part of event/team rankings updates
  • Update event/team rankings pages to embed ranking in the list of top 100 teams/events

First draft event page

Summary
Create a first draft event page, similar to the team lookup page

Work Scope

  • Replicate the team page + search view, but for events
  • Update database schema to have an Event with BBQ related stats
  • Update database schema to have a Team with BlueBanner stats
  • Update award python script to update the Team blue banner counts in the new schema
  • Create python scripts to aggregate event data and stats based on attending teams and their awards entering the event
  • Use TBA API in javascript to associate teams with events

Fix event week for championships

Championship events are incorrectly listed as Week 1 because they are not affiliated with a particular week. The objective for this issue is to add checks for championship event types and replace the week string with a championship string instead

Improve search

Summary
Currently the search bar must be team number or event code (despite what it says) and is dependent on which page it is on. Ideally, this search would be able to take in things like team/event name dynamically, and be added to the title bar.

The search bar should also show suggestions that the user can select to search immediately (with click and arrow keys)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.