feat(input): use RAG/운곡교P1입력.xlsx as the P1 input
- public/samples/운곡교P1입력.xlsx is a byte copy of RAG/운곡교P1입력.xlsx - loadP1 and the sample loader read the three-sheet input - spec workbook (intent.PR) stays for the single-sheet regression tests - test: input file has sheets 교각 · IP · 받침 and parses to P1 with no issues Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
def1e1b9fc
commit
68e56d1037
4 files changed
+23
-6
No files matched your search
+10
-3
@@ -4,14 +4,21 @@ import * as XLSX from 'xlsx';
|
||||
import { parseWorkbook } from '../src/core/parseWorkbook';
|
||||
import type { PierInput } from '../src/core/types';
|
||||
|
||||
const P1_PATH = fileURLToPath(new URL('../public/samples/P1.xlsx', import.meta.url));
|
||||
/** Spec workbook (RAG/Pier ui_xxx.xlsx, sheet intent.PR, all tables on one sheet). Used by single-sheet tests. */
|
||||
const SPEC_PATH = fileURLToPath(new URL('../public/samples/P1.xlsx', import.meta.url));
|
||||
/** User input (RAG/운곡교P1입력.xlsx, three sheets 교각 · IP · 받침). This is the P1 input used by the app and tests. */
|
||||
const INPUT_PATH = fileURLToPath(new URL('../public/samples/운곡교P1입력.xlsx', import.meta.url));
|
||||
|
||||
export function loadWorkbook(path: string = P1_PATH): XLSX.WorkBook {
|
||||
export function loadWorkbook(path: string = SPEC_PATH): XLSX.WorkBook {
|
||||
return XLSX.read(readFileSync(path), { type: 'buffer' });
|
||||
}
|
||||
|
||||
export function loadInputWorkbook(): XLSX.WorkBook {
|
||||
return loadWorkbook(INPUT_PATH);
|
||||
}
|
||||
|
||||
export function loadP1(): PierInput {
|
||||
const { piers, issues } = parseWorkbook(loadWorkbook());
|
||||
const { piers, issues } = parseWorkbook(loadInputWorkbook());
|
||||
if (issues.length) throw new Error(`P1 parse issues: ${JSON.stringify(issues)}`);
|
||||
const p1 = piers.find((p) => p.name === 'P1');
|
||||
if (!p1) throw new Error('P1 not found');
|
||||
|
||||
Reference in new issue
Block a user