knit-graphs 0.0.6__py3-none-any.whl → 0.0.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. knit_graphs-0.0.6.dist-info/licenses/LICENSE → LICENSE +21 -21
  2. README.md +75 -0
  3. docs/Makefile +20 -0
  4. docs/make.bat +35 -0
  5. docs/source/api/knit_graphs.Course.rst +7 -0
  6. docs/source/api/knit_graphs.Knit_Graph.rst +7 -0
  7. docs/source/api/knit_graphs.Knit_Graph_Visualizer.rst +7 -0
  8. docs/source/api/knit_graphs.Loop.rst +7 -0
  9. docs/source/api/knit_graphs.Pull_Direction.rst +7 -0
  10. docs/source/api/knit_graphs.Yarn.rst +7 -0
  11. docs/source/api/knit_graphs.artin_wale_braids.Crossing_Direction.rst +7 -0
  12. docs/source/api/knit_graphs.artin_wale_braids.Loop_Braid_Graph.rst +7 -0
  13. docs/source/api/knit_graphs.artin_wale_braids.Wale.rst +7 -0
  14. docs/source/api/knit_graphs.artin_wale_braids.Wale_Braid.rst +7 -0
  15. docs/source/api/knit_graphs.artin_wale_braids.Wale_Braid_Word.rst +7 -0
  16. docs/source/api/knit_graphs.artin_wale_braids.Wale_Group.rst +7 -0
  17. docs/source/api/knit_graphs.artin_wale_braids.rst +23 -0
  18. docs/source/api/knit_graphs.basic_knit_graph_generators.rst +7 -0
  19. docs/source/api/knit_graphs.rst +32 -0
  20. docs/source/conf.py +335 -0
  21. docs/source/index.rst +71 -0
  22. docs/source/installation.rst +67 -0
  23. knit_graphs/Course.py +156 -104
  24. knit_graphs/Knit_Graph.py +249 -186
  25. knit_graphs/Knit_Graph_Visualizer.py +675 -0
  26. knit_graphs/Loop.py +141 -155
  27. knit_graphs/Pull_Direction.py +68 -23
  28. knit_graphs/Yarn.py +424 -267
  29. knit_graphs/__init__.py +3 -3
  30. knit_graphs/_base_classes.py +173 -0
  31. knit_graphs/artin_wale_braids/Crossing_Direction.py +74 -15
  32. knit_graphs/artin_wale_braids/Loop_Braid_Graph.py +95 -62
  33. knit_graphs/artin_wale_braids/Wale.py +169 -93
  34. knit_graphs/artin_wale_braids/Wale_Braid.py +50 -30
  35. knit_graphs/artin_wale_braids/Wale_Braid_Word.py +99 -54
  36. knit_graphs/artin_wale_braids/Wale_Group.py +136 -88
  37. knit_graphs/basic_knit_graph_generators.py +251 -0
  38. knit_graphs-0.0.8.dist-info/LICENSE +21 -0
  39. {knit_graphs-0.0.6.dist-info → knit_graphs-0.0.8.dist-info}/METADATA +33 -24
  40. knit_graphs-0.0.8.dist-info/RECORD +42 -0
  41. {knit_graphs-0.0.6.dist-info → knit_graphs-0.0.8.dist-info}/WHEEL +1 -1
  42. knit_graphs/__about__.py +0 -4
  43. knit_graphs/knit_graph_generators/__init__.py +0 -0
  44. knit_graphs/knit_graph_generators/basic_knit_graph_generators.py +0 -248
  45. knit_graphs/knit_graph_visualizer/Stitch_Visualizer.py +0 -427
  46. knit_graphs/knit_graph_visualizer/__init__.py +0 -0
  47. knit_graphs-0.0.6.dist-info/RECORD +0 -22
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Megan Hofmann
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Megan Hofmann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,75 @@
1
+ # knit_graphs
2
+
3
+ [![PyPI - Version](https://img.shields.io/pypi/v/knit-graphs.svg)](https://pypi.org/project/knit-graphs)
4
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/knit-graphs.svg)](https://pypi.org/project/knit-graphs)
5
+
6
+ -----
7
+ ## Description
8
+ The knit-graphs packaged provides a data structure for representing knitted structures formed of loops of yarn (nodes) connected by various edge structures. Loops are connected by: floats (yarn-edges) in a yarn graph structure, stitch edges (loops pulled through loops), and crossed over each other in a wale-braid structure.
9
+
10
+ Knit graphs provide a powerful tool for representing knitted structures for digital fabrication systems such as knitting machine programming languages and design tools.
11
+
12
+ Additional details about this knit-graph construction are available in the ACM publication:
13
+ ["KnitPicking Texture: Programming and Modifying Complex Knitted Textures for Machine and Hand Knitting"](https://doi.org/10.1145/3332165.3347886)
14
+
15
+ ## Table of Contents
16
+ - [Description](#description)
17
+ - [Installation](#installation)
18
+ - [Usage](#usage)
19
+ - [Knit Graph Generators](#knit-graph-generators)
20
+ - [Visualizing Knit Graphs](#visualizing-knit-graphs)
21
+ - [Credits](#credits)
22
+ - [License](#license)
23
+
24
+
25
+
26
+ ## Installation
27
+
28
+ ```console
29
+ pip install knit-graphs
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ### Knit Graph Generators
35
+ The [knit-graph-generators subpackage](https://github.com/mhofmann-Khoury/knit_graph/tree/main/src/knit_graphs/knit_graph_generators) provides a library of basic knit graphs to generate such as casting on loops of a knitted structure, creating Jersey (aka Stockinette) tubes and swatches, and other basic textures.
36
+ For example, to generate a swatch of knit-purl ribbing use the following:
37
+
38
+ ```python
39
+ from knit_graphs.basic_knit_graph_generators import kp_rib_swatch
40
+
41
+ width = 10
42
+ height = 10
43
+ kp_rib_swatch = kp_rib_swatch(width, height)
44
+ ```
45
+ Additional examples of knitgraph generator usage can be found in the [Knit_Graph test module](https://github.com/mhofmann-Khoury/knit_graph/blob/main/tests/test_Knit_Graph.py).
46
+
47
+ Knitgraphs can be created without generators. We encourage users to review the generators as simple examples on creating a knit graph programmatically.
48
+
49
+ ### Visualizing Knit Graphs
50
+ We provide simple support for visualizing knit graphs. This is primarily used to debugging simple knit graph programs.
51
+
52
+ For example, we can visualize a swatch of seed stitch (checkered knit and purl stitches) with the following code.
53
+
54
+ ```python
55
+ from knit_graphs.basic_knit_graph_generators import seed_swatch
56
+ from knit_graphs.knit_graph_visualizer.Stitch_Visualizer import visualize_stitches
57
+
58
+ width = 4
59
+ height = 4
60
+ swatch = seed_swatch(width, height)
61
+ visualize_stitches(swatch)
62
+ ```
63
+ The visualizer shows knit stitches (loops pulled from the back of the fabric to the front) as blue edges and purl stitches (loops pulled from the front to back) (aka back-knits) as red edges. Loop nodes are circles labeled with their time-ordered index and colored to match their yarn (defaults to dark green). The yarn edges (aka floats) connecting them are made of thin edges the same color as the loop nodes.
64
+
65
+ Additional examples of using the visualizer are available in the [Stitch Visualizer Tests Module](https://github.com/mhofmann-Khoury/knit_graph/blob/main/tests/test_Stitch_Visualizer.py)
66
+
67
+ ## Credits
68
+ The design of this data scructure was completed by the authors of
69
+ ["KnitPicking Texture: Programming and Modifying Complex Knitted Textures for Machine and Hand Knitting"](https://doi.org/10.1145/3332165.3347886).
70
+
71
+ The inclusion of the Artin-Braide wale crossing construction was inspired by ["An Artin Braid Group Representation of Knitting Machine State with Applications to Validation and Optimization of Fabrication Plans"](https://doi.org/10.1109/ICRA48506.2021.9562113) by Jenny Lin and James McCann.
72
+
73
+ ## License
74
+
75
+ `knit-graphs` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
docs/Makefile ADDED
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
docs/make.bat ADDED
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
+ echo.installed, then set the SPHINXBUILD environment variable to point
18
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
+ echo.may add the Sphinx directory to PATH.
20
+ echo.
21
+ echo.If you don't have Sphinx installed, grab it from
22
+ echo.https://www.sphinx-doc.org/
23
+ exit /b 1
24
+ )
25
+
26
+ if "%1" == "" goto help
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,7 @@
1
+ knit\_graphs.Course module
2
+ ==========================
3
+
4
+ .. automodule:: knit_graphs.Course
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.Knit\_Graph module
2
+ ===============================
3
+
4
+ .. automodule:: knit_graphs.Knit_Graph
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.Knit\_Graph\_Visualizer module
2
+ ===========================================
3
+
4
+ .. automodule:: knit_graphs.Knit_Graph_Visualizer
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.Loop module
2
+ ========================
3
+
4
+ .. automodule:: knit_graphs.Loop
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.Pull\_Direction module
2
+ ===================================
3
+
4
+ .. automodule:: knit_graphs.Pull_Direction
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.Yarn module
2
+ ========================
3
+
4
+ .. automodule:: knit_graphs.Yarn
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.artin\_wale\_braids.Crossing\_Direction module
2
+ ===========================================================
3
+
4
+ .. automodule:: knit_graphs.artin_wale_braids.Crossing_Direction
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.artin\_wale\_braids.Loop\_Braid\_Graph module
2
+ ==========================================================
3
+
4
+ .. automodule:: knit_graphs.artin_wale_braids.Loop_Braid_Graph
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.artin\_wale\_braids.Wale module
2
+ ============================================
3
+
4
+ .. automodule:: knit_graphs.artin_wale_braids.Wale
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.artin\_wale\_braids.Wale\_Braid module
2
+ ===================================================
3
+
4
+ .. automodule:: knit_graphs.artin_wale_braids.Wale_Braid
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.artin\_wale\_braids.Wale\_Braid\_Word module
2
+ =========================================================
3
+
4
+ .. automodule:: knit_graphs.artin_wale_braids.Wale_Braid_Word
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.artin\_wale\_braids.Wale\_Group module
2
+ ===================================================
3
+
4
+ .. automodule:: knit_graphs.artin_wale_braids.Wale_Group
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,23 @@
1
+ knit\_graphs.artin\_wale\_braids package
2
+ ========================================
3
+
4
+ Submodules
5
+ ----------
6
+
7
+ .. toctree::
8
+ :maxdepth: 4
9
+
10
+ knit_graphs.artin_wale_braids.Crossing_Direction
11
+ knit_graphs.artin_wale_braids.Loop_Braid_Graph
12
+ knit_graphs.artin_wale_braids.Wale
13
+ knit_graphs.artin_wale_braids.Wale_Braid
14
+ knit_graphs.artin_wale_braids.Wale_Braid_Word
15
+ knit_graphs.artin_wale_braids.Wale_Group
16
+
17
+ Module contents
18
+ ---------------
19
+
20
+ .. automodule:: knit_graphs.artin_wale_braids
21
+ :members:
22
+ :undoc-members:
23
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ knit\_graphs.basic\_knit\_graph\_generators module
2
+ ==================================================
3
+
4
+ .. automodule:: knit_graphs.basic_knit_graph_generators
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,32 @@
1
+ knit\_graphs package
2
+ ====================
3
+
4
+ Subpackages
5
+ -----------
6
+
7
+ .. toctree::
8
+ :maxdepth: 4
9
+
10
+ knit_graphs.artin_wale_braids
11
+
12
+ Submodules
13
+ ----------
14
+
15
+ .. toctree::
16
+ :maxdepth: 4
17
+
18
+ knit_graphs.Course
19
+ knit_graphs.Knit_Graph
20
+ knit_graphs.Knit_Graph_Visualizer
21
+ knit_graphs.Loop
22
+ knit_graphs.Pull_Direction
23
+ knit_graphs.Yarn
24
+ knit_graphs.basic_knit_graph_generators
25
+
26
+ Module contents
27
+ ---------------
28
+
29
+ .. automodule:: knit_graphs
30
+ :members:
31
+ :undoc-members:
32
+ :show-inheritance: