Skip to content

Conversation

@Stevie-Ray
Copy link

Add IRCRA grading scale support (fixes #179)

Adds support for the IRCRA integer scale from Reporting Grades in Climbing Research.
This lets Sandbag convert between systems (French, YDS, Font, V-scale, etc.) using a shared universal scale, super useful for research and data comparisons. Includes mappings and tests.

@github-actions
Copy link

Coverage report

Caution

Coverage does not meet threshold
Statements coverage not met for global: expected <=999999 not covered statements, but got 649

St.
Category Percentage Covered / Total
🟢 Statements
88.18% (+0.68% 🔼)
649/736
🟡 Branches
69.15% (+1.61% 🔼)
139/201
🟢 Functions
80.38% (+0.51% 🔼)
127/158
🟢 Lines
87.41% (+0.72% 🔼)
597/683
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢 scales/ircra.ts 100% 100% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 index.ts 100% 100%
35% (-1.84% 🔻)
100%

Test suite run success

294 tests passing in 18 suites.

Report generated by 🧪jest coverage report action from f31bff4

@musoke
Copy link
Collaborator

musoke commented Nov 3, 2025

Thank you for this!
Very interesting. Is the table on https://ircra.rocks/reporting-grades-in-climbing-research/ consistent with ours? I am concerned that our current table doesn't align completely with the IRCRA table, so may give unexpected results.

@Stevie-Ray
Copy link
Author

Hi @musoke, i used the GradeParser.ts in __tests__ to match the internal grading system. Is the sandbag 107 grades based on some other sheet or system?

    test('convert IRCRA to FONT', () => {
      expect(convertGrade('14', GradeScales.IRCRA, GradeScales.FONT)).toEqual('5b+/5c')
    })

    test('convert IRCRA to VSCALE', () => {
      expect(convertGrade('14', GradeScales.IRCRA, GradeScales.VSCALE)).toEqual('V2')
    })

    test('convert IRCRA to YDS', () => {
      expect(convertGrade('15', GradeScales.IRCRA, GradeScales.YDS)).toEqual('5.10a')
    })

    test('convert IRCRA to French', () => {
      expect(convertGrade('15', GradeScales.IRCRA, GradeScales.FRENCH)).toEqual('5c+/6a')
    })

    // Test reverse conversions
    test('convert FONT to IRCRA', () => {
      expect(convertGrade('6a', GradeScales.FONT, GradeScales.IRCRA)).toEqual('15/16')
    })

    test('convert VSCALE to IRCRA', () => {
      expect(convertGrade('V2', GradeScales.VSCALE, GradeScales.IRCRA)).toEqual('13/14')
    })

It was kind of tricky to make it match perfectly, but as you can see in the image, there is no perfect alignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add IRCRA reporting scale for research-grade conversions

2 participants