model.py: gemeinsames TRO-Modell; Hauptweg CSV -> tro_flow --json -> scl_skeleton

- lib/model.py (neu, pydantic): TroBase -> DerivedTro, Connection, OpenPoint,
  Analysis (aus tro_flow verschoben), TroDocument = TRO-JSON (Schema
  sps_skel-tro-v2). items/fbType werden immer ueber den Typ aus tro_catalog
  gelesen, nie gespeichert; abweichende Werte in einer JSON sind ein Fehler.
  JSON-Schluessel wie bisher (id, type, fbType ...), extra="forbid".
- tro_flow: Tro/Analysis aus model.py; neuer Schalter --json schreibt
  <name>_tro.json (TroDocument)
- scl_skeleton: liest die JSON ueber TroDocument statt per Dict-Zugriff,
  Bauteile ueber TroItem-Konstanten; ungueltige JSON -> Exit 1 ohne SCL,
  alte tro_extract-JSON (v1) mit Hinweis auf tro_flow --json
- tro_annotate: nur noch Ansicht; derselbe analyse_tros-Aufruf wie tro_flow
  (inkl. sepliste-Gegenprobe), damit Zeichnung und JSON uebereinstimmen
- tro_extract: geparkt (unveraendert)
- tests/test_model.py + conftest.py, pytest in requirements.txt aktiviert
- Doku: Python_Scripts.md (§6b model.py), Commandlines.md, CLAUDE.md,
  Aufrufkommentare in bin/ (scl_skeleton.bat zeigte tro_flow-Aufrufe)

Geprueft: alle tro_flow/tro_annotate-Ausgaben (8 CSVs) bis auf Zeitstempel
identisch zum vorherigen Stand; scl_skeleton alt/neu auf derselben JSON
byte-identisch (export, mubea, HundM05); 10 Tests gruen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Samer Ayadi
2026-10-09 12:42:46 +02:00
co-authored by Claude Opus 5.5
parent 90cafec99c
commit 97a0db6707
14 changed files with 790 additions and 275 deletions
+4 -4
View File
@@ -3,14 +3,14 @@ REM ================================================================
REM SPS_SKEL - FB_Main-Geruest als SCL erzeugen
REM ================================================================
REM Aufruf:
REM bin\tro_flow.bat --file mubea.csv
REM bin\tro_flow.bat --file mubea.csv --tosvg
REM bin\tro_flow.bat --file mubea.csv --tosvg --doc
REM bin\scl_skeleton.bat
REM bin\scl_skeleton.bat --json mubea_tro.json
REM bin\scl_skeleton.bat --json mubea_tro.json --out FB_Main.scl
REM
REM Die JSON-Datei wird in %SKEL_RESULTS% gesucht, die SCL-Datei wird
REM ebenfalls dort abgelegt.
REM
REM Schwesterprogramm: bin\material_flow.bat (Materialfluss der Objekte)
REM Vorstufe: bin\tro_flow.bat --file <name>.csv --json (CSV -> TRO-JSON)
REM ================================================================
setlocal
+1 -1
View File
@@ -10,7 +10,7 @@
# Die JSON-Datei wird in $SKEL_RESULTS gesucht, die SCL-Datei wird
# ebenfalls dort abgelegt.
#
# Vorstufe: bin/tro_extract.sh (Zeichnung -> JSON)
# Vorstufe: bin/tro_flow.sh --file <name>.csv --json (CSV -> TRO-JSON)
# ================================================================
set -eu
+1
View File
@@ -6,6 +6,7 @@ REM Aufruf:
REM bin\tro_flow.bat --file mubea.csv
REM bin\tro_flow.bat --file mubea.csv --tosvg
REM bin\tro_flow.bat --file mubea.csv --tosvg --doc
REM bin\tro_flow.bat --file mubea.csv --json (TRO-JSON fuer scl_skeleton)
REM
REM Die CSV-Datei wird in %SKEL_DATA% gesucht, DOT, SVG, Doku und
REM Fehlerdatei werden in %SKEL_RESULTS% abgelegt.
+1
View File
@@ -6,6 +6,7 @@
# bash bin/tro_flow.sh --file mubea.csv
# bash bin/tro_flow.sh --file mubea.csv --tosvg
# bash bin/tro_flow.sh --file mubea.csv --tosvg --doc
# bash bin/tro_flow.sh --file mubea.csv --json (TRO-JSON fuer scl_skeleton)
#
# Die CSV-Datei wird in $SKEL_DATA gesucht, DOT, SVG, Doku und
# Fehlerdatei werden in $SKEL_RESULTS abgelegt.