ssscoring.datatypes
SSScoring custom type definitions for easier symbolic manipuation.
1# See: https://github.com/pr3d4t0r/SSScoring/blob/master/LICENSE.txt 2 3 4""" 5SSScoring custom type definitions for easier symbolic manipuation. 6""" 7 8from collections import namedtuple 9from enum import Enum 10 11 12# +++ implementation +++ 13 14class FlySightVersion(Enum): 15 """ 16 Symbols for handling device version. 17 """ 18 V1 = 1000 19 INSIGHT = 1100 20 V2 = 2000 21 22 23class JumpStatus(Enum): 24 OK = 0 25 ALTITUDE_EXCEEDS_MINIMUM = 100 26 ALTITUDE_EXCEEDS_MAXIMUM = 110 27 INVALID_SPEED_FILE = 120 28 SPEED_ACCURACY_EXCEEDS_LIMIT = 200 29 WARM_UP_FILE = 300 30 UNSUPPORTED_PLD_FORMAT = 400 31 32 33JumpResults = namedtuple( 34 'JumpResults', 35 'data maxSpeed score scores table window status backFall backFallOnset forwardReversalM lateralReversalM', 36 defaults=(False, None, 0.0, 0.0), 37) 38""" 39A named tuple containing the score, maximum speed, scores throught the 40performance window, the results table for a jump, the output color for the 41result, and the result information string. 42 43Attributes 44---------- 45- `data` - dataframe containing all the data points for plotting and 46 calculations 47- `maxSpeed` - maximum absolute speed registered during a skydive 48- `score` - maximum mean speed during a 3-second window during the skydive 49- `scores` - a dictionary with all the scored ruding the sliding 3-sec window 50 for the speed run 51- `table` - summary table of results of the speed run 52- `window` - the scoring window data, an instance of `PerformanceWindow` 53- `status` - An instance of `ssscoring.datatypes.JumpStatus` 54- `backFall` - `True` if a back-fall was detected within the performance window 55- `backFallOnset` - `plotTime` (seconds from exit) at back-fall onset, or `None` 56- `forwardReversalM` - metres of reversed ground travel along the jump run axis 57- `lateralReversalM` - metres of reversed ground travel on the lateral axis 58""" 59 60 61PerformanceWindow = namedtuple('PerformanceWindow', 'start end validationStart') 62""" 63An object to handle the performance window (as defined in competition rules) as 64a single object with all the properties necessary to interpret it and manipulate 65it across different function or method calls. 66 67Attributes 68---------- 69- `start` - beginning or start of the performance window, or exit from the 70 aircraft 71- `end` - end of the performance window, or `start-PERFORMANCE_WINDOW_LENGTH` 72- `validationStart` - end of the performance window - the `VALIDATION_WINDOW_END` 73 74See 75--- 76 ssscoring.constants.PERFORMANCE_WINDOW_LENGTH 77 ssscoring.constants.VALIDATION_WINDOW_END 78"""
class
FlySightVersion(enum.Enum):
15class FlySightVersion(Enum): 16 """ 17 Symbols for handling device version. 18 """ 19 V1 = 1000 20 INSIGHT = 1100 21 V2 = 2000
Symbols for handling device version.
V1 =
<FlySightVersion.V1: 1000>
INSIGHT =
<FlySightVersion.INSIGHT: 1100>
V2 =
<FlySightVersion.V2: 2000>
class
JumpStatus(enum.Enum):
24class JumpStatus(Enum): 25 OK = 0 26 ALTITUDE_EXCEEDS_MINIMUM = 100 27 ALTITUDE_EXCEEDS_MAXIMUM = 110 28 INVALID_SPEED_FILE = 120 29 SPEED_ACCURACY_EXCEEDS_LIMIT = 200 30 WARM_UP_FILE = 300 31 UNSUPPORTED_PLD_FORMAT = 400
OK =
<JumpStatus.OK: 0>
ALTITUDE_EXCEEDS_MINIMUM =
<JumpStatus.ALTITUDE_EXCEEDS_MINIMUM: 100>
ALTITUDE_EXCEEDS_MAXIMUM =
<JumpStatus.ALTITUDE_EXCEEDS_MAXIMUM: 110>
INVALID_SPEED_FILE =
<JumpStatus.INVALID_SPEED_FILE: 120>
SPEED_ACCURACY_EXCEEDS_LIMIT =
<JumpStatus.SPEED_ACCURACY_EXCEEDS_LIMIT: 200>
WARM_UP_FILE =
<JumpStatus.WARM_UP_FILE: 300>
UNSUPPORTED_PLD_FORMAT =
<JumpStatus.UNSUPPORTED_PLD_FORMAT: 400>
class
JumpResults(builtins.tuple):
A named tuple containing the score, maximum speed, scores throught the performance window, the results table for a jump, the output color for the result, and the result information string.
Attributes
data- dataframe containing all the data points for plotting and calculationsmaxSpeed- maximum absolute speed registered during a skydivescore- maximum mean speed during a 3-second window during the skydivescores- a dictionary with all the scored ruding the sliding 3-sec window for the speed runtable- summary table of results of the speed runwindow- the scoring window data, an instance ofPerformanceWindowstatus- An instance ofssscoring.datatypes.JumpStatusbackFall-Trueif a back-fall was detected within the performance windowbackFallOnset-plotTime(seconds from exit) at back-fall onset, orNoneforwardReversalM- metres of reversed ground travel along the jump run axislateralReversalM- metres of reversed ground travel on the lateral axis
class
PerformanceWindow(builtins.tuple):
An object to handle the performance window (as defined in competition rules) as a single object with all the properties necessary to interpret it and manipulate it across different function or method calls.
Attributes
start- beginning or start of the performance window, or exit from the aircraftend- end of the performance window, orstart-PERFORMANCE_WINDOW_LENGTHvalidationStart- end of the performance window - theVALIDATION_WINDOW_END
See
ssscoring.constants.PERFORMANCE_WINDOW_LENGTH
ssscoring.constants.VALIDATION_WINDOW_END