Welcome to redpoint’s documentation!¶
- class redpoint.Grade(value: str, scale: str)¶
A class representing one single grade from a given grading system.
Grade
supports the following operations:adding (+ int), getting x harder grade.
Grade("5a", "French") + 2 == Grade("5b", "French")
substracting (- int), getting x easier grade.
Grade("5.12a", "YDS") - 5 == Grade("5.10d", "YDS")
comparing between grades of any system (==, >, >, >=, <=)
Each grade has its own
universal_grade
, that is basically a range with a start position and lenght, which is used for conversion between the systems as well as for comparisons between the grades.- to(system_name: str, method: CONVERSION_METHOD = CONVERSION_METHOD.AVERAGE) Grade | None ¶
Converts the grade to a given scale.
- Parameters:
system_name (str) – The grading system onto which the grade will be converted
method (METHOD_MAPPING, optional) – The method of conversion. Defaults to METHOD_MAPPING.AVERAGE.
- Returns:
The converted grade
- Return type:
- to_range(system_name) list[Grade] ¶
Converts the grade to all possible grades in another system.
This method makes sense when converting onto a system that has a greater number of grades. For example In YDS (Yosemitee Decimal System) the grades span much more than in French. 5.8 in YDS includes 4c+, 5a, 5a+ in French system.
- Parameters:
system_name (str) – The grading system onto which the grade will be converted
- Raises:
ConversionError – When the given system type is different. BOULDER cannot be converted into SPORT and viceversa
- Returns:
The converted list of grades
- Return type:
list[Grade]
- class redpoint.GradingSystem(name: str)¶
A class representing a grading system.
For supported systems take a look at
VALID_NAMES
list.GradingSystem
supports the following operations:can be iterated over
for x in system:
can be indexed to return a
Grade
,GradingSystem("YDS")["5.8"]
- add_to_indexed_grade(system_index: int, offset: int) Grade ¶
Finds a grade that is
offset
in offset tosystem_index
grade.Example
6a is a 30th grade of French-sport system. Adding the offset of 2 will result in the 6b grade as it is the 2nd grade after 6a.
- Parameters:
scale_index (int) – The index of the base grade.
offset (int) – The offset that will be used to shift the base grade.
- Raises:
UnknownGrade – When the resulting grade is outside of the known range.
- Returns:
The resulting shifted grade.
- Return type:
- find_grade(universal_value: int) Grade | None ¶
Returns a grade that matches the given universal value.
- Parameters:
universal_value (int) – The value of the grade in the universal system.
- Returns:
The grade that matches the universal value.
- Return type:
Optional[Grade]
- get_grade_index(key: str) tuple[GradeInfo, int] ¶
Returns the universal value of the grade and its index in the system.
- Parameters:
key (str) – name of the grade
- Raises:
UnknownGrade – when the grade is not found in the system.
- Returns:
the universal value of the grade and its index
- Return type:
tuple[UniversalGrade, int]
- class redpoint.CONVERSION_METHOD(value)¶
Method used to convert the grades. Uses universal value to compare the grades.
MIN - the easiest possible grade in that range,
universal_value.start
AVERAGE - the average grade in that range,
(universal_value.start + universal_value.end)//2
MAX - the hardest grade in that range,
universal_value.end
- class redpoint.SYSTEM_TYPE(value)¶
Internally used to indicate from which type is the grading system.
- exception redpoint.UnknownGrade¶
Indicates an unknown grade. Can be a typo or a grade outside of the grading system.
- exception redpoint.UnknownSystem¶
Indicates an unknown grading system.
- exception redpoint.ConversionError¶
Raised when trying to convert different types of grades, e.g sport -> boulder.
redpoint.systems
¶
systems
includes helper classes to reduce using Grade
class.
Instead of writing Grade("7a", "French")
you can just write French("7a")
.
- class redpoint.systems.BandSport(value: str)¶
- class redpoint.systems.Ewbanks(value: str)¶
- class redpoint.systems.YDS(value: str)¶
- class redpoint.systems.IRCRA(value: str)¶
- class redpoint.systems.NCCS(value: str)¶
- class redpoint.systems.French(value: str)¶
- class redpoint.systems.British(value: str)¶
- class redpoint.systems.UIAA(value: str)¶
- class redpoint.systems.SouthAfrican(value: str)¶
- class redpoint.systems.OldSouthAfrican(value: str)¶
- class redpoint.systems.Saxon(value: str)¶
- class redpoint.systems.Finnish(value: str)¶
- class redpoint.systems.Norwegian(value: str)¶
- class redpoint.systems.Polish(value: str)¶
- class redpoint.systems.Brazilian(value: str)¶
- class redpoint.systems.Swedish(value: str)¶
- class redpoint.systems.Russian(value: str)¶
- class redpoint.systems.BandBoulder(value: str)¶
- class redpoint.systems.VScale(value: str)¶
- class redpoint.systems.BScale(value: str)¶
- class redpoint.systems.SScale(value: str)¶
- class redpoint.systems.PScale(value: str)¶
- class redpoint.systems.JoshuaTree(value: str)¶
- class redpoint.systems.Font(value: str)¶
- class redpoint.systems.AnnotBScale(value: str)¶
- class redpoint.systems.FontTraverse(value: str)¶
- class redpoint.systems.BandOther(value: str)¶
- class redpoint.systems.Aid(value: str)¶
- class redpoint.systems.AlpineIce(value: str)¶
- class redpoint.systems.WaterIce(value: str)¶
- class redpoint.systems.RockIce(value: str)¶
- class redpoint.systems.FerrataSchall(value: str)¶
- class redpoint.systems.FerrataNum(value: str)¶
- class redpoint.systems.FerrataFrench(value: str)¶
- class redpoint.systems.ScottishWinter(value: str)¶