teamrsm / analytic-spraydown

Fulfill all your spraying needs
1 stars 0 forks source link

Implement grade parser #65

Open SaidPar opened 6 years ago

SaidPar commented 6 years ago

We need a reliable way to parse the many variations on grades:

v1-2
5.10a/b
5.7+
5.9-

etc..
climbage commented 6 years ago

Do we have a larger list of possible grades? It's going to be all the edge cases that get us.

climbak commented 6 years ago

What are you covering so far? I'll write up what I can think of when I get home.

climbage commented 6 years ago

So what I'm going to do is actually just build a grade normalizer. It will normalize grades so that they can be looked up in the database.

This is what I have so far:

before after
5.10 5.10c (based on existing grade manager logic)
5.10a 5.10a
5.10A 5.10a
5.10a/b 5.10a
5.7+ 5.7d
5.9- 5.9a
5.10a-b 5.10a
5.9-10 5.9d
5.9easy 5.9 (should be 5.9a?)
climbage commented 6 years ago

I'm thinking maybe the default letter grade should be 'b'. So 5.10 -> 5.10b. I'm thinking easier because usually the easier ones don't have letter grades?

climbak commented 6 years ago

There are also the danger ratings, pg13, r, x. We've been defaulting no later grade for 5.10 and up to b for simplicity, but we wanted to be smarter at some point and potentially slot them in to the pyramid where there are empty slots when it makes sense.

Also, we ignore all modifiers below 5.10, but that doesn't mean we have to

climbak commented 6 years ago

Are you handling bouldering grades yet?

climbage commented 6 years ago

I'm ignoring danger ratings.

We've been defaulting no later grade for 5.10 and up to b for simplicity

You sure? Looking at the code it seems like it's defaulting to c.

Also, we ignore all modifiers below 5.10, but that doesn't mean we have to

Doesn't matter to me.

Are you handling bouldering grades yet?

Yep - no split grades though yet.

climbak commented 6 years ago

No not sure, I meant to default to b, but maybe I typed c