Abstract: The PureGym project contains tools for acquisition, visualisation, editing and analysis of gym attendance data.
Update: This project is poorly managed and has much inefficient coding, but was primarily for practising creating a QT GUI , manipulating data in python and using GitHub (it quickly became far larger than initially I intially anticipated). I am currently working on improving the data scraping and creating an improved web-based dashboard!
PureGym.GUI.Demo.mp4
- PureGymGUI.py - Main script run to start application
- PureGymGUI.ui - User Interface file containing code to display GUI
- PG2020_SQL.db - Database containing raw time series collected using webscraper script
- PG2020_CLEAN_SQL.db - Database containing cleaned copy of the time series data
- mplwidget.py - Used by the main script to display the graph
- PureGymFunctions.py - Auxilary functions imported into the main script
Install dependencies from requirements.txt
- 'Update Analysis' now only uses days with either a raw or smooth line showing to caclulate statistics instead of all days loaded.
- Fixed ability to change the dateEdit when saving notes so now it is impossible to save notes accidentally to wrong day.
- Can now save notes with apostrophes which caused error.
- Fixed ability to plot multiple analysis window lines by removing need to update plot manually.
- Window screen size is now dynamic to accomodate different screen sizes:
- Added a scroll bar to left hand menu.
- Graph widget now expands to maximise its size.
- Style set to 'Fusion' so as to avoid label/button sizing problems for different operating systems.
- Fixed inability to keep zoomed-in frame whilst also changing lines being viewed.
-
Smoothing window size slider and soinbix
-
New menu options
- Help: Help window shows features list.
- VisualProperties: Window allows visual customisation.
- Viewer: Visualise data for a selection of days.
-
DataEditor: Edit data base values, interpolate, select days for ML
- Statistics: WORK IN PROGRESS
- ML: WORK IN PROGRESS
-
DataEditor
-
Ability to display a selected day's data in graph and table.
-
Options to toggle gridlines, markers and table visibility.
-
Change day selection for ML.
-
Interpolation options.
Annotations:
- Number line: plot horizontal line for a constant number of people.
- Time annotation toggle:
- Time line can be toggled using checkbox without updating.
- Interactive animated movement with sliers.
- Number annotation toggle:
- Number line can be toggled using checkbox without updating.
- Interactive animated movement with sliers.
Legend:
- Split legend into smooth/raw so legend picking can be done.
- Legend picking - turn on & off lines using by clicking on corresponding legend line.
- Legends can be toggled using checkbox without updating.
Gridlines:
- Gridlines can be toggled using checkbox without updating.
Plot Lines:
- Ability to toggle smooth, raw and mean lines using checkboxes without updating.
Time annotaion toggle:
- Time line can be toggled using checkbox without updating.
- Interactive animated movement with sliers.
Number annotation toggle:
- Number line can be toggled using checkbox without updating.
- Interactive animated movement with sliders.
Analysis window Toggle:
- Analysis window can be toggled using checkbox without updating.
- Interactive animated movement with sliders.
Weekday toggle:
- Can toggle lines in plot/legend using tab2 weekday checkboxes.
- Added 'Select All' and 'Deselect All' buttons for the weekday checkboxes.
- Raw Data - display the raw data
- Smoothed Data - display the data averaged over a 15minute window
- Mean Data - display the average line of the raw data
- Gridlines - turn on/off gridlines
- Legend - turn on/off legend
- Analysis Window - display vertical lines at the start and end of the analysis window
- Time - display a vertical line at a specified time on the x-axis
- People - display a horizontal line at a constant number of people on the y-axis
Select a single day to display:
- Yesterday - set date to yesterday
- Today - set date to today
- Update (press enter) - displays the selected day
Notes can be added to the selected day using the plain text editor. When a day is loaded, its corresponding notes are displayed in the text editor. If the notes are altered, the new notes can be saved.
- Save - save altered notes
Select a range of days to display: Days can be filtered using the weekday checkboxes.
-
Start - select the start of the date range
-
End - select the end of the date range
-
Past week - sets the start and end dates to the previous 7 days
-
Past month - sets the start and end dates to the previous 28 days
-
+1 week - sets end date 7 days after end date
-
+1 month - sets end date 28 days after start date
-
Select All - select all check boxes
-
Deselect All - unselect all check boxes
-
Update (press enter) - displays the selected range of days
Work in progress
The analysis window specifices the range of times between which some basic quantities are calclulated. The start time cannot be after the end time.
-
Start - selects the start time of the analysis window
-
End - selects the end time of the analysis window
-
FullDay - sets (start,end) = (00:00,23:59)
-
Day - sets (start,end) = (04:30,23:30)
-
Morning - sets (start,end) = (04:30,09:00)
-
Evening - sets (start,end) = (16:00,21:00)
-
Update Analysis - updates the calculated quantities if the analysis window has been changed.
Plotted lines can be toggled on and off by clicking on their corresponding lines in the legend.
- Update Selection: Save selection changes
- Test Interp.: Produce plot to test all interpolations.
- Single Interp.: Inteprolate all single missing data points.
- Interpolate: Interpolate data with choice selected.
- Set Constant: Set values between start and end time to value selected.