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    V2 = 2000
20
21
22class JumpStatus(Enum):
23    OK = 0
24    ALTITUDE_EXCEEDS_MINIMUM = 100
25    ALTITUDE_EXCEEDS_MAXIMUM = 110
26    INVALID_SPEED_FILE = 120
27    SPEED_ACCURACY_EXCEEDS_LIMIT = 200
28    WARM_UP_FILE = 300
29
30
31JumpResults = namedtuple(
32    'JumpResults',
33    'data maxSpeed score scores table window status backFall backFallOnset forwardReversalM lateralReversalM',
34    defaults=(False, None, 0.0, 0.0),
35)
36"""
37A named tuple containing the score, maximum speed, scores throught the
38performance window, the results table for a jump, the output color for the
39result, and the result information string.
40
41Attributes
42----------
43- `data` - dataframe containing all the data points for plotting and
44           calculations
45- `maxSpeed` - maximum absolute speed registered during a skydive
46- `score` - maximum mean speed during a 3-second window during the skydive
47- `scores` - a dictionary with all the scored ruding the sliding 3-sec window
48             for the speed run
49- `table` - summary table of results of the speed run
50- `window` - the scoring window data, an instance of `PerformanceWindow`
51- `status` - An instance of `ssscoring.datatypes.JumpStatus`
52- `backFall` - `True` if a back-fall was detected within the performance window
53- `backFallOnset` - `plotTime` (seconds from exit) at back-fall onset, or `None`
54- `forwardReversalM` - metres of reversed ground travel along the jump run axis
55- `lateralReversalM` - metres of reversed ground travel on the lateral axis
56"""
57
58
59PerformanceWindow = namedtuple('PerformanceWindow', 'start end validationStart')
60"""
61An object to handle the performance window (as defined in competition rules) as
62a single object with all the properties necessary to interpret it and manipulate
63it across different function or method calls.
64
65Attributes
66----------
67- `start` - beginning or start of the performance window, or exit from the
68            aircraft
69- `end` - end of the performance window, or `start-PERFORMANCE_WINDOW_LENGTH`
70- `validationStart` - end of the performance window - the `VALIDATION_WINDOW_END`
71
72See
73---
74    ssscoring.constants.PERFORMANCE_WINDOW_LENGTH
75    ssscoring.constants.VALIDATION_WINDOW_END
76"""
class FlySightVersion(enum.Enum):
15class FlySightVersion(Enum):
16    """
17    Symbols for handling device version.
18    """
19    V1 = 1000
20    V2 = 2000

Symbols for handling device version.

V1 = <FlySightVersion.V1: 1000>
V2 = <FlySightVersion.V2: 2000>
class JumpStatus(enum.Enum):
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
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>
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 calculations
  • maxSpeed - maximum absolute speed registered during a skydive
  • score - maximum mean speed during a 3-second window during the skydive
  • scores - a dictionary with all the scored ruding the sliding 3-sec window for the speed run
  • table - summary table of results of the speed run
  • window - the scoring window data, an instance of PerformanceWindow
  • status - An instance of ssscoring.datatypes.JumpStatus
  • backFall - True if a back-fall was detected within the performance window
  • backFallOnset - plotTime (seconds from exit) at back-fall onset, or None
  • forwardReversalM - metres of reversed ground travel along the jump run axis
  • lateralReversalM - metres of reversed ground travel on the lateral axis
JumpResults( data, maxSpeed, score, scores, table, window, status, backFall=False, backFallOnset=None, forwardReversalM=0.0, lateralReversalM=0.0)

Create new instance of JumpResults(data, maxSpeed, score, scores, table, window, status, backFall, backFallOnset, forwardReversalM, lateralReversalM)

data

Alias for field number 0

maxSpeed

Alias for field number 1

score

Alias for field number 2

scores

Alias for field number 3

table

Alias for field number 4

window

Alias for field number 5

status

Alias for field number 6

backFall

Alias for field number 7

backFallOnset

Alias for field number 8

forwardReversalM

Alias for field number 9

lateralReversalM

Alias for field number 10

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 aircraft
  • end - end of the performance window, or start-PERFORMANCE_WINDOW_LENGTH
  • validationStart - end of the performance window - the VALIDATION_WINDOW_END

See

ssscoring.constants.PERFORMANCE_WINDOW_LENGTH
ssscoring.constants.VALIDATION_WINDOW_END
PerformanceWindow(start, end, validationStart)

Create new instance of PerformanceWindow(start, end, validationStart)

start

Alias for field number 0

end

Alias for field number 1

validationStart

Alias for field number 2