Commit Graph

16 Commits

Author SHA1 Message Date
Zihao Xu
7edae9188b fix(misc): CSV column name mismatches in data loading (#32)
* fix: CSV column name mismatches in data loading

- sect.py: Fix headquarter_name/headquarter_desc -> name/desc when reading sect_region.csv
- sect.py: Move sid initialization before technique lookup to fix unbound variable bug
- technique.py: Change sect (name) to sect_id (int) to match technique.csv column
- elixir.py: Remove redundant get_int(row, "id") that reads non-existent column

These fixes ensure:
1. Sect headquarters display correct location names (e.g., "大千光极城" instead of "不夜城")
2. Sect techniques are correctly associated and displayed
3. Technique sect restrictions work properly

* fix: update main.py to use sect_id, add CSV loading tests

- main.py: Change technique.sect to technique.sect_id in API response
- Add tests/test_csv_loading.py to verify CSV column names match code

* test: add API test for /api/meta/game_data endpoint

Verify that techniques in API response use sect_id field (not sect)

* fix: add None check for hq_region in AvatarFactory

Remove redundant code that adds sect headquarters to known_regions.
This logic is already handled by Avatar._init_known_regions() which
uses sect_id matching (more reliable than name-based lookup).

The removed code was causing a flaky test (~1% failure rate) because
resolve_query returns None in test environments with simplified maps.
2026-01-18 15:31:15 +08:00
bridge
276902bca0 refactor effect system 2026-01-04 22:03:05 +08:00
bridge
3a9a9fd6f0 add choice helper 2026-01-03 22:26:55 +08:00
bridge
a1210589b7 update 2025-11-26 21:56:39 +08:00
bridge
a65a23726e refactor 2025-11-22 15:57:59 +08:00
bridge
99e4871a5d update web, add clickable parts 2025-11-22 15:07:09 +08:00
bridge
259d4a3794 update pack 2025-11-21 23:58:36 +08:00
bridge
5ae2538d86 refactor color system 2025-11-17 23:24:37 +08:00
bridge
af282ad206 add fortunes 2025-10-19 15:19:45 +08:00
bridge
14317a7b78 add more effects 2025-10-16 02:06:04 +08:00
bridge
9d9d9737e5 update 2025-10-16 00:43:31 +08:00
bridge
0d2cc2c3d3 replace prompt with desc 2025-10-12 23:34:19 +08:00
bridge
42dc91aec7 update get info 2025-10-12 01:40:36 +08:00
bridge
83a12c4f3c update technique info 2025-10-10 23:26:03 +08:00
bridge
55145850ca update technique by sect 2025-10-09 23:32:18 +08:00
bridge
aea1923ba6 add technique 2025-10-04 23:06:39 +08:00