Package bosco :: Module event :: Class RelayEvent
[hide private]
[frames] | no frames]

Class RelayEvent

source code

object --+    
         |    
     Event --+
             |
            RelayEvent

Event class for a traditional relay.

Instance Methods [hide private]
 
__init__(self, legs, header={}, extra_rankings=[], template_dir='templates', print_template='relay.tex', html_template='relay.html', cache=None, store=None)
@param legs: dict keyed with category names containing relay category definitions: lists of leg dicts with the following keys: * 'name': Name of the Leg * 'variants': tuple of course codes that are valid variants for this leg.
source code
 
validate(self, obj, validator_class=None, args=None)
Get a validator
source code
 
score(self, obj, scoreing_class=None, args=None)
Get the score of an object
source code
 
ranking(self, obj, scoreing_class=None, validation_class=None, scoreing_args=None, validation_args=None, reverse=False)
Get a ranking for a Rankable object
source code
 
list_rankings(self)
Returns: list of possible rankings
source code
 
list_legs(self, category)
Lists all legs in a category.
source code

Inherited from Event: clear_cache, format_ranking, list_categories, list_courses, remove_cache

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from Event (private): _key, _var_key

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, legs, header={}, extra_rankings=[], template_dir='templates', print_template='relay.tex', html_template='relay.html', cache=None, store=None)
(Constructor)

source code 

@param legs: dict keyed with category names containing relay category definitions:
             lists of leg dicts with the following keys:
             * 'name': Name of the Leg
             * 'variants': tuple of course codes that are valid variants for this leg.
             * 'starttime': start time for all non replaced runners, type datetime
             * 'defaulttime': time scored if no runner of the team successfully
               completes this leg, type timedelta or None if there is no defaulttime
@see:        Event for other arguments

Parameters:
  • header - gerneral information for the ranking header. Typical keys: 'organiser', 'map', 'place', 'date', 'event'
  • extra_rankings - list of extra rankings
  • template_dir - templates directory
  • print_template - template for printing (latex)
  • html_template - template for html output (screen display)
  • cache - Cache to use for this object
  • store - Store to retrieve possible rankings
Overrides: object.__init__

validate(self, obj, validator_class=None, args=None)

source code 

Get a validator

Parameters:
  • obj - object to validate,
  • validator_class - validation class used
  • args - dict of keyword arguments for the validation strategy object
Returns:
validation result from validator_class.validate(obj)
Overrides: Event.validate
(inherited documentation)

score(self, obj, scoreing_class=None, args=None)

source code 

Get the score of an object

Parameters:
  • obj - object to score
  • scoreing_class - scoreing strategy used
  • args - additional arguments for the scoreing class's constructor
Returns:
scoreing result from scoreing_class.score(obj)
Overrides: Event.score

See Also: Event

ranking(self, obj, scoreing_class=None, validation_class=None, scoreing_args=None, validation_args=None, reverse=False)

source code 

Get a ranking for a Rankable object

Parameters:
  • obj - ranked object (Category, Course, ...)
  • scoreing_class - scoreing strategy used, None for default strategy
  • validation_class - validation strategy used, None for default strategy
  • scoreing_args - scoreing args, None for default args
  • validation_args - validation args, None for default args
  • reverse - produce reversed ranking
Overrides: Event.ranking

See Also: Event.ranking

list_rankings(self)

source code 
Returns:
list of possible rankings
Overrides: Event.list_rankings
(inherited documentation)

list_legs(self, category)

source code 

Lists all legs in a category.

Returns:
list of CombinedCourse objects