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

Update hardcoded sets of Formats utils to be computed programmatically from PS data #9

Closed
scheibo opened this issue Aug 27, 2024 · 1 comment
Assignees
Labels
stats Issue related to @pkmn/stats

Comments

@scheibo
Copy link
Contributor

scheibo commented Aug 27, 2024

Similar to #5 and #6, there exist several outdated hardcoded tables in utils.ts:

stats/stats/src/util.ts

Lines 110 to 139 in 50b3c1b

const NON_SINGLES_FORMATS = new Set([
'battlespotdoubles', 'battlespotspecial7', 'battlespottriples', 'doublesou', 'doublesubers',
'doublesuu', 'gen5doublesou', 'gen5smogondoubles', 'gen7battlespotdoubles',
'gen7doublesanythinggoes', 'gen7doublesanythinggoesbeta', 'gen7doublesou', 'gen7doublesoubeta',
'gen7pokebankdoubleaanythinggoes', 'gen7pokebankdoublesag', 'gen7pokebankdoublesanythinggoes',
'gen7pokebankdoublesou', 'gen7pokebankdoublesoubeta', 'gen7randomdoublesbattle',
'gen7vgc2017', 'gen7vgc2017beta', 'orassmogondoubles', 'randomdoublesbattle', 'smogondoublesuu',
'randomtriplesbattle', 'smogondoubles', 'smogondoublesubers', 'smogontriples', 'smogontriples',
'gen8doublesou', 'gen8doublesubers', 'gen8doublesuu', 'vgc2014', 'vgc2015', 'vgc2016',
'gen6vgc2016', 'gen7vgc2017', 'gen7vgc2018', 'gen7vgc2019', 'gen7vgc2019sunseries',
'gen7vgc2019moonseries', 'gen7vgc2019ultraseries', 'gen8vgc2020', 'gen8vgc2021',
'gen8vgc2021series9', 'gen8vgc2021series9limitonerestrictedrestrictedlegendary', 'gen8vgc2022',
// TODO: add gen9 formats
]);
export function isNonSinglesFormat(format: ID) {
return NON_SINGLES_FORMATS.has(format.endsWith('suspecttest') ? format.slice(0, -11) : format);
}
// FIXME: Generate this based on teamLength from config/formats.js
const NON_6V6_FORMATS = new Set([
'1v1', 'battlespotdoubles', 'battlespotsingles', 'battlespotspecial7', 'challengecup1v1',
'gen5gbusingles', 'gen71v1', 'gen7alolafriendly', 'gen7battlespotdoubles', 'gen81v1',
'gen7battlespotsingles', 'gen7challengecup1v1', 'gen7vgc2017', 'gen7vgc2017beta', 'pgllittlecup',
'vgc2014', 'vgc2015', 'vgc2016', 'gen6vgc2016', 'gen7vgc2017', 'gen7vgc2018', 'gen7vgc2019',
'gen7vgc2019sunseries', 'gen7vgc2019moonseries', 'fen7vgc2019ultraseries', 'gen8vgc2020',
'gen8vgc2021', 'gen8vgc2021series9', 'gen8vgc2021series9limitonerestrictedrestrictedlegendary',
'gen8vgc2022', 'gen8firstblood', 'gen8tagteamsingles',
// TODO: add gen9 formats
]);

These should be updated for legacy mode purposes and then methods like isNonSinglesFormats etc should really just use on information present in the Dex otherwise.

@scheibo
Copy link
Contributor Author

scheibo commented Aug 27, 2024

One actual issue here with programmatically computing formats is that the formats included in the @pkmn/dex package differ from upstream (@pkmn/dex does not include OMoTM formats, for instance), though that shouldn't matter for the formats at play here. The bigger challenge is that many legacy formats get pruned from PS/pkmn, so data on formats like 'orassmogondoubles' no longer exist and may need to remain hardcoded

@scheibo scheibo added the stats Issue related to @pkmn/stats label Aug 27, 2024
@scheibo scheibo self-assigned this Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stats Issue related to @pkmn/stats
Development

No branches or pull requests

1 participant