Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are arrays of possible grades supposed to be part of the API? #160

Open
8 tasks
musoke opened this issue Nov 9, 2023 · 1 comment
Open
8 tasks

Are arrays of possible grades supposed to be part of the API? #160

musoke opened this issue Nov 9, 2023 · 1 comment
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@musoke
Copy link
Collaborator

musoke commented Nov 9, 2023

src/index.ts exports some constants whose purpose is unclear to me:

sandbag/src/index.ts

Lines 266 to 288 in d5c4170

export const protection = ['G', 'PG', 'PG13', 'R', 'X']
// Bouldering
// Hueco
// Fontainebleau
// Brazilian
export const freeClimbing = {
clean: {
yds: YDS_ARRAY,
class: CLASS_ARRAY,
britishTech: BRITISH_TECH_ARRAY,
britishAdj: BRITISH_ADJ_ARRAY,
French: FRENCH_ARRAY,
UIAA: UIAA_ARRAY,
Ewbank: EWBANK_ARRAY,
Saxon: SAXON_ARRAY,
Norwegian: NORWAY_ARRAY
},
community: {}
}
export const bouldering = {}

It may be useful to expose these in the API, but the intention is unclear and the current definitions are wrong and/or missing.

Are these used anywhere? Or just leftover from earlier versions?

If these exports are intentional, they need to be fixed:

  • bouldering is empty
  • the analogous ice, aid, etc aren't defined
  • class is defined in freeClimbing but not as a GradeScale
  • YDS_ARRAY does not contain +/- grades
  • make it clear what is being exported: is it an ordered list of all possible non-slash grades for each scale for each discipline?
  • The current tests are nearly tautological.

If these exports are removed, the arrays comprising them can be too. Even better, they could be used to make slash grades more robust, as in #158.

  • delete exports
  • move arrays to respective files in src/scales/ and fix slash grades

@vnugent, do you have some insight on the intentions here?

@musoke musoke added bug Something isn't working question Further information is requested labels Nov 9, 2023
@musoke musoke added this to the M10 milestone Nov 10, 2023
@vnugent
Copy link
Contributor

vnugent commented Nov 10, 2023

I think this file is obsolete. It might be a part of the initial version before we created grade scales.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants