AI Skill Report Card

Converting Weaving Drafts to WIF

A-83·Oct 29, 2026·Source: Extension-page
14 / 15
Python
converter = DraftConverter( shafts=4, treadles=4, threading=[1, 2, 3, 4], # 1-indexed shaft per warp end, left to right tieup={1: [1, 2], 2: [2, 3], 3: [3, 4], 4: [4, 1]}, # treadle -> shafts raised treadling=[1, 2, 3, 4] # 1-indexed treadle per weft pick, top to bottom ) print(converter.to_ascii()) # drawdown preview wif_text = converter.export_wif(title="2/2 Straight Twill") open("draft.wif", "w").write(wif_text)
Recommendation▾
Include the actual DraftConverter class implementation or reference to it, since examples assume methods like compute_drawdown() exist but only Quick Start usage is shown
13 / 15

Progress:

  • Step 1: Gather the four draft components — shaft/treadle counts, threading, tie-up, treadling
  • Step 2: Validate indices (all shaft/treadle numbers must be within declared ranges, 1-indexed)
  • Step 3: Instantiate DraftConverter with the four components
  • Step 4: Compute and review the drawdown via to_ascii() to sanity-check the pattern visually
  • Step 5: Export to WIF 1.1 via export_wif() and save with .wif extension
  • Step 6: Spot-check the WIF sections ([TIEUP], [THREADING], [TREADLING]) against the source draft

Drawdown logic: For each pick, look up the shafts raised by that pick's treadle in the tie-up. A warp end shows as raised (1/warp float) if its threaded shaft is in that raised set, otherwise it's a weft float (0).

Rising vs. sinking shed: The converter assumes rising shed (Rising Shed=on). If source draft uses a sinking-shed (jack-less) loom convention, invert the raised-shaft logic before computing the drawdown, or set Rising Shed=off and invert bit values in the WIF output.

Recommendation▾
Add an example of the final WIF file output (actual text format) rather than only showing ASCII drawdowns, since WIF export is a core stated purpose
16 / 20

Example 1: 2/2 Straight Twill Input:

  • threading=[1,2,3,4], tieup={1:[1,2],2:[2,3],3:[3,4],4:[4,1]}, treadling=[1,2,3,4]

Output (drawdown ASCII):

x x . .
. x x .
. . x x
x . . x

Example 2: Plain Weave (2-shaft) Input:

  • shafts=2, treadles=2, threading=[1,2,1,2], tieup={1:[1],2:[2]}, treadling=[1,2,1,2]

Output (drawdown ASCII):

x . x .
. x . x
x . x .
. x . x

Example 3: Malformed tie-up reference Input: tieup={1:[1,2]} but treadling contains treadle 3 (undefined)

Output: compute_drawdown() treats pick as raising no shafts (empty set via .get(tr, [])), producing an all-weft-float row — flag this before export, don't silently export it.

Recommendation▾
Clarify the liftplan-only mode mentioned in Best Practices with a concrete example, since it's flagged as a notable edge case but left unillustrated
  • Always print to_ascii() and compare row/column count against expected shafts/treadles before exporting — catches indexing bugs early.
  • Keep threading/treadling/tie-up all 1-indexed consistently; WIF format expects 1-indexed sections.
  • Preserve liftplan-only drafts (no tie-up) by treating treadling entries as direct shaft-lists rather than treadle numbers — add a liftplan=True mode if the source has no physical treadles.
  • Stamp Date and Source Program fields accurately for archival/provenance tracking when digitizing historical drafts.
  • When round-tripping, re-import the exported WIF and recompute the drawdown to confirm it matches the original — cheap regression check.
  • Off-by-one indexing: mixing 0-indexed Python lists with 1-indexed WIF/weaving convention causes silent shaft misalignment — always index WIF output starting at 1, even though internal arrays are 0-indexed.
  • Undefined treadle/shaft references: don't let .get(tr, []) silently default to empty; validate all treadling values exist in tieup and all threading values are within 1..shafts before conversion.
  • Ignoring shed type: exporting Rising Shed=on for a draft documented under sinking-shed convention inverts the actual pattern — confirm shed convention with the source before export.
  • Skipping visual verification: never export directly to WIF without first checking the ASCII drawdown; subtle tie-up transcription errors are easy to miss in raw dict literals but obvious in the woven grid.
0
Grade A-AI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
14/15
Workflow
13/15
Examples
16/20
Completeness
17/20
Format
15/15
Conciseness
14/15