dhmay / jamstats Goto Github PK
View Code? Open in Web Editor NEWTools for making plots on roller derby scoreboard data and following live game data
Home Page: https://jamstats.net
License: GNU General Public License v2.0
Tools for making plots on roller derby scoreboard data and following live game data
Home Page: https://jamstats.net
License: GNU General Public License v2.0
Is your feature request related to a problem? Please describe.
The one coach I've talked to so far finds the plots difficult to interpret. I suspect they're too "Data Sciency". I'm interested in potentially changing them to make them more accessible, but I also think some documentation would help.
Describe the solution you'd like
Build a powerpoint-ish deck explaining how to interpret each plot. Make a PDF version available on github.
Describe the bug
In the WebServer display, longer team/league names are overlapping in the Jammer Summary and Team Summary outputs
To Reproduce
Ran the JamStats v0.3.4 exe via command line, with my local IP/Port for CRG and port 8003 for the webserver - Windows server 2019 64 bit. Also reproduced in Windows 11 64bit. Both using the latest version of Chrome
Expected behavior
Word-wrap the team/league names at the mid-point of the plot
What version of the tools are you running, and how?
v0.3.3-alpha
Is your feature request related to a problem? Please describe.
I'd like to know what version of jamstats I'm running. date-of-download isn't very authoritative.
Describe the solution you'd like
I'd like the file properties in windows to show the version number. (in this place on Windows, and the analogous places on Mac & Linux if you end up building executables for those.)
Describe alternatives you've considered
manually renaming the file to jamstats-033.exe after I download it
Add penalties per jam to the skater plot.
Describe the bug
When connecting to the scoreboard, it's not picking up the currently running game, but instead is picking up a game that is still listed as 'Running', but is not the live game
I've also validated that the PDF output also uses the same game
To Reproduce
Running CRG with multiple loaded games, some of which are at Running status instead of Prepared or Finished
Expected behavior
It should connect to the current game
Additional context
Not sure exactly how you're connecting to CRG, but there's another project that connects to CRG that may be useful (this was developed by another Aussie, a Referee named Vector from Western Australia)
https://gitlab.com/project-6/p5-score-keeping/p5-scoring-gauntlet
What version of the tools are you running, and how?
v0.2.0-alpha
Is your feature request related to a problem? Please describe.
I want to file bug reports without feeling like I might be embarrassing anyone from a real team. the --anonymize
switch is great, but in some scenarios (bug reports, documentation, etc.), I don't even want the team names from the json to show up.
Describe the solution you'd like
A switch like --anonymizefull
to do what --anonymize
does, and also turns the team names into Team 1 and Team 2
Describe alternatives you've considered
Extra credit: choose from your favorite list of fictional team names, at https://en.wikipedia.org/wiki/List_of_fictional_sports_teams or elsewhere.
What version of the tools are you running, and how?
v0.2.0-alpha
Is your feature request related to a problem? Please describe.
Page 11 - the relationship between # Jams, Total Score & Mean Net Points feels hard to glean understanding from. e.g.,
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
if we think Mean Net Points is actually a useful stat, would its meaning be clearer if we sorted the skaters by that? or is it only vaguely-important, so sorting by that would cause coaches/fans/announcers/etc., to overindex on that? would sorting skaters by any of these columns be helpful? none particularly feels like it, but without being able to do it, I'm not sure.
Additional context
Add any other context or screenshots about the feature request here.
Describe the bug
Page 1 - it's weird to have decimals (e.g., "218.0") on this page, given that they're all integers.
To Reproduce
looked at PDF drop from dhmay on 2022-12-18
Expected behavior
Integers like scores & number of periods and so forth should display as integers.
Had a chance to have a play with it tonight - UAT is part of my role at work, so apologies if this seems like I'm nit-picking - I'm just picking up things I see; I know this is 95% there, just hoping this helps get you the last 5%!
Printing a gameplot, the first page seems a bit out out of kilter
Second page table has n_scoring_trips as the final column name [suggest changing the name of the column] - based on the game data [above], there should only be ~50 trips for Team 1 [Suggest also changing this to the team name] (on the assumption that this column is counting the number of trips that were scored on only, or ~70 if including trips where the score was 0)
The DerbyGameFactory classes currently take filepaths in their init() methods, so they're scoped to a specific file. That's weird, stop doing it.
I could have sworn I'd made a comment about this in another thread somewhere, but apparently not
What version of the tools are you running, and how?
Windows Server 2019 64bit / Windows 11 64 bit, via GUI (or occasionally CMD)
Is your feature request related to a problem? Please describe.
The problem is that I have a VM on my Server. When running JamStats, it's picking up the IP address of the VM NIC instead of the IP of the primary NIC [There is also a use case within my league where we have multiple NICs on a device, and at Tournaments, each track is on a different network]
Describe the solution you'd like
Within the GUI and CMD, have an option that would allow the input/selection of the IP address to use.
My thought would be that a drop-down list is populated with the available IP address, and the user selects the one they want the WebServer to run on [Default option could be blank if that's easier, or pick the first IP address in numerical order (and the IP address would be ignored unless the JamStatsPort is populated)]
Describe alternatives you've considered
Having to disable and enable Network Interfaces every time to get the WebSever on the correct network is not practical - especially if the server is running multiple active games and it's only the JamStats that needs to be restarted
Describe the bug
on Skater Stats pages, the penalty legend can occlude the number of penalties for some skaters
To Reproduce
v0.2.0-alpha
Expected behavior
the legend shouldn't block the data the page is trying to convey. I think Rebel Girl only got 5 penalties, but I'm not sure.
Additional context
move legend to the bottom? make the box yet more transparent?
What version of the tools are you running, and how?
v0.3.4+Bug patches on Windows Server 2019 / Windows 11 both 64bit
Is your feature request related to a problem? Please describe.
It's a follow-on request from #72
Describe the solution you'd like
When loading a JSON file that has multiple games, have the GUI present a list of games, and the selected game is the one presented in WebServer or Output File ; or when connecting to a Scoreboard instance default to the CurrentGame, but have the ability to select a game that is then presented in WebServer or Output File
What version of the tools are you running, and how?
data dump from dhmay 2022-12-18
Is your feature request related to a problem? Please describe.
Page 1 - among the stats here, it would be useful to see the number of skaters who actually played based on the lineup-tracking data (to clarify, that's not just the full team list in the roster).
What version of the tools are you running, and how?
0.2.0, cloned
Is your feature request related to a problem? Please describe.
Currently, plot background is always white, but team colors are pulled from the JSON file. If a team is white (or something very close to white) their plots will be impossible to read.
Describe the solution you'd like
Allow user to specify background color for all plots, e.g., black, white, grey....
Also, add --color1
and --color2
options to let the user explicitly choose which colors to use for each team.
What version of the tools are you running, and how?
v0.2.0-alpha
Is your feature request related to a problem? Please describe.
It's great that both teams are unified into a single chart now. But there are two cases that the current layout makes hard to grok.
Describe the solution you'd like
some marker on the axis or in the plot area to delineate one penalty area from the next. An ugly version of that:
Describe alternatives you've considered
Additional context
While I putatively created this problem by asking for the two teams to be displayed in a single chart, the current version is an improvement over that. Definitely wouldn't revert that change.
What version of the tools are you running, and how?
Windows EXE v0.3.4
Is your feature request related to a problem? Please describe.
When running the EXE file, it would be useful for a pop-up prompt for the options available instead of having to use command prompt - while this isn't an issue for me, some less technically minded people would not be able to use JamStats at the moment
Describe the solution you'd like
Run the JamStats EXE file and have a prompt that asks for:
Describe alternatives you've considered
nil
Additional context
Sample of screen for an Electronic Jam Timer as a sample
This is a double-headed request
Would love to be able to see a prompt where the user can enter a file path in plain "file location" logic, eg: *C:\crg\stats* and have that interpreted by the program and saved as a variable for use when setting the filenames for import/export
Would also like to have a default output filename - if no output filename is given, use the input filename and replace the file extension .JSON with the relevant extension for the function called, eg .PDF or .tsv
Easiest way to do that: jinja, e.g.:
df.style.background_gradient(cmap=cm, axis=None).format(precision=0)
Is it worth incurring a jinja2 dependency?
What version of the tools are you running, and how?
v0.2.0-alpha
Is your feature request related to a problem? Please describe.
we may need to chew on the "right" design here, but in a previous build lead was in gray, and I complained about it. In 0.2.0, got-lead-and-called is in team colors, got-lead-and-lost-it is red for both teams, and got-lead-and-ended-on-time is gray for both teams. Doing the apples-to-oranges on this stat is hard (for me, apparently)
Describe the solution you'd like
I don't know.
Describe alternatives you've considered
show the Called portion in the same color for both teams? don't use stacked bars (I'm pretty sure that's a terrible direction.)
Describe the bug
Page 2 - Jams that end with Injury accrue to both teams, so these numbers will always be identical (and they shouldn't be summed).
To Reproduce
looked at PDFs from 2022-12-18
Expected behavior
Injury data isn't per-team. A jam that ends with an Injury code is applied to both teams, so even if there's 5 injuries listed for each team, that's only 5 injuries. (Minimally, that's true with CRG v4; I assume it's true with v5, but we could always check to make sure they're the same & if at some point they aren't, maybe the software changed.)
Additional context
As long as we call it out in the mail to coaches, I don’t think you'd need to fix it before the mail, but we should for some future version of the report:
What version of the tools are you running, and how?
direct dump from dhmay via pdf
Is your feature request related to a problem? Please describe.
it's hard to tell which team data in an unexpected color goes with. Seeing a team I always associate with green displayed in orange bends my brain.
Describe the solution you'd like
for all the graphs that compare two teams, the colors would be way easier to follow if they reflected the team colors. Seeing [a team I associate with blue]
displayed in blue and [a team I associate with green]
displayed in orange was a memory test on basically every page.
Good news: with our teams we only have 12 colors. (Maaaaybe 14, if our second travel team gets rolling again, but I don't know what colors they'll use)
Bad news: if the background stays white, the team colors for white & yellow seem gratuitously hard, since they might need shadows or something to make them legible).
Good news: black or gray background might be fine, as in my screencap.
You don't have to use the colors here, but they are conveniently in the json for each game, at the lines like
"ScoreBoard.PreparedTeam(GreenTeam).Color(scoreboard_bg)" : "#4dff29"
if your engine lets you "just" switch the background to black (or #24292E which was the bgcolor in the screenshot from slack) would it make using our lighter team colors as defined in the file less cascade-prone? Might have to special-case travelteam.gray to something else, but maybe the others would work?
Describe alternatives you've considered
Being smarter? Suffering with the color-confusion? learning python well enough to fix it myself?
Additional context
as dhmay wrote in slack:
For colors: could work fine for all our teams' colors, but I'd worry that it wouldn't work for everyone (Team Midnight!). Easiest would probably be to expose a background color option on the commandline
probably related to any fix for
#24
There seems to be a fake "ScoringTrip", ScoringTrip(1), that represents the initial pass (it always has score 0). For the jammer who gets lead, the Duration value for that trip should represent time to get lead.
I want to capture that value and then build a plot or two around it.
Notify user of IP address and port in jamstats server
Describe the bug
I initially thought this may have just been a GUI bug, but it's happening in commandline too. I've validated the PDF outputs are all working as expected [except Anonymizeteams which has the same failure]
All options below have been generated using command line, but the same issue occurs when initiate through the GUI
To Reproduce
Windows Server 2019 and Windows 11 (both 64 bit), run via GUI or via command line with a WebServer as the Output method
Expected behavior
Plots change from standard theme to a dark-theme when the relevant theme is chosen, Teams/Players are anonymised, Team Colours are overridden
Screenshots
Lead and Scores shown for reference, but all fields validated as not presenting differently
(Dark Grids PDF export on the left next to a No Theme export on the right for comparative reference)
Team Colors don't update
When I was first looking at this, the Cumulative Score by Jam had the right colours, but then it stopped after I navigated away and came back and it was the wrong colour again. I haven't been able to reproduce the correct colours again
[For reference, the CRG loaded team colours for this are Black and Yellow, too, so it's not picking up the CRG loaded colours either -- unless you're picking up the Scoreboard colours?
Additional context
Cache cleared between tests, and ran in incognito mode with same result
Anonymizing Teams Debug Output
C:\Users\Administrator\Desktop>jamstats.exe --jsonfile c:\users\administrator\desktop\KCRvWSRD.json --outfile c:\users\administrator\desktop\kcr_anonTeam_debug.pdf --anonymizeteams --debug
jamstats version 0.3.4, by Damon May
Enabling debug logging.
load_json_derby_game start.
JSON major version string: v5
Loading game data
JSON major version string: v5
Found version 5. Checking for in-progress game...
Extracting roster
extract_roster begin
JSON version 5
Looking for teams in roster: Team\(1\), Team\(2\)
Roster rows by team:
1 541
2 484
Name: team, dtype: int64
Loaded roster. Skater count by team:
Sovereigns 13
Wreckers 12
Name: team, dtype: int64
Extracting jam data
Found 14816 Period rows.
Found 14690 Jam rows.
Found 54 jams.
Jam simple fields: Index(['Previous', 'Id', 'WalltimeStart', 'WalltimeEnd', 'StarPass',
'Readonly', 'Duration', 'PeriodNumber', 'PeriodClockElapsedEnd',
'PeriodClockDisplayEnd', 'Overtime', 'Number',
'PeriodClockElapsedStart', 'Next'],
dtype='object')
Jams summary rows: 54
Jams summary rows (without 0:00): 53
Jams: 53
teamjam rows, team 1: 7035
teamjam simple fields: Index(['OsOffsetReason', 'Previous', 'Readonly', 'AfterSPScore', 'StarPass',
'StarPassTrip', 'TotalScore', 'Number', 'OsOffset', 'Next', 'NoPivot',
'NoInitial', 'Calloff', 'Lost', 'Lead', 'LastScore', 'JamScore',
'Injury', 'Id', 'DisplayLead', 'CurrentTripNumber', 'CurrentTrip'],
dtype='object')
teamjams pivoted rows: 54
After adding jammer info: 54
extract_team_perjam_skaters begin
Before roster merge, team jam skater data: 270
After roster merge, team jam skater data: 254
Jam skater lists length: 53
After adding skaters/jam: 53
Loaded 54 scoring trips.
After adding scoring trips: 53
teamjam rows, team 2: 6876
teamjam simple fields: Index(['OsOffset', 'OsOffsetReason', 'Previous', 'Readonly', 'AfterSPScore',
'StarPass', 'StarPassTrip', 'NoPivot', 'TotalScore', 'Number', 'Next',
'NoInitial', 'Calloff', 'Lost', 'Lead', 'LastScore', 'JamScore',
'Injury', 'Id', 'DisplayLead', 'CurrentTripNumber', 'CurrentTrip'],
dtype='object')
teamjams pivoted rows: 54
After adding jammer info: 54
extract_team_perjam_skaters begin
Before roster merge, team jam skater data: 270
After roster merge, team jam skater data: 238
Jam skater lists length: 53
After adding skaters/jam: 53
Loaded 54 scoring trips.
After adding scoring trips: 53
After merging teamjams: 53
Made jams summary dataframe. Rows: 53
Extracting penalties
extract_penalties begin
Rows with `Penalty(`: 252
After merging with roster: 252
Before merge with penalty codes: 18
build_penalty_code_name_map begin, version==5
Built penalty code dataframe: 15 codes
Extracted penalties: 18 rows.
Team colors: Empty DataFrame
Columns: [team, color]
Index: []
DerbyGame init
Extracting game summary dict
extract_game_summary_dict 1
Periods: 2
Jams: 53
Extracting jam data for period {period}
Extracting jam data for period {period}
Calculating final scores
Handling team colors
Failed to find teams in color definitions. Dummying.
Anonymizing teams.
Traceback (most recent call last):
File "jamstats", line 116, in <module>
AttributeError: 'DerbyGame' object has no attribute 'anonymize_teams'
[10656] Failed to execute script 'jamstats' due to unhandled exception!
My pandas manipulations generate a ton of warning messages. They're harmless (for now) but unsightly. I could suppress them, or I could improve my pandas so they don't get generated.
Describe the bug
Sovereigns/sabres game gives this output:
Failed to make penalty plots: min() arg is an empty sequence
Failed to make skater plot: list index out of range
Failed to make skater plot: list index out of range
Would love to see some more specific plotting - in addition to the Game-level data, have some Skater-level data:
Describe the bug
Page 5 - there are two pages for "Points per jam by team" - it seems unnecessarily sparse to split these into two pages
To Reproduce
v0.2.0-alpha
Expected behavior
for all the jams for the game to be on a single page.
Is your feature request related to a problem? Please describe.
jamstats usage is getting increasingly complex.
Describe the solution you'd like
Make some usage documentation for the tool. Describe commandline arguments in detail, and give examples. Explain all the things you can do in the web ui (that could be deployed as online documentation by the server).
Additional context
I don't really know who the potential users are, but the better the documentation the more of them there can be.
It's correct on the first table, incorrect on the second. Remove from the second, because redundant, but also figure out why it was wrong and if any of the rest of that table is wrong.
Currently, the name anonymizer function spits out a random string of letters and numbers. Instead, use a whole bunch of names I already made up.
Describe the bug
Page 4 - Points per jam by team - columns are in non-standard order.
To Reproduce
v0.1.7-alpha
Expected behavior
Additional context
Add any other context about the problem here.
Might be fun, and a good visual for how big a discrepancy there was in time to initial between the teams.
Describe the bug
When two teams from the same league are in the game, the Game Summary page only has one of them listed
To Reproduce
STATS-2022-07-23_PotLuckAmber_vs_PotLuckAmber.json.txt
JSON attached, gives PDF output attached
LiveGame_stats.pdf
Expected behavior
Both teams should be listed in the Summary page
Numbers don't seem to add up, for the sample image I included in the readme.
Describe the bug
Total Game Time is showing as a count down from 60:00, rather than the elapsed game time
Expected behavior
Should show total actual game time elapsed
I couldn't find a node in the JSON that had the total time elapsed, but I found a couple of nodes that will help with calculation
( (Period(2).WalltimeEnd minus Period(2).WalltimeStart) + (Period(1).WalltimeEnd minus Period(1).WalltimeStart) )÷ 60000 ; then the decimal value * 60 to give the number of minutes
(1670048238248 -1670046203487) + (1670045276118-1670043099661) = 4,211,218 ÷ 60000 = 70.1869667 ; 0.1869667 * 60 = 11.2 == 70:11
The last step can be skipped if there's a Python library that will convert Decimal to MM:SS
This doesn't factor in Timeouts, so the Statistic name should be Total Game Time including Timeouts
Or if you want to exclude Timeout elapsed time too, it would be ( SUM(Period(1).Timeout(XYZ).Duration" : ######) + SUM(Period(2).Timeout(XYZ).Duration" : ######) ) where XYZ is the unique Timeout Identifier and ###### is the numeric duration
You would then subtract that value from before the ÷ 60000 in the first formula eg:
( (Period(2).WalltimeEnd minus Period(2).WalltimeStart) + (Period(1).WalltimeEnd minus Period(1).WalltimeStart) - ( SUM(Period(1).Timeout(XYZ).Duration" : ######) + SUM(Period(1).Timeout(XYZ).Duration" : ######) ) )÷ 60000 ; then the decimal value * 60 to give the number of minutes
(1670048238248 -1670046203487) + (1670045276118-1670043099661) - 388000 = 3,823,218 ÷ 60000 = 63.7203 ; 0.7203 * 60 = 43.2 == 63:43
What version of the tools are you running, and how?
v0.2.0-alpha
Is your feature request related to a problem? Please describe.
The colorizing schemes for players on the two Jammer Stats pages are really different.
Describe the solution you'd like
I'd like the two pages to have the same visual language. The progression is pretty, but not actually relevant (you're not intending to one skater the next (or at least they're not sorted to suggest that you are). The qual scheme may make more sense from that perspective, but it's not as pretty.
Pick only one of those colorizing schemes or something else, but not both.
What version of the tools are you running, and how?
data drop from 2022-12-18
Describe the solution you'd like
Page 3 - I'd love a primary hairline on the graph separating period 1 from 2, and maybe secondary lines at every ~5 jams?
Describe alternatives you've considered
lines, shading
Additional context
this may be true for other charts than just page 3
Describe the bug
Got python exception
To Reproduce
Linux environnement, last version. To generate a working pdf i had to rollback to version 0.1.2
I'll send you the file with facebook to test as i can't here
Traceback (most recent call last):
File "/usr/local/bin/jamstats-plot-pdf", line 35, in <module>
logging.basicConfig(level=logging.WARNING, format=formatter)
File "/usr/lib/python3.9/logging/__init__.py", line 2011, in basicConfig
fmt = Formatter(fs, dfs, style)
File "/usr/lib/python3.9/logging/__init__.py", line 570, in __init__
self._style.validate()
File "/usr/lib/python3.9/logging/__init__.py", line 422, in validate
if not self.validation_pattern.search(self._fmt):
TypeError: expected string or bytes-like object
Describe the bug
In the Game Summary it says {team name} Final Score even though the game is still in progress
To Reproduce
Connect to a running game
Expected behavior
The word Final should only be populated if
Additional context
ScoreBoard.CurrentGame.State : "Finished" is what you're looking for (here's a FINISHED game example)
(Here it is in the CurrentGame of the other above screenshots)
via easy_install or the like. Declare dependencies.
Describe the bug
on page 1, Minutes is 25 (the length of one period). Given that Periods is 2 and jams is 26, Minutes should be 50 minutes or something very close.
To Reproduce
looked at PDF data dump from 2022-12-18
Expected behavior
Minutes should be the sum of p1 and p2
Currently, if the teams didn't both get the exact same set of penalties, the colors on the two team penalty plots will have different meanings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.