{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":812086839,"defaultBranch":"main","name":"dtx_to_wif_converter","ownerLogin":"r-owen","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2024-06-07T23:45:13.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/874176?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1727134930.0","currentOid":""},"activityList":{"items":[{"before":"b0342ef78fa259196842691852110eb307443357","after":null,"ref":"refs/tags/v2.0b5","pushedAt":"2024-09-23T23:42:10.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"}},{"before":"690ef9a32fe382d6ecbd581128817c0a75dc2a31","after":"c33f5207a898a894340640ac2c7e9ebc40b6b23f","ref":"refs/heads/main","pushedAt":"2024-09-23T23:32:55.000Z","pushType":"push","commitsCount":5,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Remove prune/pruned support\n\nand add tests with shaft=0, treadle=0,\nand checking specific data read from a few files","shortMessageHtmlLink":"Remove prune/pruned support"}},{"before":"aca35e18598b316ee51f6d8a5e5b7a72cacf6e1f","after":null,"ref":"refs/tags/v2.0b4","pushedAt":"2024-09-23T19:04:40.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"}},{"before":"4b119b52304ac97115647b235d71f11bdd46e741","after":"c33f5207a898a894340640ac2c7e9ebc40b6b23f","ref":"refs/heads/v2.0","pushedAt":"2024-09-23T17:44:03.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Remove prune/pruned support\n\nand add tests with shaft=0, treadle=0,\nand checking specific data read from a few files","shortMessageHtmlLink":"Remove prune/pruned support"}},{"before":"fdcb711162cf0949d068ca3d50a27729c0468bbb","after":"4b119b52304ac97115647b235d71f11bdd46e741","ref":"refs/heads/v2.0","pushedAt":"2024-09-23T17:42:46.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Test reading specific data\n\nalso tweak names in data files to be .dtx","shortMessageHtmlLink":"Test reading specific data"}},{"before":"8fdd0c51a627f9a16a03970f909279ea4494461a","after":"fdcb711162cf0949d068ca3d50a27729c0468bbb","ref":"refs/heads/v2.0","pushedAt":"2024-09-23T17:12:44.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Add tests for shaft 0 and treadle 0","shortMessageHtmlLink":"Add tests for shaft 0 and treadle 0"}},{"before":"a826180d9d6b980cd598ffbe0243274a2046eec0","after":"8fdd0c51a627f9a16a03970f909279ea4494461a","ref":"refs/heads/v2.0","pushedAt":"2024-09-23T15:49:04.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Remove prune/pruned support","shortMessageHtmlLink":"Remove prune/pruned support"}},{"before":"a27db6473efa32b95efaa42ffd727c4aaa8d7010","after":"a826180d9d6b980cd598ffbe0243274a2046eec0","ref":"refs/heads/v2.0","pushedAt":"2024-09-22T22:12:28.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Use sets for threading, tieup, ...\n\nUse sets instead of tuples for threading,\ntieup, treadling, and liftplan values.\nThis makes the data much easier to work with.\n\nAlso add pruned parameter to DrawdownData\nto remove 0-valued shafts and treadles.\nThis may be helpful for loom control.","shortMessageHtmlLink":"Use sets for threading, tieup, ..."}},{"before":"67db43b6c24abc319eb94c3edcaaa710c340ddab","after":"a27db6473efa32b95efaa42ffd727c4aaa8d7010","ref":"refs/heads/v2.0","pushedAt":"2024-09-22T21:49:52.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Test many errors in dtx files\ndiff --git a/src/dtx_to_wif/drawdown_data.py b/src/dtx_to_wif/drawdown_data.py\nindex 242d1a9..e385867 100755\n--- a/src/dtx_to_wif/drawdown_data.py\n+++ b/src/dtx_to_wif/drawdown_data.py\n@@ -50,13 +50,8 @@ class DrawdownData:\n\n Parameters\n ----------\n- pruned: if true, information for non-useful entries in threading,\n- tieup, treadline, and liftplan are removed. Useful means:\n-\n- * useful warp threads are threaded on non-zero shafts\n- * useful shafts have have one or more useful warp threads\n- * useful treadles raise or lower one or more useful shafts\n- * useful picks raise or lower one or more useful shafts\n+ pruned: if true, entries for shaft and treadle=0 are removed from\n+ tieup, treadline, and liftplan.\n name: original file name\n threading: dict of thread index: shafts\n where shaft is a set of shafts.\n@@ -291,6 +286,27 @@ class DrawdownData:\n f\"[{self.color_range[0]}, {self.color_range[1]}]\"\n )\n\n+ # Check that all color values are in range\n+ max_color_in_table = max(self.color_table.keys())\n+ for ww_name in (\"warp\", \"weft\"):\n+ ww_colors = getattr(self, f\"{ww_name}_colors\")\n+ if ww_colors:\n+ if max(ww_colors.values()) > max_color_in_table:\n+ raise RuntimeError(\n+ f\"Invalid {ww_name}_colors={ww_colors}: \"\n+ f\"one or more colors > {max_color_in_table}; \"\n+ )\n+ if min(getattr(self, f\"{ww_name}_colors\").values()) < 1:\n+ raise RuntimeError(\n+ f\"Invalid {ww_name}_colors={ww_colors}: one or more colors < 1\"\n+ )\n+ ww_info = getattr(self, ww_name)\n+ if ww_info.color is not None:\n+ if ww_info.color < 1 or ww_info.color > max_color_in_table:\n+ raise RuntimeError(\n+ f\"Invalid {ww_name}.color {ww_info.color} not in range [0, {max_color_in_table}]\"\n+ )\n+\n def _clean_dict(\n self, data: dict[int, ValueType], default_value: Any\n ) -> dict[int, ValueType]:\ndiff --git a/src/dtx_to_wif/dtx_reader.py b/src/dtx_to_wif/dtx_reader.py\nindex d37a373..6b2de37 100755\n--- a/src/dtx_to_wif/dtx_reader.py\n+++ b/src/dtx_to_wif/dtx_reader.py\n@@ -77,9 +77,9 @@ def read_dtx(f: TextIO, prune: bool = False) -> DrawdownData:\n argdict[section_name] = {}\n\n for ww_name in (\"warp\", \"weft\"):\n- ww_colors = argdict.get(f\"{ww_name}_colors\")\n+ ww_colors: dict[int, int] | None = argdict.get(f\"{ww_name}_colors\") # type: ignore\n if ww_colors:\n- default_color: int | None = ww_colors[1] # type: ignore\n+ default_color: int | None = ww_colors[1]\n elif \"color_table\" in argdict:\n default_color = dict(warp=1, weft=2)[ww_name]\n else:\n@@ -173,7 +173,8 @@ def process_liftplan(liftplan_info) -> dict[int, set[int]]:\n def process_warpweft_colors(section_info) -> dict[int, int]:\n \"\"\"Process a warp or weft colors section\n\n- Input format: color indices as space-separated ints\n+ Input format: 0-based color indices into the color table\n+ as space-separated ints.\n\n Return colors as a dict of thread index: 0-based color index\n \"\"\"\ndiff --git a/src/dtx_to_wif/run_dtx_to_wif.py b/src/dtx_to_wif/run_dtx_to_wif.py\nindex f4ab1a7..f131f5e 100755\n--- a/src/dtx_to_wif/run_dtx_to_wif.py\n+++ b/src/dtx_to_wif/run_dtx_to_wif.py\n@@ -2,6 +2,7 @@ __all__ = [\"run_dtx_to_wif\"]\n\n import argparse\n import pathlib\n+import traceback\n\n from .dtx_reader import read_dtx\n from .wif_writer import write_wif\n@@ -52,7 +53,10 @@ def run_dtx_to_wif() -> None:\n drawdown = read_dtx(f, prune=False)\n with open(outfile, \"w\") as f:\n write_wif(f, drawdown)\n- except Exception as e:\n- print(f\"Failed on {infile}: {e!r}\")\n+ except Exception:\n+ traceback.print_exc()\n+ print(f\"Failed to write {outfile}\")\n+ continue\n+\n if args.verbose:\n print(drawdown)\ndiff --git a/tests/data/bad_dtx/bad_warp_color_too_big.dtx b/tests/data/bad_dtx/bad_warp_color_too_big.dtx\nnew file mode 100644\nindex 0000000..d8a68d4\n--- /dev/null\n+++ b/tests/data/bad_dtx/bad_warp_color_too_big.dtx\n@@ -0,0 +1,51 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color liftplan.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Liftplan\n+Color Palette\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:12\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 4\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Liftplan\n+1101\n+1010\n+1101\n+1011\n+0111\n+1110\n+\n+@@Color Palet\n+255,255,255\n+255,0,0\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n+\n+@@Warp Colors\n+7 0 0 0\n+\n+@@EndDTX\ndiff --git a/tests/data/bad_dtx/bad_warp_color_too_small.dtx b/tests/data/bad_dtx/bad_warp_color_too_small.dtx\nnew file mode 100644\nindex 0000000..04d3f19\n--- /dev/null\n+++ b/tests/data/bad_dtx/bad_warp_color_too_small.dtx\n@@ -0,0 +1,51 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color liftplan.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Liftplan\n+Color Palette\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:12\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 4\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Liftplan\n+1101\n+1010\n+1101\n+1011\n+0111\n+1110\n+\n+@@Color Palet\n+255,255,255\n+255,0,0\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n+\n+@@Warp Colors\n+0 0 0 -1\n+\n+@@EndDTX\ndiff --git a/tests/data/bad_dtx/bad_color_value_too_small.dtx b/tests/data/bad_dtx/bad_weft_color_too_big.dtx\nsimilarity index 76%\nrename from tests/data/bad_dtx/bad_color_value_too_small.dtx\nrename to tests/data/bad_dtx/bad_weft_color_too_big.dtx\nindex 05ebecb..4c680b6 100644\n--- a/tests/data/bad_dtx/bad_color_value_too_small.dtx\n+++ b/tests/data/bad_dtx/bad_weft_color_too_big.dtx\n@@ -38,11 +38,14 @@ Tuesday, June 11, 2024, 19:12\n 1110\n\n @@Color Palet\n+255,255,255\n+255,0,0\n+0,255,0\n+0,0,255\n+170,170,170\n 0,0,0\n-255,255,-1\n-136,0,255\n\n @@Weft Colors\n-1 1 1 1 1 1\n+7 1 1 1 1 1\n\n @@EndDTX\ndiff --git a/tests/data/bad_dtx/bad_color_value_too_big.dtx b/tests/data/bad_dtx/bad_weft_color_too_small.dtx\nsimilarity index 79%\nrename from tests/data/bad_dtx/bad_color_value_too_big.dtx\nrename to tests/data/bad_dtx/bad_weft_color_too_small.dtx\nindex a0400e2..7d69c49 100644\n--- a/tests/data/bad_dtx/bad_color_value_too_big.dtx\n+++ b/tests/data/bad_dtx/bad_weft_color_too_small.dtx\n@@ -38,11 +38,14 @@ Tuesday, June 11, 2024, 19:12\n 1110\n\n @@Color Palet\n-0,0,0\n 255,255,255\n-136,0,256\n+255,0,0\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n\n @@Weft Colors\n-1 1 1 1 1 1\n+1 1 1 1 1 -1\n\n @@EndDTX\ndiff --git a/tests/data/bad_dtx/missing liftplan.dtx b/tests/data/bad_dtx/missing liftplan.dtx\nindex f08d380..ee3de7f 100644\n--- a/tests/data/bad_dtx/missing liftplan.dtx\n+++ b/tests/data/bad_dtx/missing liftplan.dtx\n@@ -29,88 +29,12 @@ Tuesday, June 11, 2024, 19:12\n 2 3 4 1\n\n @@Color Palet\n-0,0,0\n 255,255,255\n-136,0,255\n-85,0,255\n-0,0,255\n-0,85,255\n-0,170,255\n-0,238,255\n-0,255,136\n-0,255,34\n-102,255,0\n-187,255,0\n-255,255,0\n-255,238,0\n-255,187,0\n-255,119,0\n-255,68,0\n 255,0,0\n-255,0,102\n-255,0,187\n-255,0,255\n-204,0,255\n-201,102,255\n-132,102,255\n-102,112,255\n-102,155,255\n-102,194,255\n-102,255,255\n-102,255,178\n-102,255,102\n-141,255,102\n-201,255,102\n-214,255,102\n-255,255,102\n-255,224,102\n-255,173,102\n-255,155,102\n-255,102,102\n-255,102,155\n-255,102,194\n-255,102,245\n-224,102,255\n-71,0,153\n-31,0,255\n-0,10,153\n-0,41,153\n-0,92,153\n-0,153,153\n-0,153,77\n-0,153,0\n-31,153,0\n-71,153,0\n-112,153,0\n-153,153,0\n-153,122,0\n-153,82,0\n-153,41,0\n-153,0,0\n-153,0,41\n-153,0,92\n-153,0,143\n-122,0,153\n-128,68,204\n-94,68,204\n-68,78,204\n-68,102,204\n-68,153,204\n-68,204,204\n-68,204,127\n-68,204,68\n-94,204,68\n-128,204,68\n-170,204,68\n-204,204,68\n-204,68,170\n-204,136,68\n-204,102,68\n-204,68,68\n-204,68,102\n-204,68,153\n-204,68,187\n-170,68,204\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n\n @@Weft Colors\n 1 1 1 1 1 1\ndiff --git a/tests/data/bad_dtx/missing tieup.dtx b/tests/data/bad_dtx/missing tieup.dtx\nindex c7a3dd8..0f68fe0 100644\n--- a/tests/data/bad_dtx/missing tieup.dtx\n+++ b/tests/data/bad_dtx/missing tieup.dtx\n@@ -34,88 +34,12 @@ Tuesday, June 11, 2024, 19:14\n 1, 6 5 1, 2, 4 1, 3, 4 2, 3, 4 1, 2, 3\n\n @@Color Palet\n-0,0,0\n 255,255,255\n-136,0,255\n-85,0,255\n-0,0,255\n-0,85,255\n-0,170,255\n-0,238,255\n-0,255,136\n-0,255,34\n-102,255,0\n-187,255,0\n-255,255,0\n-255,238,0\n-255,187,0\n-255,119,0\n-255,68,0\n 255,0,0\n-255,0,102\n-255,0,187\n-255,0,255\n-204,0,255\n-201,102,255\n-132,102,255\n-102,112,255\n-102,155,255\n-102,194,255\n-102,255,255\n-102,255,178\n-102,255,102\n-141,255,102\n-201,255,102\n-214,255,102\n-255,255,102\n-255,224,102\n-255,173,102\n-255,155,102\n-255,102,102\n-255,102,155\n-255,102,194\n-255,102,245\n-224,102,255\n-71,0,153\n-31,0,255\n-0,10,153\n-0,41,153\n-0,92,153\n-0,153,153\n-0,153,77\n-0,153,0\n-31,153,0\n-71,153,0\n-112,153,0\n-153,153,0\n-153,122,0\n-153,82,0\n-153,41,0\n-153,0,0\n-153,0,41\n-153,0,92\n-153,0,143\n-122,0,153\n-128,68,204\n-94,68,204\n-68,78,204\n-68,102,204\n-68,153,204\n-68,204,204\n-68,204,127\n-68,204,68\n-94,204,68\n-128,204,68\n-170,204,68\n-204,204,68\n-204,68,170\n-204,136,68\n-204,102,68\n-204,68,68\n-204,68,102\n-204,68,153\n-204,68,187\n-170,68,204\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n\n @@Weft Colors\n 1 1 1 1 1 1\ndiff --git a/tests/data/bad_dtx/missing treadling.dtx b/tests/data/bad_dtx/missing treadling.dtx\nindex b162501..47c150c 100644\n--- a/tests/data/bad_dtx/missing treadling.dtx\n+++ b/tests/data/bad_dtx/missing treadling.dtx\n@@ -36,88 +36,12 @@ Tuesday, June 11, 2024, 19:14\n 100010\n\n @@Color Palet\n-0,0,0\n 255,255,255\n-136,0,255\n-85,0,255\n-0,0,255\n-0,85,255\n-0,170,255\n-0,238,255\n-0,255,136\n-0,255,34\n-102,255,0\n-187,255,0\n-255,255,0\n-255,238,0\n-255,187,0\n-255,119,0\n-255,68,0\n 255,0,0\n-255,0,102\n-255,0,187\n-255,0,255\n-204,0,255\n-201,102,255\n-132,102,255\n-102,112,255\n-102,155,255\n-102,194,255\n-102,255,255\n-102,255,178\n-102,255,102\n-141,255,102\n-201,255,102\n-214,255,102\n-255,255,102\n-255,224,102\n-255,173,102\n-255,155,102\n-255,102,102\n-255,102,155\n-255,102,194\n-255,102,245\n-224,102,255\n-71,0,153\n-31,0,255\n-0,10,153\n-0,41,153\n-0,92,153\n-0,153,153\n-0,153,77\n-0,153,0\n-31,153,0\n-71,153,0\n-112,153,0\n-153,153,0\n-153,122,0\n-153,82,0\n-153,41,0\n-153,0,0\n-153,0,41\n-153,0,92\n-153,0,143\n-122,0,153\n-128,68,204\n-94,68,204\n-68,78,204\n-68,102,204\n-68,153,204\n-68,204,204\n-68,204,127\n-68,204,68\n-94,204,68\n-128,204,68\n-170,204,68\n-204,204,68\n-204,68,170\n-204,136,68\n-204,102,68\n-204,68,68\n-204,68,102\n-204,68,153\n-204,68,187\n-170,68,204\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n\n @@Weft Colors\n 1 1 1 1 1 1\ndiff --git a/tests/data/bad_dtx/missing_color_table_warp.dtx b/tests/data/bad_dtx/missing_color_table_warp.dtx\nnew file mode 100644\nindex 0000000..17fd6fd\n--- /dev/null\n+++ b/tests/data/bad_dtx/missing_color_table_warp.dtx\n@@ -0,0 +1,42 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color liftplan.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Liftplan\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:12\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 4\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Liftplan\n+1101\n+1010\n+1101\n+1011\n+0111\n+1110\n+\n+@@Warp Colors\n+0 0 0 0\n+\n+@@EndDTX\ndiff --git a/tests/data/bad_dtx/missing_color_table.dtx b/tests/data/bad_dtx/missing_color_table_weft.dtx\nsimilarity index 100%\nrename from tests/data/bad_dtx/missing_color_table.dtx\nrename to tests/data/bad_dtx/missing_color_table_weft.dtx\ndiff --git a/tests/data/bad_dtx/too_many_treadles_in_treadling.dtx b/tests/data/bad_dtx/too_many_treadles_in_treadling.dtx\nindex 98ad7cc..2cfbeb9 100644\n--- a/tests/data/bad_dtx/too_many_treadles_in_treadling.dtx\n+++ b/tests/data/bad_dtx/too_many_treadles_in_treadling.dtx\n@@ -41,87 +41,11 @@ Tuesday, June 11, 2024, 19:15\n\n @@Color Palet\n 255,255,255\n-0,0,0\n-136,0,255\n-85,0,255\n-0,0,255\n-0,85,255\n-0,170,255\n-0,238,255\n-0,255,136\n-0,255,34\n-102,255,0\n-187,255,0\n-255,255,0\n-255,238,0\n-255,187,0\n-255,119,0\n-255,68,0\n 255,0,0\n-255,0,102\n-255,0,187\n-255,0,255\n-204,0,255\n-201,102,255\n-132,102,255\n-102,112,255\n-102,155,255\n-102,194,255\n-102,255,255\n-102,255,178\n-102,255,102\n-141,255,102\n-201,255,102\n-214,255,102\n-255,255,102\n-255,224,102\n-255,173,102\n-255,155,102\n-255,102,102\n-255,102,155\n-255,102,194\n-255,102,245\n-224,102,255\n-71,0,153\n-31,0,255\n-0,10,153\n-0,41,153\n-0,92,153\n-0,153,153\n-0,153,77\n-0,153,0\n-31,153,0\n-71,153,0\n-112,153,0\n-153,153,0\n-153,122,0\n-153,82,0\n-153,41,0\n-153,0,0\n-153,0,41\n-153,0,92\n-153,0,143\n-122,0,153\n-128,68,204\n-94,68,204\n-68,78,204\n-68,102,204\n-68,153,204\n-68,204,204\n-68,204,127\n-68,204,68\n-94,204,68\n-128,204,68\n-170,204,68\n-204,204,68\n-204,68,170\n-204,136,68\n-204,102,68\n-204,68,68\n-204,68,102\n-204,68,153\n-204,68,187\n-170,68,204\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n\n @@Weft Colors\n 1 1 1 1 1 1\ndiff --git a/tests/data/basic_dtx/level2/two color liftplan.dtx b/tests/data/basic_dtx/level2/two color liftplan.dtx\nindex 4f7899c..65313c1 100644\n--- a/tests/data/basic_dtx/level2/two color liftplan.dtx\n+++ b/tests/data/basic_dtx/level2/two color liftplan.dtx\n@@ -38,88 +38,12 @@ Tuesday, June 11, 2024, 19:12\n 1110\n\n @@Color Palet\n-0,0,0\n 255,255,255\n-136,0,255\n-85,0,255\n-0,0,255\n-0,85,255\n-0,170,255\n-0,238,255\n-0,255,136\n-0,255,34\n-102,255,0\n-187,255,0\n-255,255,0\n-255,238,0\n-255,187,0\n-255,119,0\n-255,68,0\n 255,0,0\n-255,0,102\n-255,0,187\n-255,0,255\n-204,0,255\n-201,102,255\n-132,102,255\n-102,112,255\n-102,155,255\n-102,194,255\n-102,255,255\n-102,255,178\n-102,255,102\n-141,255,102\n-201,255,102\n-214,255,102\n-255,255,102\n-255,224,102\n-255,173,102\n-255,155,102\n-255,102,102\n-255,102,155\n-255,102,194\n-255,102,245\n-224,102,255\n-71,0,153\n-31,0,255\n-0,10,153\n-0,41,153\n-0,92,153\n-0,153,153\n-0,153,77\n-0,153,0\n-31,153,0\n-71,153,0\n-112,153,0\n-153,153,0\n-153,122,0\n-153,82,0\n-153,41,0\n-153,0,0\n-153,0,41\n-153,0,92\n-153,0,143\n-122,0,153\n-128,68,204\n-94,68,204\n-68,78,204\n-68,102,204\n-68,153,204\n-68,204,204\n-68,204,127\n-68,204,68\n-94,204,68\n-128,204,68\n-170,204,68\n-204,204,68\n-204,68,170\n-204,136,68\n-204,102,68\n-204,68,68\n-204,68,102\n-204,68,153\n-204,68,187\n-170,68,204\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n\n @@Weft Colors\n 1 1 1 1 1 1\ndiff --git a/tests/data/basic_dtx/level2/two color multiple treadles.dtx b/tests/data/basic_dtx/level2/two color multiple treadles.dtx\nindex 2f445ca..e56b6bd 100644\n--- a/tests/data/basic_dtx/level2/two color multiple treadles.dtx\n+++ b/tests/data/basic_dtx/level2/two color multiple treadles.dtx\n@@ -41,88 +41,12 @@ Tuesday, June 11, 2024, 19:14\n 1, 6 5 1, 2, 4 1, 3, 4 2, 3, 4 1, 2, 3\n\n @@Color Palet\n-0,0,0\n 255,255,255\n-136,0,255\n-85,0,255\n-0,0,255\n-0,85,255\n-0,170,255\n-0,238,255\n-0,255,136\n-0,255,34\n-102,255,0\n-187,255,0\n-255,255,0\n-255,238,0\n-255,187,0\n-255,119,0\n-255,68,0\n 255,0,0\n-255,0,102\n-255,0,187\n-255,0,255\n-204,0,255\n-201,102,255\n-132,102,255\n-102,112,255\n-102,155,255\n-102,194,255\n-102,255,255\n-102,255,178\n-102,255,102\n-141,255,102\n-201,255,102\n-214,255,102\n-255,255,102\n-255,224,102\n-255,173,102\n-255,155,102\n-255,102,102\n-255,102,155\n-255,102,194\n-255,102,245\n-224,102,255\n-71,0,153\n-31,0,255\n-0,10,153\n-0,41,153\n-0,92,153\n-0,153,153\n-0,153,77\n-0,153,0\n-31,153,0\n-71,153,0\n-112,153,0\n-153,153,0\n-153,122,0\n-153,82,0\n-153,41,0\n-153,0,0\n-153,0,41\n-153,0,92\n-153,0,143\n-122,0,153\n-128,68,204\n-94,68,204\n-68,78,204\n-68,102,204\n-68,153,204\n-68,204,204\n-68,204,127\n-68,204,68\n-94,204,68\n-128,204,68\n-170,204,68\n-204,204,68\n-204,68,170\n-204,136,68\n-204,102,68\n-204,68,68\n-204,68,102\n-204,68,153\n-204,68,187\n-170,68,204\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n\n @@Weft Colors\n 1 1 1 1 1 1\ndiff --git a/tests/data/basic_dtx/level2/two color single treadles.dtx b/tests/data/basic_dtx/level2/two color single treadles.dtx\nindex b27dc44..665000f 100644\n--- a/tests/data/basic_dtx/level2/two color single treadles.dtx\n+++ b/tests/data/basic_dtx/level2/two color single treadles.dtx\n@@ -41,87 +41,11 @@ Tuesday, June 11, 2024, 19:15\n\n @@Color Palet\n 255,255,255\n-0,0,0\n-136,0,255\n-85,0,255\n-0,0,255\n-0,85,255\n-0,170,255\n-0,238,255\n-0,255,136\n-0,255,34\n-102,255,0\n-187,255,0\n-255,255,0\n-255,238,0\n-255,187,0\n-255,119,0\n-255,68,0\n 255,0,0\n-255,0,102\n-255,0,187\n-255,0,255\n-204,0,255\n-201,102,255\n-132,102,255\n-102,112,255\n-102,155,255\n-102,194,255\n-102,255,255\n-102,255,178\n-102,255,102\n-141,255,102\n-201,255,102\n-214,255,102\n-255,255,102\n-255,224,102\n-255,173,102\n-255,155,102\n-255,102,102\n-255,102,155\n-255,102,194\n-255,102,245\n-224,102,255\n-71,0,153\n-31,0,255\n-0,10,153\n-0,41,153\n-0,92,153\n-0,153,153\n-0,153,77\n-0,153,0\n-31,153,0\n-71,153,0\n-112,153,0\n-153,153,0\n-153,122,0\n-153,82,0\n-153,41,0\n-153,0,0\n-153,0,41\n-153,0,92\n-153,0,143\n-122,0,153\n-128,68,204\n-94,68,204\n-68,78,204\n-68,102,204\n-68,153,204\n-68,204,204\n-68,204,127\n-68,204,68\n-94,204,68\n-128,204,68\n-170,204,68\n-204,204,68\n-204,68,170\n-204,136,68\n-204,102,68\n-204,68,68\n-204,68,102\n-204,68,153\n-204,68,187\n-170,68,204\n+0,255,0\n+0,0,255\n+170,170,170\n+0,0,0\n\n @@Weft Colors\n 1 1 1 1 1 1\ndiff --git a/tests/data/basic_dtx/many color single treadles.dtx b/tests/data/basic_dtx/many color single treadles.dtx\nindex 0adefe9..c6ef8d9 100644\n--- a/tests/data/basic_dtx/many color single treadles.dtx\n+++ b/tests/data/basic_dtx/many color single treadles.dtx\n@@ -44,87 +44,15 @@ Tuesday, June 11, 2024, 19:10\n\n @@Color Palet\n 255,255,255\n-192,192,192\n-170,170,170\n-0,0,0\n 255,0,0\n-255,127,0\n-255,255,0\n-51,165,51\n+0,255,0\n 0,0,255\n-178,76,255\n-102,255,0\n-187,255,0\n-255,255,0\n-255,238,0\n-255,187,0\n-255,119,0\n-255,68,0\n-255,0,0\n-255,0,102\n-255,0,187\n-255,0,255\n-204,0,255\n-201,102,255\n-132,102,255\n-102,112,255\n-102,155,255\n-102,194,255\n-102,255,255\n-102,255,178\n-102,255,102\n-141,255,102\n-201,255,102\n-214,255,102\n-255,255,102\n-255,224,102\n-255,173,102\n-255,155,102\n-255,102,102\n-255,102,155\n-255,102,194\n-255,102,245\n-224,102,255\n-71,0,153\n-31,0,255\n-0,10,153\n-0,41,153\n-0,92,153\n-0,153,153\n-0,153,77\n-0,153,0\n-31,153,0\n-71,153,0\n-112,153,0\n-153,153,0\n-153,122,0\n-153,82,0\n-153,41,0\n-153,0,0\n-153,0,41\n-153,0,92\n-153,0,143\n-122,0,153\n-128,68,204\n-94,68,204\n-68,78,204\n-68,102,204\n-68,153,204\n-68,204,204\n-68,204,127\n-68,204,68\n-94,204,68\n-128,204,68\n-170,204,68\n-204,204,68\n-204,68,170\n-204,136,68\n-204,102,68\n-204,68,68\n-204,68,102\n-204,68,153\n-204,68,187\n-170,68,204\n+170,170,170\n+0,0,0\n+5,10,15\n+20,25,30\n+35,40,45\n+50,55,60\n\n @@Warp Colors\n 0 1 2 3\ndiff --git a/tests/data/desired_basic_wif/many color single treadles.wif b/tests/data/desired_basic_wif/many color single treadles.wif\nindex 9936406..d19aef3 100644\n--- a/tests/data/desired_basic_wif/many color single treadles.wif\n+++ b/tests/data/desired_basic_wif/many color single treadles.wif\n@@ -91,88 +91,16 @@ Units=centimeters\n\n [COLOR TABLE]\n 1=255,255,255\n-2=192,192,192\n-3=170,170,170\n-4=0,0,0\n-5=255,0,0\n-6=255,127,0\n-7=255,255,0\n-8=51,165,51\n-9=0,0,255\n-10=178,76,255\n-11=102,255,0\n-12=187,255,0\n-13=255,255,0\n-14=255,238,0\n-15=255,187,0\n-16=255,119,0\n-17=255,68,0\n-18=255,0,0\n-19=255,0,102\n-20=255,0,187\n-21=255,0,255\n-22=204,0,255\n-23=201,102,255\n-24=132,102,255\n-25=102,112,255\n-26=102,155,255\n-27=102,194,255\n-28=102,255,255\n-29=102,255,178\n-30=102,255,102\n-31=141,255,102\n-32=201,255,102\n-33=214,255,102\n-34=255,255,102\n-35=255,224,102\n-36=255,173,102\n-37=255,155,102\n-38=255,102,102\n-39=255,102,155\n-40=255,102,194\n-41=255,102,245\n-42=224,102,255\n-43=71,0,153\n-44=31,0,255\n-45=0,10,153\n-46=0,41,153\n-47=0,92,153\n-48=0,153,153\n-49=0,153,77\n-50=0,153,0\n-51=31,153,0\n-52=71,153,0\n-53=112,153,0\n-54=153,153,0\n-55=153,122,0\n-56=153,82,0\n-57=153,41,0\n-58=153,0,0\n-59=153,0,41\n-60=153,0,92\n-61=153,0,143\n-62=122,0,153\n-63=128,68,204\n-64=94,68,204\n-65=68,78,204\n-66=68,102,204\n-67=68,153,204\n-68=68,204,204\n-69=68,204,127\n-70=68,204,68\n-71=94,204,68\n-72=128,204,68\n-73=170,204,68\n-74=204,204,68\n-75=204,68,170\n-76=204,136,68\n-77=204,102,68\n-78=204,68,68\n-79=204,68,102\n-80=204,68,153\n-81=204,68,187\n-82=170,68,204\n+2=255,0,0\n+3=0,255,0\n+4=0,0,255\n+5=170,170,170\n+6=0,0,0\n+7=5,10,15\n+8=20,25,30\n+9=35,40,45\n+10=50,55,60\n\n [COLOR PALETTE]\n Range=0,255\n-Entries=82\n+Entries=10\ndiff --git a/tests/data/desired_basic_wif/two color liftplan.wif b/tests/data/desired_basic_wif/two color liftplan.wif\nindex d4e1281..376e39d 100644\n--- a/tests/data/desired_basic_wif/two color liftplan.wif\n+++ b/tests/data/desired_basic_wif/two color liftplan.wif\n@@ -58,89 +58,13 @@ Spacing=0.212\n Units=centimeters\n\n [COLOR TABLE]\n-1=0,0,0\n-2=255,255,255\n-3=136,0,255\n-4=85,0,255\n-5=0,0,255\n-6=0,85,255\n-7=0,170,255\n-8=0,238,255\n-9=0,255,136\n-10=0,255,34\n-11=102,255,0\n-12=187,255,0\n-13=255,255,0\n-14=255,238,0\n-15=255,187,0\n-16=255,119,0\n-17=255,68,0\n-18=255,0,0\n-19=255,0,102\n-20=255,0,187\n-21=255,0,255\n-22=204,0,255\n-23=201,102,255\n-24=132,102,255\n-25=102,112,255\n-26=102,155,255\n-27=102,194,255\n-28=102,255,255\n-29=102,255,178\n-30=102,255,102\n-31=141,255,102\n-32=201,255,102\n-33=214,255,102\n-34=255,255,102\n-35=255,224,102\n-36=255,173,102\n-37=255,155,102\n-38=255,102,102\n-39=255,102,155\n-40=255,102,194\n-41=255,102,245\n-42=224,102,255\n-43=71,0,153\n-44=31,0,255\n-45=0,10,153\n-46=0,41,153\n-47=0,92,153\n-48=0,153,153\n-49=0,153,77\n-50=0,153,0\n-51=31,153,0\n-52=71,153,0\n-53=112,153,0\n-54=153,153,0\n-55=153,122,0\n-56=153,82,0\n-57=153,41,0\n-58=153,0,0\n-59=153,0,41\n-60=153,0,92\n-61=153,0,143\n-62=122,0,153\n-63=128,68,204\n-64=94,68,204\n-65=68,78,204\n-66=68,102,204\n-67=68,153,204\n-68=68,204,204\n-69=68,204,127\n-70=68,204,68\n-71=94,204,68\n-72=128,204,68\n-73=170,204,68\n-74=204,204,68\n-75=204,68,170\n-76=204,136,68\n-77=204,102,68\n-78=204,68,68\n-79=204,68,102\n-80=204,68,153\n-81=204,68,187\n-82=170,68,204\n+1=255,255,255\n+2=255,0,0\n+3=0,255,0\n+4=0,0,255\n+5=170,170,170\n+6=0,0,0\n\n [COLOR PALETTE]\n Range=0,255\n-Entries=82\n+Entries=6\ndiff --git a/tests/data/desired_basic_wif/two color multiple treadles.wif b/tests/data/desired_basic_wif/two color multiple treadles.wif\nindex f2b9da4..a93d568 100644\n--- a/tests/data/desired_basic_wif/two color multiple treadles.wif\n+++ b/tests/data/desired_basic_wif/two color multiple treadles.wif\n@@ -66,89 +66,13 @@ Spacing=0.212\n Units=centimeters\n\n [COLOR TABLE]\n-1=0,0,0\n-2=255,255,255\n-3=136,0,255\n-4=85,0,255\n-5=0,0,255\n-6=0,85,255\n-7=0,170,255\n-8=0,238,255\n-9=0,255,136\n-10=0,255,34\n-11=102,255,0\n-12=187,255,0\n-13=255,255,0\n-14=255,238,0\n-15=255,187,0\n-16=255,119,0\n-17=255,68,0\n-18=255,0,0\n-19=255,0,102\n-20=255,0,187\n-21=255,0,255\n-22=204,0,255\n-23=201,102,255\n-24=132,102,255\n-25=102,112,255\n-26=102,155,255\n-27=102,194,255\n-28=102,255,255\n-29=102,255,178\n-30=102,255,102\n-31=141,255,102\n-32=201,255,102\n-33=214,255,102\n-34=255,255,102\n-35=255,224,102\n-36=255,173,102\n-37=255,155,102\n-38=255,102,102\n-39=255,102,155\n-40=255,102,194\n-41=255,102,245\n-42=224,102,255\n-43=71,0,153\n-44=31,0,255\n-45=0,10,153\n-46=0,41,153\n-47=0,92,153\n-48=0,153,153\n-49=0,153,77\n-50=0,153,0\n-51=31,153,0\n-52=71,153,0\n-53=112,153,0\n-54=153,153,0\n-55=153,122,0\n-56=153,82,0\n-57=153,41,0\n-58=153,0,0\n-59=153,0,41\n-60=153,0,92\n-61=153,0,143\n-62=122,0,153\n-63=128,68,204\n-64=94,68,204\n-65=68,78,204\n-66=68,102,204\n-67=68,153,204\n-68=68,204,204\n-69=68,204,127\n-70=68,204,68\n-71=94,204,68\n-72=128,204,68\n-73=170,204,68\n-74=204,204,68\n-75=204,68,170\n-76=204,136,68\n-77=204,102,68\n-78=204,68,68\n-79=204,68,102\n-80=204,68,153\n-81=204,68,187\n-82=170,68,204\n+1=255,255,255\n+2=255,0,0\n+3=0,255,0\n+4=0,0,255\n+5=170,170,170\n+6=0,0,0\n\n [COLOR PALETTE]\n Range=0,255\n-Entries=82\n+Entries=6\ndiff --git a/tests/data/desired_basic_wif/two color single treadles.wif b/tests/data/desired_basic_wif/two color single treadles.wif\nindex eafb130..e902957 100644\n--- a/tests/data/desired_basic_wif/two color single treadles.wif\n+++ b/tests/data/desired_basic_wif/two color single treadles.wif\n@@ -67,88 +67,12 @@ Units=centimeters\n\n [COLOR TABLE]\n 1=255,255,255\n-2=0,0,0\n-3=136,0,255\n-4=85,0,255\n-5=0,0,255\n-6=0,85,255\n-7=0,170,255\n-8=0,238,255\n-9=0,255,136\n-10=0,255,34\n-11=102,255,0\n-12=187,255,0\n-13=255,255,0\n-14=255,238,0\n-15=255,187,0\n-16=255,119,0\n-17=255,68,0\n-18=255,0,0\n-19=255,0,102\n-20=255,0,187\n-21=255,0,255\n-22=204,0,255\n-23=201,102,255\n-24=132,102,255\n-25=102,112,255\n-26=102,155,255\n-27=102,194,255\n-28=102,255,255\n-29=102,255,178\n-30=102,255,102\n-31=141,255,102\n-32=201,255,102\n-33=214,255,102\n-34=255,255,102\n-35=255,224,102\n-36=255,173,102\n-37=255,155,102\n-38=255,102,102\n-39=255,102,155\n-40=255,102,194\n-41=255,102,245\n-42=224,102,255\n-43=71,0,153\n-44=31,0,255\n-45=0,10,153\n-46=0,41,153\n-47=0,92,153\n-48=0,153,153\n-49=0,153,77\n-50=0,153,0\n-51=31,153,0\n-52=71,153,0\n-53=112,153,0\n-54=153,153,0\n-55=153,122,0\n-56=153,82,0\n-57=153,41,0\n-58=153,0,0\n-59=153,0,41\n-60=153,0,92\n-61=153,0,143\n-62=122,0,153\n-63=128,68,204\n-64=94,68,204\n-65=68,78,204\n-66=68,102,204\n-67=68,153,204\n-68=68,204,204\n-69=68,204,127\n-70=68,204,68\n-71=94,204,68\n-72=128,204,68\n-73=170,204,68\n-74=204,204,68\n-75=204,68,170\n-76=204,136,68\n-77=204,102,68\n-78=204,68,68\n-79=204,68,102\n-80=204,68,153\n-81=204,68,187\n-82=170,68,204\n+2=255,0,0\n+3=0,255,0\n+4=0,0,255\n+5=170,170,170\n+6=0,0,0\n\n [COLOR PALETTE]\n Range=0,255\n-Entries=82\n+Entries=6\ndiff --git a/tests/test_dtx_reader.py b/tests/test_dtx_reader.py\nindex a8fecbe..fb4bb84 100644\n--- a/tests/test_dtx_reader.py\n+++ b/tests/test_dtx_reader.py\n@@ -11,10 +11,10 @@ datadir = rootdir / \"tests\" / \"data\" / \"bad_dtx\"\n\n class TestDtxReader(unittest.TestCase):\n def test_read_bad_files(self):\n+ # Note: a few errors are not possible in dtx files,\n+ # since the data is in lists, not dicts. Test what we can.\n for prune in (False, True):\n for dtx_file_path in datadir.rglob(\"*.dtx\"):\n- if dtx_file_path.name.startswith(\"two color\"):\n- continue\n with self.subTest(file=dtx_file_path.name, prune=prune):\n with open(dtx_file_path, \"r\") as f:\n with pytest.raises(RuntimeError):","shortMessageHtmlLink":"Test many errors in dtx files"}},{"before":"b270764640d934ce45043d3219532b0b61b2f7e0","after":"67db43b6c24abc319eb94c3edcaaa710c340ddab","ref":"refs/heads/v2.0","pushedAt":"2024-09-22T14:47:52.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Add test_dtx_reader\n\nTest invalid dtx files.\nFix bugs this exposed.\nSimplify the behavior of prune to keep plausible\ninformation (focus on deleting 0 values\nand resulting empty items)\ndiff --git a/src/dtx_to_wif/drawdown_data.py b/src/dtx_to_wif/drawdown_data.py\nindex a8b0a8a..242d1a9 100755\n--- a/src/dtx_to_wif/drawdown_data.py\n+++ b/src/dtx_to_wif/drawdown_data.py\n@@ -129,7 +129,8 @@ class DrawdownData:\n RuntimeError\n If any color values are out of range.\n RuntimeError\n- If the color keys are not a proper sequence 1, 2, ... N.\n+ If the color keys are not a complete set 1, 2, ... N\n+ (though they don't have to sorted on input).\n RuntimeError\n If ``warp_colors`` or ``weft_colors`` is specified,\n but not ``color_table``.\n@@ -137,9 +138,7 @@ class DrawdownData:\n If ``color_table`` is specified, but not ``color_range``.\n RuntimeError\n If ``color_range`` invalid: length != 2 or\n- min (element 0) >= max (element 1)\n- RuntimeError\n- If there are more treadles in the treadling than in the tieup.\n+ color_range[0] (min) >= color_range[1] (max)\n \"\"\"\n\n pruned: bool\n@@ -165,6 +164,14 @@ class DrawdownData:\n num_treadles: int = 0\n\n def __post_init__(self) -> None:\n+ # Test for missing color table before cleaning warp and weft colors\n+ # since they may well be empty afterwards\n+ if self.warp_colors or self.weft_colors:\n+ if not self.color_table:\n+ raise RuntimeError(\n+ \"warp and/or weft colors specified, but not color table\"\n+ )\n+\n # Clean up warp/weft colors, spacing, and threading dicts\n # Put the keys in thread order and elide default values (if known).\n for ww in (\"warp\", \"weft\"):\n@@ -184,18 +191,13 @@ class DrawdownData:\n )\n\n # Clean up the threading, tieup, treadling, and liftplan dicts\n- # by putting keys in order and eliding empty values\n+ # by putting keys in order and eliding {0} from values\n+ # and resulting items that are empty\n if self.pruned:\n- used_shafts: set[int] = set.union(*self.threading.values()) # type: ignore\n- self.threading = self._prune_ints_set_dict(self.threading, keep=used_shafts)\n- self.tieup = self._prune_ints_set_dict(self.tieup, keep=used_shafts)\n- used_treadles: set[int] = set.union(*self.threading.values()) # type: ignore\n- for unused_treadle in self.tieup.keys() - used_treadles:\n- del self.tieup[unused_treadle]\n- self.treadling = self._prune_ints_set_dict(\n- self.treadling, keep=used_treadles\n- )\n- self.liftplan = self._prune_ints_set_dict(self.liftplan, keep=used_shafts)\n+ self.threading = self._prune_ints_set_dict(self.threading)\n+ self.tieup = self._prune_ints_set_dict(self.tieup)\n+ self.treadling = self._prune_ints_set_dict(self.treadling)\n+ self.liftplan = self._prune_ints_set_dict(self.liftplan)\n\n else:\n self.threading = self._clean_ints_set_dict(self.threading)\n@@ -256,13 +258,7 @@ class DrawdownData:\n \"Must specify non-empty liftplan, or both tieup and treadling\"\n )\n\n- if self.warp_colors or self.weft_colors:\n- if self.color_table is None:\n- raise RuntimeError(\n- \"warp and/or weft colors specified, but not color table\"\n- )\n-\n- if self.color_table is not None and self.color_range is None:\n+ if self.color_table and self.color_range is None:\n raise RuntimeError(\"color table specified, but not color range\")\n\n if self.color_range is not None:\n@@ -306,11 +302,9 @@ class DrawdownData:\n return {key: data[key] for key in sorted(data) if data[key] != default_value}\n\n def _clean_ints_set_dict(self, data: dict[int, set[int]]) -> dict[int, set[int]]:\n- \"\"\"Sort by keys and remove unwanted values.\"\"\"\n+ \"\"\"Sort by keys and remove items whose value is empty or just {0}.\"\"\"\n return {key: data[key] for key in sorted(data) if bool(data[key] - {0})}\n\n- def _prune_ints_set_dict(\n- self, data: dict[int, set[int]], keep: set[int]\n- ) -> dict[int, set[int]]:\n- \"\"\"Sort by keys and remove unwanted values.\"\"\"\n- return {key: data[key] & keep for key in sorted(data) if bool(data[key] & keep)}\n+ def _prune_ints_set_dict(self, data: dict[int, set[int]]) -> dict[int, set[int]]:\n+ \"\"\"Sort by keys, remove 0 from values, remove empty items.\"\"\"\n+ return {key: data[key] - {0} for key in sorted(data) if bool(data[key] - {0})}\ndiff --git a/src/dtx_to_wif/dtx_reader.py b/src/dtx_to_wif/dtx_reader.py\nindex d5c01c8..d37a373 100755\n--- a/src/dtx_to_wif/dtx_reader.py\n+++ b/src/dtx_to_wif/dtx_reader.py\n@@ -74,7 +74,7 @@ def read_dtx(f: TextIO, prune: bool = False) -> DrawdownData:\n if section_info is not None:\n argdict[section_name] = processor(section_info)\n else:\n- argdict[section_name] = []\n+ argdict[section_name] = {}\n\n for ww_name in (\"warp\", \"weft\"):\n ww_colors = argdict.get(f\"{ww_name}_colors\")\ndiff --git a/tests/data/bad_dtx/bad_color_value_too_big.dtx b/tests/data/bad_dtx/bad_color_value_too_big.dtx\nnew file mode 100644\nindex 0000000..a0400e2\n--- /dev/null\n+++ b/tests/data/bad_dtx/bad_color_value_too_big.dtx\n@@ -0,0 +1,48 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color liftplan.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Liftplan\n+Color Palette\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:12\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 4\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Liftplan\n+1101\n+1010\n+1101\n+1011\n+0111\n+1110\n+\n+@@Color Palet\n+0,0,0\n+255,255,255\n+136,0,256\n+\n+@@Weft Colors\n+1 1 1 1 1 1\n+\n+@@EndDTX\ndiff --git a/tests/data/bad_dtx/bad_color_value_too_small.dtx b/tests/data/bad_dtx/bad_color_value_too_small.dtx\nnew file mode 100644\nindex 0000000..05ebecb\n--- /dev/null\n+++ b/tests/data/bad_dtx/bad_color_value_too_small.dtx\n@@ -0,0 +1,48 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color liftplan.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Liftplan\n+Color Palette\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:12\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 4\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Liftplan\n+1101\n+1010\n+1101\n+1011\n+0111\n+1110\n+\n+@@Color Palet\n+0,0,0\n+255,255,-1\n+136,0,255\n+\n+@@Weft Colors\n+1 1 1 1 1 1\n+\n+@@EndDTX\ndiff --git a/tests/data/bad_dtx/missing liftplan.dtx b/tests/data/bad_dtx/missing liftplan.dtx\nnew file mode 100644\nindex 0000000..f08d380\n--- /dev/null\n+++ b/tests/data/bad_dtx/missing liftplan.dtx\n@@ -0,0 +1,118 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color liftplan.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Color Palette\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:12\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 4\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Color Palet\n+0,0,0\n+255,255,255\n+136,0,255\n+85,0,255\n+0,0,255\n+0,85,255\n+0,170,255\n+0,238,255\n+0,255,136\n+0,255,34\n+102,255,0\n+187,255,0\n+255,255,0\n+255,238,0\n+255,187,0\n+255,119,0\n+255,68,0\n+255,0,0\n+255,0,102\n+255,0,187\n+255,0,255\n+204,0,255\n+201,102,255\n+132,102,255\n+102,112,255\n+102,155,255\n+102,194,255\n+102,255,255\n+102,255,178\n+102,255,102\n+141,255,102\n+201,255,102\n+214,255,102\n+255,255,102\n+255,224,102\n+255,173,102\n+255,155,102\n+255,102,102\n+255,102,155\n+255,102,194\n+255,102,245\n+224,102,255\n+71,0,153\n+31,0,255\n+0,10,153\n+0,41,153\n+0,92,153\n+0,153,153\n+0,153,77\n+0,153,0\n+31,153,0\n+71,153,0\n+112,153,0\n+153,153,0\n+153,122,0\n+153,82,0\n+153,41,0\n+153,0,0\n+153,0,41\n+153,0,92\n+153,0,143\n+122,0,153\n+128,68,204\n+94,68,204\n+68,78,204\n+68,102,204\n+68,153,204\n+68,204,204\n+68,204,127\n+68,204,68\n+94,204,68\n+128,204,68\n+170,204,68\n+204,204,68\n+204,68,170\n+204,136,68\n+204,102,68\n+204,68,68\n+204,68,102\n+204,68,153\n+204,68,187\n+170,68,204\n+\n+@@Weft Colors\n+1 1 1 1 1 1\n+\n+@@EndDTX\ndiff --git a/tests/data/bad_dtx/missing tieup.dtx b/tests/data/bad_dtx/missing tieup.dtx\nnew file mode 100644\nindex 0000000..c7a3dd8\n--- /dev/null\n+++ b/tests/data/bad_dtx/missing tieup.dtx\n@@ -0,0 +1,123 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color multiple treadles.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Treadling\n+Color Palette\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:14\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 6\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Treadling\n+%%compound\n+ 1, 6 5 1, 2, 4 1, 3, 4 2, 3, 4 1, 2, 3\n+\n+@@Color Palet\n+0,0,0\n+255,255,255\n+136,0,255\n+85,0,255\n+0,0,255\n+0,85,255\n+0,170,255\n+0,238,255\n+0,255,136\n+0,255,34\n+102,255,0\n+187,255,0\n+255,255,0\n+255,238,0\n+255,187,0\n+255,119,0\n+255,68,0\n+255,0,0\n+255,0,102\n+255,0,187\n+255,0,255\n+204,0,255\n+201,102,255\n+132,102,255\n+102,112,255\n+102,155,255\n+102,194,255\n+102,255,255\n+102,255,178\n+102,255,102\n+141,255,102\n+201,255,102\n+214,255,102\n+255,255,102\n+255,224,102\n+255,173,102\n+255,155,102\n+255,102,102\n+255,102,155\n+255,102,194\n+255,102,245\n+224,102,255\n+71,0,153\n+31,0,255\n+0,10,153\n+0,41,153\n+0,92,153\n+0,153,153\n+0,153,77\n+0,153,0\n+31,153,0\n+71,153,0\n+112,153,0\n+153,153,0\n+153,122,0\n+153,82,0\n+153,41,0\n+153,0,0\n+153,0,41\n+153,0,92\n+153,0,143\n+122,0,153\n+128,68,204\n+94,68,204\n+68,78,204\n+68,102,204\n+68,153,204\n+68,204,204\n+68,204,127\n+68,204,68\n+94,204,68\n+128,204,68\n+170,204,68\n+204,204,68\n+204,68,170\n+204,136,68\n+204,102,68\n+204,68,68\n+204,68,102\n+204,68,153\n+204,68,187\n+170,68,204\n+\n+@@Weft Colors\n+1 1 1 1 1 1\n+\n+@@EndDTX\ndiff --git a/tests/data/bad_dtx/missing treadling.dtx b/tests/data/bad_dtx/missing treadling.dtx\nnew file mode 100644\nindex 0000000..b162501\n--- /dev/null\n+++ b/tests/data/bad_dtx/missing treadling.dtx\n@@ -0,0 +1,125 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color multiple treadles.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Tieup\n+Color Palette\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:14\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 6\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Tieup\n+000101\n+001010\n+010001\n+100010\n+\n+@@Color Palet\n+0,0,0\n+255,255,255\n+136,0,255\n+85,0,255\n+0,0,255\n+0,85,255\n+0,170,255\n+0,238,255\n+0,255,136\n+0,255,34\n+102,255,0\n+187,255,0\n+255,255,0\n+255,238,0\n+255,187,0\n+255,119,0\n+255,68,0\n+255,0,0\n+255,0,102\n+255,0,187\n+255,0,255\n+204,0,255\n+201,102,255\n+132,102,255\n+102,112,255\n+102,155,255\n+102,194,255\n+102,255,255\n+102,255,178\n+102,255,102\n+141,255,102\n+201,255,102\n+214,255,102\n+255,255,102\n+255,224,102\n+255,173,102\n+255,155,102\n+255,102,102\n+255,102,155\n+255,102,194\n+255,102,245\n+224,102,255\n+71,0,153\n+31,0,255\n+0,10,153\n+0,41,153\n+0,92,153\n+0,153,153\n+0,153,77\n+0,153,0\n+31,153,0\n+71,153,0\n+112,153,0\n+153,153,0\n+153,122,0\n+153,82,0\n+153,41,0\n+153,0,0\n+153,0,41\n+153,0,92\n+153,0,143\n+122,0,153\n+128,68,204\n+94,68,204\n+68,78,204\n+68,102,204\n+68,153,204\n+68,204,204\n+68,204,127\n+68,204,68\n+94,204,68\n+128,204,68\n+170,204,68\n+204,204,68\n+204,68,170\n+204,136,68\n+204,102,68\n+204,68,68\n+204,68,102\n+204,68,153\n+204,68,187\n+170,68,204\n+\n+@@Weft Colors\n+1 1 1 1 1 1\n+\n+@@EndDTX\ndiff --git a/tests/data/bad_dtx/missing_color_table.dtx b/tests/data/bad_dtx/missing_color_table.dtx\nnew file mode 100644\nindex 0000000..b8c7288\n--- /dev/null\n+++ b/tests/data/bad_dtx/missing_color_table.dtx\n@@ -0,0 +1,42 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color liftplan.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Liftplan\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:12\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 4\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Liftplan\n+1101\n+1010\n+1101\n+1011\n+0111\n+1110\n+\n+@@Weft Colors\n+1 1 1 1 1 1\n+\n+@@EndDTX\ndiff --git a/tests/data/bad_dtx/too_many_treadles_in_treadling.dtx b/tests/data/bad_dtx/too_many_treadles_in_treadling.dtx\nnew file mode 100644\nindex 0000000..98ad7cc\n--- /dev/null\n+++ b/tests/data/bad_dtx/too_many_treadles_in_treadling.dtx\n@@ -0,0 +1,129 @@\n+@@StartDTX\n+%%version 1\n+\n+@@Description\n+two color single treadles.wif\n+\n+@@Contents\n+Imprint\n+Private\n+Info\n+Threading\n+Tieup\n+Treadling\n+Color Palette\n+Weft Colors\n+EndDTX\n+\n+@@Imprint\n+PCW 4.2.0 Silver\n+Tuesday, June 11, 2024, 19:15\n+\n+@@Private\n+\n+@@Info\n+%%shafts 4\n+%%treadles 6\n+%%ends 4\n+%%picks 6\n+\n+@@Threading\n+2 3 4 1\n+\n+@@Tieup\n+011101\n+111010\n+110101\n+101110\n+\n+@@Treadling\n+ 6 5 4 3 2 1 7\n+\n+@@Color Palet\n+255,255,255\n+0,0,0\n+136,0,255\n+85,0,255\n+0,0,255\n+0,85,255\n+0,170,255\n+0,238,255\n+0,255,136\n+0,255,34\n+102,255,0\n+187,255,0\n+255,255,0\n+255,238,0\n+255,187,0\n+255,119,0\n+255,68,0\n+255,0,0\n+255,0,102\n+255,0,187\n+255,0,255\n+204,0,255\n+201,102,255\n+132,102,255\n+102,112,255\n+102,155,255\n+102,194,255\n+102,255,255\n+102,255,178\n+102,255,102\n+141,255,102\n+201,255,102\n+214,255,102\n+255,255,102\n+255,224,102\n+255,173,102\n+255,155,102\n+255,102,102\n+255,102,155\n+255,102,194\n+255,102,245\n+224,102,255\n+71,0,153\n+31,0,255\n+0,10,153\n+0,41,153\n+0,92,153\n+0,153,153\n+0,153,77\n+0,153,0\n+31,153,0\n+71,153,0\n+112,153,0\n+153,153,0\n+153,122,0\n+153,82,0\n+153,41,0\n+153,0,0\n+153,0,41\n+153,0,92\n+153,0,143\n+122,0,153\n+128,68,204\n+94,68,204\n+68,78,204\n+68,102,204\n+68,153,204\n+68,204,204\n+68,204,127\n+68,204,68\n+94,204,68\n+128,204,68\n+170,204,68\n+204,204,68\n+204,68,170\n+204,136,68\n+204,102,68\n+204,68,68\n+204,68,102\n+204,68,153\n+204,68,187\n+170,68,204\n+\n+@@Weft Colors\n+1 1 1 1 1 1\n+\n+@@EndDTX\ndiff --git a/tests/data/level1/level2/two color liftplan.dtx b/tests/data/basic_dtx/level2/two color liftplan.dtx\nsimilarity index 100%\nrename from tests/data/level1/level2/two color liftplan.dtx\nrename to tests/data/basic_dtx/level2/two color liftplan.dtx\ndiff --git a/tests/data/level1/level2/two color multiple treadles.dtx b/tests/data/basic_dtx/level2/two color multiple treadles.dtx\nsimilarity index 100%\nrename from tests/data/level1/level2/two color multiple treadles.dtx\nrename to tests/data/basic_dtx/level2/two color multiple treadles.dtx\ndiff --git a/tests/data/level1/level2/two color single treadles.dtx b/tests/data/basic_dtx/level2/two color single treadles.dtx\nsimilarity index 100%\nrename from tests/data/level1/level2/two color single treadles.dtx\nrename to tests/data/basic_dtx/level2/two color single treadles.dtx\ndiff --git a/tests/data/level1/many color single treadles.dtx b/tests/data/basic_dtx/many color single treadles.dtx\nsimilarity index 100%\nrename from tests/data/level1/many color single treadles.dtx\nrename to tests/data/basic_dtx/many color single treadles.dtx\ndiff --git a/tests/data/expected wifs/many color single treadles.wif b/tests/data/desired_basic_wif/many color single treadles.wif\nsimilarity index 100%\nrename from tests/data/expected wifs/many color single treadles.wif\nrename to tests/data/desired_basic_wif/many color single treadles.wif\ndiff --git a/tests/data/expected wifs/two color liftplan.wif b/tests/data/desired_basic_wif/two color liftplan.wif\nsimilarity index 100%\nrename from tests/data/expected wifs/two color liftplan.wif\nrename to tests/data/desired_basic_wif/two color liftplan.wif\ndiff --git a/tests/data/expected wifs/two color multiple treadles.wif b/tests/data/desired_basic_wif/two color multiple treadles.wif\nsimilarity index 100%\nrename from tests/data/expected wifs/two color multiple treadles.wif\nrename to tests/data/desired_basic_wif/two color multiple treadles.wif\ndiff --git a/tests/data/expected wifs/two color single treadles.wif b/tests/data/desired_basic_wif/two color single treadles.wif\nsimilarity index 100%\nrename from tests/data/expected wifs/two color single treadles.wif\nrename to tests/data/desired_basic_wif/two color single treadles.wif\ndiff --git a/tests/test_dtx_reader.py b/tests/test_dtx_reader.py\nnew file mode 100644\nindex 0000000..a8fecbe\n--- /dev/null\n+++ b/tests/test_dtx_reader.py\n@@ -0,0 +1,25 @@\n+import pathlib\n+import unittest\n+\n+import pytest\n+\n+from dtx_to_wif import read_dtx\n+\n+rootdir = pathlib.Path(__file__).parent.parent\n+datadir = rootdir / \"tests\" / \"data\" / \"bad_dtx\"\n+\n+\n+class TestDtxReader(unittest.TestCase):\n+ def test_read_bad_files(self):\n+ for prune in (False, True):\n+ for dtx_file_path in datadir.rglob(\"*.dtx\"):\n+ if dtx_file_path.name.startswith(\"two color\"):\n+ continue\n+ with self.subTest(file=dtx_file_path.name, prune=prune):\n+ with open(dtx_file_path, \"r\") as f:\n+ with pytest.raises(RuntimeError):\n+ read_dtx(f, prune=prune)\n+\n+\n+if __name__ == \"__main__\":\n+ unittest.main()\ndiff --git a/tests/test_dtx_to_wif.py b/tests/test_dtx_to_wif.py\nindex 01b0529..b839777 100644\n--- a/tests/test_dtx_to_wif.py\n+++ b/tests/test_dtx_to_wif.py\n@@ -11,33 +11,39 @@ datadir = rootdir / \"tests\" / \"data\"\n class TestDtxToWif(unittest.TestCase):\n def test_dtx_to_wif(self):\n cmdname = \"dtx_to_wif\"\n- with tempfile.TemporaryDirectory() as outdirname:\n- print(f\"{datadir=}, {outdirname=}\")\n- outdir = pathlib.Path(outdirname)\n- shutil.copytree(datadir, outdir / \"data\")\n+ # Copy tests/data to a temp dir and run dtx_to_wif on the copied files,\n+ # to avoid writing files to tests/data\n+ with tempfile.TemporaryDirectory() as tempdirname:\n+ tempdir = pathlib.Path(tempdirname)\n+ for subdirname in (\"basic_dtx\", \"desired_basic_wif\"):\n+ shutil.copytree(datadir / subdirname, tempdir / subdirname)\n+\n+ basic_dtx_dir = tempdir / \"basic_dtx\"\n+ basic_dtx_dir_str = basic_dtx_dir.as_posix()\n+ desired_basic_wif_dir = tempdir / \"desired_basic_wif\"\n result = subprocess.run(\n- [cmdname, outdirname], check=True, capture_output=True\n+ [cmdname, basic_dtx_dir_str], check=True, capture_output=True\n )\n self.check_run_result(result, desired_prefix=\"Writing\")\n- dtxpaths = [path for path in outdir.rglob(\"*.dtx\")]\n- assert len(dtxpaths) == 4\n- for dtxpath in dtxpaths:\n+ basic_dtx_paths = [path for path in basic_dtx_dir.rglob(\"*.dtx\")]\n+ assert len(basic_dtx_paths) == 4\n+ for dtxpath in basic_dtx_paths:\n wifpath = dtxpath.with_suffix(\".wif\")\n assert wifpath.is_file()\n- desired_wifpath = datadir / \"expected wifs\" / wifpath.name\n- self.assert_files_equal(wifpath, desired_wifpath)\n+ desired_basic_wif_path = desired_basic_wif_dir / wifpath.name\n+ self.assert_files_equal(wifpath, desired_basic_wif_path)\n\n- # Clear the wif files and run again.\n- # All wif files should be empty because they are not overwritten\n- for dtxpath in dtxpaths:\n+ # Clear the wif files in the basic_dtx dir tree and run again.\n+ # All wif files should be empty because they are not overwritten.\n+ for dtxpath in basic_dtx_paths:\n wifpath = dtxpath.with_suffix(\".wif\")\n with open(wifpath, \"w\") as f:\n f.truncate()\n result = subprocess.run(\n- [cmdname, outdirname], check=True, capture_output=True\n+ [cmdname, basic_dtx_dir_str], check=True, capture_output=True\n )\n self.check_run_result(result, desired_prefix=\"Skipping\")\n- for dtxpath in dtxpaths:\n+ for dtxpath in basic_dtx_paths:\n wifpath = dtxpath.with_suffix(\".wif\")\n assert wifpath.is_file()\n with open(wifpath, \"r\") as f:\n@@ -47,14 +53,14 @@ class TestDtxToWif(unittest.TestCase):\n # Check that --overwrite replaces the (currently empty) wif files\n # and check that individual files can be specified\n # (instead of, or in addition to, directories)\n- filepathargs = [cmdname] + dtxpaths + [\"--overwrite\"]\n+ filepathargs = [cmdname] + basic_dtx_paths + [\"--overwrite\"]\n result = subprocess.run(filepathargs, check=True, capture_output=True)\n self.check_run_result(result, desired_prefix=\"Overwriting\")\n- for dtxpath in dtxpaths:\n+ for dtxpath in basic_dtx_paths:\n wifpath = dtxpath.with_suffix(\".wif\")\n assert wifpath.is_file()\n- desired_wifpath = datadir / \"expected wifs\" / wifpath.name\n- self.assert_files_equal(wifpath, desired_wifpath)\n+ desired_basic_wif_path = datadir / \"desired_basic_wif\" / wifpath.name\n+ self.assert_files_equal(wifpath, desired_basic_wif_path)\n\n def check_run_result(self, result, desired_prefix):\n \"\"\"Check the result from running the function.\ndiff --git a/tests/test_wif_reader.py b/tests/test_wif_reader.py\nindex b966aae..cff6753 100644\n--- a/tests/test_wif_reader.py\n+++ b/tests/test_wif_reader.py\n@@ -5,16 +5,15 @@ from dtx_to_wif import read_dtx, read_wif\n\n rootdir = pathlib.Path(__file__).parent.parent\n datadir = rootdir / \"tests\" / \"data\"\n-level1dir = datadir / \"level1\"\n-execpath = rootdir / \"dtx_to_wif\"\n+basic_dtxdir = datadir / \"basic_dtx\"\n\n class TestWifReader(unittest.TestCase):\n def test_wif_reader(self):\n for prune in (False, True):\n- for dtx_file in level1dir.glob(\"*.dtx\"):\n+ for dtx_file in basic_dtxdir.glob(\"*.dtx\"):\n with self.subTest(file=dtx_file.stem, prune=prune):\n- wif_file = datadir / \"expected wifs\" / (dtx_file.stem + \".wif\")\n+ wif_file = datadir / \"desired_basic_wif\" / (dtx_file.stem + \".wif\")\n with open(dtx_file, \"r\") as f:\n parsed_dtx = read_dtx(f, prune=prune)\n with open(wif_file, \"r\") as f:","shortMessageHtmlLink":"Add test_dtx_reader"}},{"before":"19ae083f75f8597e2d3ef2fb959771503e945040","after":"b270764640d934ce45043d3219532b0b61b2f7e0","ref":"refs/heads/v2.0","pushedAt":"2024-09-21T14:16:09.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Add pruned parameter to DrawdownData","shortMessageHtmlLink":"Add pruned parameter to DrawdownData"}},{"before":"cb58b66597d20b638cd4e7949b7cdd06d8050db1","after":"19ae083f75f8597e2d3ef2fb959771503e945040","ref":"refs/heads/v2.0","pushedAt":"2024-09-21T13:25:23.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Use sets for threading, tieup, ...\n\nUse sets instead of tuples for threading,\ntieup, treadling, and liftplan values.\nThis makes the data much easier to work with.","shortMessageHtmlLink":"Use sets for threading, tieup, ..."}},{"before":"0ef88b4a721939f2cb0bc2a5ca462a910f4e1f26","after":"cb58b66597d20b638cd4e7949b7cdd06d8050db1","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T23:02:33.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Fix cleanup errors in DrawdownData\n\nThe cleaned dicts were not being saved.\nAlso expand the cleanup for lists of tuples\nof ints to remove entries with value (0,)\n(as well as ()).","shortMessageHtmlLink":"Fix cleanup errors in DrawdownData"}},{"before":"b1fbf5053997c8659dd1f980778532567646e134","after":"0ef88b4a721939f2cb0bc2a5ca462a910f4e1f26","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T17:48:50.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Fix issues link","shortMessageHtmlLink":"Fix issues link"}},{"before":"b73552fec56cc33dad4bfd136db737f268d17b00","after":"b1fbf5053997c8659dd1f980778532567646e134","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T17:37:41.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"* Now a pip-installable package\n* Added `read_wif` to read WIF files\n* Rename the dtx reader to `read_dtx`\n* Rename the WIF writer to `write_wif`\n* Read file data into `DrawdownData`, a dataclass\n intended to model the WIF standard.","shortMessageHtmlLink":"* Now a pip-installable package"}},{"before":"8ceae57251a5b86ac29db3fb1eb812121f023628","after":null,"ref":"refs/tags/v2.0b1","pushedAt":"2024-09-20T17:37:17.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"}},{"before":"ba2a4d905ec85ee43829669537867a5af4d20e05","after":"b73552fec56cc33dad4bfd136db737f268d17b00","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T17:34:16.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"* Now a pip-installable package\n* Added `read_wif` to read WIF files\n* Rename the dtx reader to `read_dtx`\n* Rename the WIF writer to `write_wif`\n* Read file data into `DrawdownData`, a dataclass\n intended to model the WIF standard.","shortMessageHtmlLink":"* Now a pip-installable package"}},{"before":"74bed0d11d1412a71514bcb9dc5c8606825da180","after":null,"ref":"refs/tags/v2.0b1","pushedAt":"2024-09-20T17:24:46.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"}},{"before":"c27632463ca1e8a2cc2a889672b410285afbb185","after":"ba2a4d905ec85ee43829669537867a5af4d20e05","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T17:12:40.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"* Now a pip-installable package\n* Added `read_wif` to read WIF files\n* Rename the dtx reader to `read_dtx`\n* Rename the WIF writer to `write_wif`\n* Read file data into `DrawdownData`, a dataclass\n intended to model the WIF standard.","shortMessageHtmlLink":"* Now a pip-installable package"}},{"before":"27a722a603be4b090dd884f8e7c297d3ff934a36","after":null,"ref":"refs/tags/v0.2b1","pushedAt":"2024-09-20T16:45:36.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"}},{"before":"9a0d442354a8ba6625d75ef1d5c9d9ec59cc34fb","after":"c27632463ca1e8a2cc2a889672b410285afbb185","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T15:33:09.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Tweak license classifier","shortMessageHtmlLink":"Tweak license classifier"}},{"before":"884a65092fe14f6f7e8d25e134a7e934061536e6","after":"9a0d442354a8ba6625d75ef1d5c9d9ec59cc34fb","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T14:57:41.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Update the readme","shortMessageHtmlLink":"Update the readme"}},{"before":"6726d286e576d8e497a3352558c69b496da5a01f","after":"884a65092fe14f6f7e8d25e134a7e934061536e6","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T14:41:22.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Run isort","shortMessageHtmlLink":"Run isort"}},{"before":"affca960335534213114323c1edcd5e7c6df591b","after":"6726d286e576d8e497a3352558c69b496da5a01f","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T14:40:37.000Z","pushType":"push","commitsCount":3,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Add pre-commit config","shortMessageHtmlLink":"Add pre-commit config"}},{"before":"556f1430593e32c38f13b220cb7d37f622f5d081","after":"affca960335534213114323c1edcd5e7c6df591b","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T00:50:38.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Tweak comments","shortMessageHtmlLink":"Tweak comments"}},{"before":"f9c17a5e5f3ccc2455163fb1b9daf2bb03302fbd","after":"556f1430593e32c38f13b220cb7d37f622f5d081","ref":"refs/heads/v2.0","pushedAt":"2024-09-20T00:39:31.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Fix wif_reader","shortMessageHtmlLink":"Fix wif_reader"}},{"before":"2208e84f8218e3857b313881566eee4fb356ed03","after":"f9c17a5e5f3ccc2455163fb1b9daf2bb03302fbd","ref":"refs/heads/v2.0","pushedAt":"2024-09-19T20:02:00.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Minor tweaks","shortMessageHtmlLink":"Minor tweaks"}},{"before":"8cc223ca9a672b3cacdfa70af9b2c799fb7358b3","after":"2208e84f8218e3857b313881566eee4fb356ed03","ref":"refs/heads/v2.0","pushedAt":"2024-09-19T19:59:19.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"DrawdownData is now mostly dicts","shortMessageHtmlLink":"DrawdownData is now mostly dicts"}},{"before":"63170e8ac7f38c20452fd22f7da19ce606dd1734","after":"8cc223ca9a672b3cacdfa70af9b2c799fb7358b3","ref":"refs/heads/v2.0","pushedAt":"2024-09-19T18:49:27.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Add wif_reader","shortMessageHtmlLink":"Add wif_reader"}},{"before":"8ea9555eefa1d7de13f57e6aeab88e1caeab1c72","after":"63170e8ac7f38c20452fd22f7da19ce606dd1734","ref":"refs/heads/v2.0","pushedAt":"2024-09-19T17:12:50.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"r-owen","name":"Russell Owen","path":"/r-owen","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/874176?s=80&v=4"},"commit":{"message":"Subtract 1 from threading\n\nand stop writing a date to a nonstandard wif field","shortMessageHtmlLink":"Subtract 1 from threading"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"startCursor":"Y3Vyc29yOnYyOpK7MjAyNC0wOS0yM1QyMzo0MjoxMC4wMDAwMDBazwAAAAS-iKLA","endCursor":"Y3Vyc29yOnYyOpK7MjAyNC0wOS0xOVQxNzoxMjo1MC4wMDAwMDBazwAAAAS7IeOi"}},"title":"Activity ยท r-owen/dtx_to_wif_converter"}