Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibo committed Aug 1, 2023
1 parent 6365d99 commit 5883275
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 23 deletions.
6 changes: 3 additions & 3 deletions anon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pkmn/anon",
"version": "0.1.6",
"version": "0.1.7",
"description": "Logic for anonymizing Pokémon Showdown battle simulator logs",
"repository": "github:pkmn/stats",
"license": "MIT",
Expand All @@ -16,11 +16,11 @@
"access": "public"
},
"dependencies": {
"@pkmn/data": "^0.7.45",
"@pkmn/data": "^0.7.47",
"@pkmn/protocol": "^0.6.12"
},
"devDependencies": {
"@pkmn/dex": "^0.7.45"
"@pkmn/dex": "^0.7.47"
},
"scripts": {
"lint": "eslint --cache src --ext ts",
Expand Down
1 change: 1 addition & 0 deletions logs/src/checkpoints.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
import {Configuration, ID} from './config';
import {CheckpointStorage} from './storage';

Expand Down
1 change: 1 addition & 0 deletions logs/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
import * as path from 'path';

import * as util from './util';
Expand Down
1 change: 1 addition & 0 deletions logs/src/storage.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
import * as path from 'path';

import {Batch, Checkpoint} from './checkpoints';
Expand Down
2 changes: 1 addition & 1 deletion logs/src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/* eslint-disable */
import * as threads from 'bthreads';

import {Batch, Checkpoint} from './checkpoints';
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"license": "MIT",
"dependencies": {
"@pkmn/anon": "file:anon",
"@pkmn/data": "^0.7.45",
"@pkmn/dex": "^0.7.45",
"@pkmn/data": "^0.7.47",
"@pkmn/dex": "^0.7.47",
"@pkmn/logs": "file:logs",
"@pkmn/stats": "file:stats",
"json-stringify-pretty-compact": "3.0.0",
Expand All @@ -17,17 +17,17 @@
"@pkmn/sets": "^5.0.4"
},
"devDependencies": {
"@babel/preset-env": "^7.22.5",
"@babel/preset-env": "^7.22.9",
"@babel/preset-typescript": "^7.22.5",
"@pkmn/eslint-config": "^3.3.0",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.3",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"eslint": "^8.44.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.2",
"jest": "^29.5.0",
"@pkmn/eslint-config": "^5.1.0",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.5",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"eslint": "^8.46.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jest": "^27.2.3",
"jest": "^29.6.2",
"subpkg": "^4.1.0",
"tsup": "^7.1.0",
"typescript": "^5.1.6"
Expand Down
11 changes: 7 additions & 4 deletions stats/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pkmn/stats",
"version": "0.2.8",
"version": "0.2.9",
"description": "Logic for processing usage stats from Pokémon Showdown battle simulator logs",
"repository": "github:pkmn/stats",
"license": "MIT",
Expand All @@ -16,10 +16,10 @@
"access": "public"
},
"dependencies": {
"@pkmn/data": "^0.7.45"
"@pkmn/data": "^0.7.47"
},
"devDependencies": {
"@pkmn/dex": "^0.7.45",
"@pkmn/dex": "^0.7.47",
"json-stringify-pretty-compact": "3.0.0"
},
"scripts": {
Expand Down Expand Up @@ -50,6 +50,9 @@
]
},
"eslintConfig": {
"extends": "@pkmn"
"extends": "@pkmn",
"rules": {
"@typescript-eslint/no-redundant-type-constituents": "off"
}
}
}
4 changes: 3 additions & 1 deletion stats/src/binary.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Dex, Generation, ID, PokemonSet, StatsTable, TypeName, toID} from '@pkmn/data';
import {Dex, Generation, ID, PokemonSet, TypeName, toID} from '@pkmn/data';

import * as parser from './parser';
import {weighting} from './util';
Expand Down Expand Up @@ -453,11 +453,13 @@ function round(v: number, p = 1e4) {
return Math.round(v * p);
}

/*
function bias(stats: StatsTable) {
const [first, second] = Object.entries(stats).sort((a, b) => b[1] - a[1]);
// TODO: convert this pair (eg. 'atkhp') to a number
return first[0] > second[0] ? [first[0], second[0]] : [second[0], first[0]];
}
*/

export const Binary = {Read, Write, Sizes, Log, Team, Stats, Display};

Expand Down
2 changes: 1 addition & 1 deletion stats/src/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const Display = new class {

const q = Object.entries(stats.pokemon);
const real = ['challengecup1v1', '1v1'].includes(format);
const total = Math.max(1.0, real ? stats.usage.real : stats.usage.weighted);
// const total = Math.max(1.0, real ? stats.usage.real : stats.usage.weighted);
if (['randombattle', 'challengecup', 'challengcup1v1', 'seasonal'].includes(format)) {
q.sort((a, b) => N(a[0]).localeCompare(N(b[0])));
} else if (real) {
Expand Down
3 changes: 2 additions & 1 deletion workflows/smogon/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ const StatsWorker = new class extends CombineWorker<Configuration, ApplyState, C
};
}

async processLog(log: string, state: ApplyState, shard?: string) {
// async processLog(log: string, state: ApplyState, shard?: string) {
async processLog(log: string, state: ApplyState) {
const raw = JSON.parse(await this.storage.logs.read(log));
const battle = Parser.parse(state.gen, state.format, raw);
Stats.updateWeighted(
Expand Down

0 comments on commit 5883275

Please sign in to comment.