Repository navigation
fix(statcalc): build units that start above one star - #197
Merged
Merged
Conversation
GameDataBuilder only promoted a unit's rarity-1 definition to its base entry, so a unit with no ONE_STAR row was silently dropped from unitData even though its growth tables were collected. ADELPHIRANGER starts at 2 stars and was missing as a result. Use each unit's lowest-rarity definition as its base instead. The fields the builder reads (skills, gear tiers, relics, categories, crew) are identical across rarities, so this is equivalent for every unit that does have a 1-star row. Unknown rarity enums (normalised to 0) are still ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GameDataBuilderdroppedADELPHIRANGERfromunitData. It is the only obtainable unit with noONE_STARdefinition (it starts at 2★), and the builder only took a unit's base definition from its rarity-1 row. Its growth tables were collected, but no unit entry was ever created.The base definition is now each unit's lowest-rarity row:
for unit in obtainable_units: record statProgressionId under unit.rarity - if rarity == 1: + if 0 < rarity < lowest rarity seen for this baseId: base_units[baseId] = unitbasePowerandpromotionRecipeReferencediffer. So output for every unit that does have a 1★ row is unchanged.0 <guard keeps unknown rarity enums (normalised to0) out of the base, as before.Evidence
test_unit_without_one_star_row_uses_lowest_rarity_as_basefails 6/6 (character and ship × ascending, descending and enum rarities). A live build returns 412 units with noADELPHIRANGER.After: 6/6 pass and the full unit suite passes (1556). Live builds against a Comlink instance, sync and async, return 413 units.
ADELPHIRANGERhas growth tables for 2★–7★, 4 skills and 13 gear tiers.calc_char_statsat 7★ / L85 / G13 gives GP 14,145, Strength 1,498, Speed 145.Not verified: the stat values themselves. There was no swgoh-stats service to compare against.
Merge Danger
Door: two-way. A single-function change with no data or API changes; reverting it is clean.
Blast Radius: narrow. Only
_build_unit_datachanges, and only units without a 1★ row get new output.Related Issues
None.
Type of Change
Checklist
developbranch (only release PRs targetmain)feat:,fix:,refactor:, etc.) — they become the changelogCHANGELOG.mdby hand (it is generated from commit messages)README.md,docs/,examples/) if user-facing behavior changeduv run pytest tests/)uv run ruff check src/ tests/anduv run ruff format --check src/ tests/)uv run ty check src/swgoh_comlink/)🤖 Generated with Claude Code