Classifications
Module providing various classification functionalities.
- class archeryutils.classifications.AGB_ages(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
FlagA Flag enum for holding information about AGB ages.
Note: The 50+ category is represented with the key
OVER_50.- OVER_50 = 1
- ADULT = 2
- UNDER_21 = 4
- UNDER_18 = 8
- UNDER_16 = 16
- UNDER_15 = 32
- UNDER_14 = 64
- UNDER_12 = 128
- AGE_50_PLUS = 1
- AGE_ADULT = 2
- AGE_UNDER_21 = 4
- AGE_UNDER_18 = 8
- AGE_UNDER_16 = 16
- AGE_UNDER_15 = 32
- AGE_UNDER_14 = 64
- AGE_UNDER_12 = 128
- class archeryutils.classifications.AGB_bowstyles(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
FlagAn enum for holding information about AGB bowstyles.
Note that under AGB rules Longbow and English Longbow are identical, but English Longbow is used in field to avoid confusion with World Archery rules in which “Longbow” is equivalent to the Archery GB Flatbow.
- COMPOUND = 1
- RECURVE = 2
- BAREBOW = 4
- LONGBOW = 8
- ENGLISHLONGBOW = 8
- TRADITIONAL = 16
- FLATBOW = 32
- COMPOUNDLIMITED = 64
- COMPOUNDBAREBOW = 128
- class archeryutils.classifications.AGB_genders(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
EnumAn enum for holding information about AGB genders.
The Open category is equivalent to Male for scores following 2025 rule changes. Scores remain the same, only branding has changed.
- OPEN = 1
- MALE = 1
- FEMALE = 2
- archeryutils.classifications.agb_field_classification_scores(archery_round, bowstyle, gender, age_group, strict_rounds=True, strict_distance=True)[source]
Calculate AGB field classification scores for category.
Subroutine to calculate classification scores for a specific category and round. Appropriate for 2025 ArcheryGB age groups and classifications.
- Parameters:
archery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be usedbowstyle (
str) – archer’s bowstyle under AGB field target rulesgender (
str) – archer’s gender under AGB field target rulesage_group (
str) – archer’s age group under AGB field target rulesstrict_rounds (
bool, defaultTrue) – Whether to enforce valid AGB field rounds and apply prestige rounds rules. If False then archery_round must be of type Round for explicit clarity. Any max-distance rounds return MB-tier classifications (not just 24-target).strict_distance (
bool, defaultTrue) – Whether to enforce age- and bowstyle-dependent upper and lower distance restrictions. Includes removing red-peg (>50m) for unsighted bowstyles and >60m for sighted.
- Returns:
classification_scores – abbreviation of the classification appropriate for this score
- Return type:
ndarray
References
ArcheryGB 2025 Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7 (2025)
- Raises:
ValueError – If requested round is not valid for this scheme (when strict_rounds enabled)
TypeError – If archery_round is passed as a string when strict_rounds disabled
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> wa_field = load_rounds.WA_field >>> cf.agb_field_classification_scores( ... wa_field.wa_field_24_red_marked, ... cf.AGB_bowstyles.COMPOUND, ... cf.AGB_genders.OPEN, ... cf.AGB_ages.ADULT, ... ) [408, 391, 369, 345, 318, 286, 248, 204, 157]
If a classification cannot be achieved a fill value of -9999 is returned:
>>> cf.agb_field_classification_scores( ... wa_field.wa_field_12_red_unmarked, ... cf.AGB_bowstyles.COMPOUND, ... cf.AGB_genders.OPEN, ... cf.AGB_ages.ADULT, ... ) [-9999, -9999, -9999, 173, 159, 143, 124, 102, 79],
- archeryutils.classifications.agb_indoor_classification_scores(archery_round, bowstyle, gender, age_group, strict_rounds=True)[source]
Calculate 2023 AGB indoor classification scores for category.
Subroutine to calculate classification scores for a specific category and round. Appropriate ArcheryGB age groups and classifications.
- Parameters:
archery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be usedbowstyle (
AGB_bowstyles) – archer’s bowstyle under AGB indoor target rulesgender (
AGB_genders) – archer’s gender under AGB indoor target rulesage_group (
AGB_ages) – archer’s age group under AGB indoor target rulesstrict_rounds (
bool) – Whether to enforce valid AGB rounds only
- Returns:
classification_scores – scores required for each classification in descending order
- Return type:
ndarray
References
ArcheryGB Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7
- Raises:
ValueError – If requested round is not valid for this scheme (when strict_rounds enabled)
TypeError – If archery_round is passed as a string when strict_rounds disabled
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> agb_outdoor = load_rounds.AGB_indoor >>> cf.agb_indoor_classification_scores( ... agb_indoor.portsmouth, ... cf.AGB_bowstyles.BAREBOW, ... cf.AGB_genders.OPEN, ... cf.AGB_ages.UNDER_12, ... ) [411, 360, 301, 240, 183, 134, 95, 66]
If a classification cannot be achieved a fill value of -9999 is returned:
>>> cf.agb_indoor_classification_scores( ... agb_indoor.worcester, ... cf.AGB_bowstyles.COMPOUND, ... cf.AGB_genders.FEMALE, ... cf.AGB_ages.ADULT, ... ) [-9999, -9999, 298, 289, 276, 257, 233, 200]
- archeryutils.classifications.agb_old_field_classification_scores(archery_round, bowstyle, gender, age_group)[source]
Calculate old (pre-2025) AGB field classification scores for category.
Subroutine to calculate classification scores for a specific category and round. Appropriate ArcheryGB age groups and classifications.
- Parameters:
archery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be usedbowstyle (
AGB_bowstyles) – archer’s bowstyle under old AGB field rulesgender (
AGB_genders) – archer’s gender under old AGB field rulesage_group (
AGB_ages) – archer’s age group under old AGB field rules
- Returns:
classification_scores – scores required for each classification in descending order
- Return type:
listofint
References
ArcheryGB Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> wa_field = load_rounds.WA_field >>> cf.agb_old_field_classification_scores( ... wa_field.wa_field_24_red_marked, ... cf.AGB_bowstyles.RECURVE, ... cf.AGB_genders.MALE, ... cf.AGB_ages.ADULT, ... ) [338, 317, 288, 260, 231, 203]
- archeryutils.classifications.agb_old_indoor_classification_scores(archery_round, bowstyle, gender, age_group, strict_rounds=True)[source]
Calculate AGB indoor classification scores for category.
Subroutine to calculate classification scores for a specific category and round. Appropriate ArcheryGB age groups and classifications.
- Parameters:
archery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be usedbowstyle (
AGB_bowstyles) – archer’s bowstyle under AGB indoor target rulesgender (
AGB_genders) – archer’s gender under AGB indoor target rulesage_group (
AGB_ages) – archer’s age group under AGB indoor target rulesstrict_rounds (
bool) – Whether to enforce valid AGB rounds only
- Returns:
classification_scores – scores required for each classification in descending order
- Return type:
ndarray- Raises:
ValueError – If requested round is not valid for this scheme (when strict_rounds enabled)
TypeError – If archery_round is passed as a string when strict_rounds disabled
References
ArcheryGB Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> agb_outdoor = load_rounds.AGB_indoor >>> cf.agb_old_indoor_classification_scores( ... agb_indoor.portsmouth, ... AGB_bowstyles.RECURVE, ... AGB_genders.MALE, ... AGB_ages.ADULT, ... ) [592, 582, 554, 505, 432, 315, 195, 139]
- archeryutils.classifications.agb_outdoor_classification_scores(archery_round, bowstyle, gender, age_group, strict_rounds=True, strict_distance=True)[source]
Calculate AGB outdoor classification scores for category.
Subroutine to calculate classification scores for a specific category and round. Appropriate for 2023 ArcheryGB age groups and classifications.
- Parameters:
archery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be usedbowstyle (
AGB_bowstyles) – archer’s bowstyle under AGB outdoor target rulesgender (
AGB_genders) – archer’s gender under AGB outdoor target rulesage_group (
AGB_ages) – archer’s age group under AGB outdoor target rulesstrict_rounds (
bool, defaultTrue) – Whether to enforce valid AGB rounds only and prestige rounds rules If False prestige rounds will no longer default to give all classifications and max-distance rounds will return scores for MB classifications.strict_distance (
bool, defaultTrue) – Whether to enforce age-dependent distance restrictions
- Returns:
classification_scores – scores required for each classification in descending order
- Return type:
ndarray
References
ArcheryGB 2023 Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7 (2023)
- Raises:
ValueError – If requested round is not valid for this scheme (when strict_rounds enabled)
TypeError – If archery_round is passed as a string when strict_rounds disabled
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> agb_outdoor = load_rounds.AGB_outdoor_imperial >>> cf.agb_outdoor_classification_scores( ... agb_outdoor.hereford, ... cf.AGB_bowstyles.RECURVE, ... cf.AGB_genders.FEMALE, ... cf.AGB_ages.ADULT, ... ) [1232, 1178, 1107, 1015, 900, 763, 614, 466, 336]
If a classification cannot be achieved a fill value of -9999 is returned:
>>> cf.agb_outdoor_classification_scores( ... agb_outdoor.bristol_ii, ... cf.AGB_bowstyles.RECURVE, ... cf.AGB_genders.FEMALE, ... cf.AGB_ages.ADULT, ... ) [-9999, -9999, -9999, -9999, -9999, 931, 797, 646, 493]
- archeryutils.classifications.calculate_agb_field_classification(score, archery_round, bowstyle, gender, age_group, strict_rounds=True, strict_distance=True)[source]
Calculate AGB field classification from score.
Calculate a classification from a score given suitable inputs. Appropriate for 2025 ArcheryGB age groups and classifications.
- Parameters:
score (
int) – numerical score on the round to calculate classification forarchery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be used (provided strict_rounds)bowstyle (
AGB_bowstyles) – archer’s bowstyle under AGB field rulesgender (
AGB_genders) – archer’s gender under AGB field rulesage_group (
AGB_ages) – archer’s age group under AGB field rulesstrict_rounds (
bool, defaultTrue) – Whether to enforce valid AGB field rounds and apply prestige rounds rules. If False then archery_round must be of type Round for explicit clarity. Any max-distance rounds return MB-tier classifications (not just 24-target).strict_distance (
bool, defaultTrue) – Whether to enforce age- and bowstyle-dependent upper and lower distance restrictions. Includes removing red-peg (>50m) for unsighted bowstyles and >60m for sighted.
- Returns:
classification_from_score – abbreviation of the classification appropriate for this score
- Return type:
str
References
ArcheryGB 2025 Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7 (2025)
- Raises:
ValueError – If requested round is not valid for this scheme (when strict_rounds enabled) If an invalid score for the requested round is provided
TypeError – If archery_round is passed as a string when strict_rounds disabled
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> wa_field = load_rounds.WA_field >>> cf.calculate_agb_field_classification( ... 177, ... wa_field.wa_field_24_blue_marked, ... cf.AGB_bowstyles.TRADITIONAL, ... cf.AGB_genders.OPEN, ... cf.AGB_ages.UNDER_18, ... ) 'B1'
- archeryutils.classifications.calculate_agb_indoor_classification(score, archery_round, bowstyle, gender, age_group, strict_rounds=True)[source]
Calculate new (2023) AGB indoor classification from score.
Subroutine to calculate a classification from a score given suitable inputs. Appropriate for 2023 ArcheryGB age groups and classifications.
- Parameters:
score (
int) – numerical score on the round to calculate classification forarchery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be usedbowstyle (
AGB_bowstyles) – archer’s bowstyle under AGB indoor target rulesgender (
AGB_genders) – archer’s gender under AGB indoor target rulesage_group (
AGB_ages) – archer’s age group under AGB indoor target rulesstrict_rounds (
bool) – Whether to enforce valid AGB rounds only
- Returns:
classification_from_score – the classification appropriate for this score
- Return type:
str- Raises:
ValueError – If requested round is not valid for this scheme (when strict_rounds enabled) If an invalid score for the requested round is provided
TypeError – If archery_round is passed as a string when strict_rounds disabled
References
ArcheryGB 2023 Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7 (2023)
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> agb_indoor = load_rounds.AGB_indoor >>> cf.calculate_agb_indoor_classification( ... 547, ... agb_indoor.wa18, ... cf.AGB_bowstyles.COMPOUND, ... cf.AGB_genders.OPEN, ... cf.AGB_ages.OVER_50, ... ) 'I-B2'
- archeryutils.classifications.calculate_agb_old_field_classification(archery_round, score, bowstyle, gender, age_group)[source]
Calculate old (pre-2025) AGB field classification from score.
Subroutine to calculate a classification from a score given suitable inputs.
- Parameters:
score (
float) – numerical score on the round to calculate classification forarchery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be usedbowstyle (
AGB_bowstyles) – archer’s bowstyle under old AGB field rulesgender (
AGB_genders) – archer’s gender under old AGB field rulesage_group (
AGB_ages) – archer’s age group under old AGB field rules
- Returns:
classification_from_score – the classification appropriate for this score
- Return type:
str- Raises:
ValueError – If an invalid score for the requested round is provided
References
ArcheryGB 2023 Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7 (2023)
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> wa_field = load_rounds.WA_field >>> cf.calculate_agb_old_field_classification( ... 247, ... wa_field.wa_field_24_red_marked, ... cf.AGB_bowstyles.RECURVE, ... cf.AGB_genders.MALE, ... cf.AGB_ages.ADULT, ... ) '2nd Class'
- archeryutils.classifications.calculate_agb_old_indoor_classification(score, archery_round, bowstyle, gender, age_group, strict_rounds=True)[source]
Calculate AGB indoor classification from score.
Subroutine to calculate a classification from a score given suitable inputs. Appropriate for 2023 ArcheryGB age groups and classifications.
- Parameters:
score (
int) – numerical score on the round to calculate classification forarchery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be usedbowstyle (
AGB_bowstyles) – archer’s bowstyle under AGB indoor target rulesgender (
AGB_genders) – archer’s gender under AGB indoor target rulesage_group (
AGB_ages) – archer’s age group under AGB indoor target rulesstrict_rounds (
bool) – Whether to enforce valid AGB rounds only
- Returns:
classification_from_score – the classification appropriate for this score
- Return type:
str- Raises:
ValueError – If requested round is not valid for this scheme (when strict_rounds enabled) If an invalid score for the requested round is provided
TypeError – If archery_round is passed as a string when strict_rounds disabled
References
ArcheryGB Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7 (pre-2023)
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> agb_indoor = load_rounds.AGB_indoor >>> cf.calculate_agb_old_indoor_classification( ... 547, ... agb_indoor.wa18, ... AGB_bowstyles.COMPOUND, ... AGB_genders.MALE, ... AGB_ages.ADULT, ... ) 'C'
- archeryutils.classifications.calculate_agb_outdoor_classification(score, archery_round, bowstyle, gender, age_group, strict_rounds=True, strict_distance=True)[source]
Calculate AGB outdoor classification from score.
Calculate a classification from a score given suitable inputs. Appropriate for 2023 ArcheryGB age groups and classifications.
- Parameters:
score (
int) – numerical score on the round to calculate classification forarchery_round (
Round | str) – an archeryutils Round object as suitable for this scheme alternatively the round codename as a str can be used (provided strict_rounds)bowstyle (
AGB_bowstyles) – archer’s bowstyle under AGB outdoor target rulesgender (
AGB_genders) – archer’s gender under AGB outdoor target rulesage_group (
AGB_ages) – archer’s age group under AGB outdoor target rulesstrict_rounds (
bool, defaultTrue) – Whether to enforce valid AGB outdoor rounds and apply prestige rounds rules. If False then archery_round must be of type Round for explicit clarity. Prestige rounds will no longer default to allow MB classifications and any max-distance rounds will return MB-tier classifications.strict_distance (
bool, defaultTrue) – Whether to enforce age-dependent distance restrictions
- Returns:
classification_from_score – abbreviation of the classification appropriate for this score
- Return type:
str
References
ArcheryGB 2023 Rules of Shooting ArcheryGB Shooting Administrative Procedures - SAP7 (2023)
- Raises:
ValueError – If requested round is not valid for this scheme (when strict_rounds enabled) If an invalid score for the requested round is provided
TypeError – If archery_round is passed as a string when strict_rounds disabled
Examples
>>> from archeryutils import classifications as cf >>> from archeryutils import load_rounds >>> agb_outdoor = load_rounds.AGB_outdoor_imperial >>> cf.calculate_agb_outdoor_classification( ... 858, ... agb_outdoor.hereford, ... cf.AGB_bowstyles.RECURVE, ... cf.AGB_genders.FEMALE, ... cf.AGB_ages.UNDER_18, ... ) 'B1'
- archeryutils.classifications.coax_field_group(bowstyle, gender, age_group)[source]
Coax category not conforming to field classification rules to one that does.
- Parameters:
bowstyle (
AGB_bowstyles) – archer’s bowstylegender (
AGB_genders) – archer’s gender under AGBage_group (
AGB_ages) – archer’s age group
- Returns:
typed dict of archer’s bowstyle, gender, and age_group under AGB coaxed to field rules
- Return type:
TypedDict
- archeryutils.classifications.coax_indoor_group(bowstyle, gender, age_group)[source]
Coax category not conforming to indoor classification rules to one that does.
- Parameters:
bowstyle (
AGB_bowstyles) – archer’s bowstylegender (
AGB_genders) – archer’s gender under AGBage_group (
AGB_ages) – archer’s age group
- Returns:
typed dict of archer’s bowstyle, gender, and age_group under AGB coaxed to indoor target rules
- Return type:
TypedDict
- archeryutils.classifications.coax_old_field_group(bowstyle, gender, age_group)[source]
Coax category not conforming to old field classification rules to one that does.
- Parameters:
bowstyle (
AGB_bowstyles) – archer’s bowstylegender (
AGB_genders) – archer’s gender under AGBage_group (
AGB_ages) – archer’s age group
- Returns:
typed dict of archer’s bowstyle, gender, and age_group under AGB coaxed to old field rules
- Return type:
TypedDict
- archeryutils.classifications.coax_old_indoor_group(bowstyle, gender, age_group)[source]
Coax category not conforming to old indoor classification rules to one that does.
- Parameters:
bowstyle (
AGB_bowstyles) – archer’s bowstylegender (
AGB_genders) – archer’s gender under AGBage_group (
AGB_ages) – archer’s age group
- Returns:
typed dict of archer’s bowstyle, gender, and age_group under AGB coaxed to old indoor rules
- Return type:
TypedDict
- archeryutils.classifications.coax_outdoor_group(bowstyle, gender, age_group)[source]
Coax category not conforming to outdoor classification rules to one that does.
- Parameters:
bowstyle (
AGB_bowstyles) – archer’s bowstylegender (
AGB_genders) – archer’s gender under AGBage_group (
AGB_ages) – archer’s age group
- Returns:
dict of archer’s bowstyle, gender, and age_group under AGB coaxed to outdoor target rules
- Return type:
dict[str,AGB_bowstyles | AGB_genders | AGB_ages]