knit-graphs 0.0.3__py3-none-any.whl → 0.0.5__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.
knit_graphs/Knit_Graph.py CHANGED
@@ -110,8 +110,7 @@ class Knit_Graph:
110
110
 
111
111
  def get_courses(self) -> list[Course]:
112
112
  """
113
- :return: A dictionary of loop_ids to the course they are on,
114
- a dictionary or course ids to the loops on that course in the order of creation.
113
+ :return: A list of courses in their order formed in the knit graph.
115
114
  The first set of loops in the graph is on course 0.
116
115
  A course change occurs when a loop has a parent loop in the last course.
117
116
  """
knit_graphs/Yarn.py CHANGED
@@ -1,27 +1,22 @@
1
1
  """
2
2
  The Yarn Data Structure
3
3
  """
4
+ from dataclasses import dataclass
5
+
4
6
  import networkx
5
7
 
6
8
  from knit_graphs.Loop import Loop
7
9
 
8
10
 
11
+ @dataclass(unsafe_hash=True)
9
12
  class Yarn_Properties:
10
13
  """
11
14
  Class Structure for maintaining relevant data about a yarn
12
15
  """
13
-
14
- def __init__(self, name: str = "yarn", plies: int = 2, weight: float = 28, color=None):
15
- self.plies = plies
16
- self.name = name
17
- self.weight = weight
18
- if color is None:
19
- color = "green"
20
- # color = random.choice(matplotlib.colors.BASE_COLORS.items())
21
- self.color = color
22
-
23
- def __hash__(self):
24
- return hash(str(self))
16
+ name: str = "yarn"
17
+ plies: int = 2
18
+ weight: float = 28
19
+ color: str = "green"
25
20
 
26
21
  def __str__(self):
27
22
  return f"{self.name}({self.plies}-{self.weight},{self.color})"
@@ -29,13 +24,6 @@ class Yarn_Properties:
29
24
  def __repr__(self):
30
25
  return self.name
31
26
 
32
- @staticmethod
33
- def default_yarn():
34
- """
35
- :return: A default yarn to be used for development
36
- """
37
- return Yarn_Properties()
38
-
39
27
 
40
28
  class Yarn:
41
29
  """
@@ -49,7 +37,7 @@ class Yarn:
49
37
  :param yarn_properties:
50
38
  """
51
39
  if yarn_properties is None:
52
- yarn_properties = Yarn_Properties.default_yarn()
40
+ yarn_properties = Yarn_Properties()
53
41
  self.properties: Yarn_Properties = yarn_properties
54
42
  self.loop_graph: networkx.DiGraph = networkx.DiGraph()
55
43
  self._first_loop: Loop | None = None
knit_graphs/__about__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present m.hofmann <m.hofmann@northeastern.edu>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.0.3"
4
+ __version__ = "0.0.5"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: knit-graphs
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: A graph representation of knitted structures where each loop is a node and edges represent yarn and stitch relationships.
5
5
  Project-URL: Documentation, https://github.com/mhofmann-Khoury/knit_graph#readme
6
6
  Project-URL: Issues, https://github.com/mhofmann-Khoury/knit_graph/issues
@@ -1,9 +1,9 @@
1
1
  knit_graphs/Course.py,sha256=gEIl9EXXCx3NfEQclhK_7WGVOK_rxF5hB0jqGeAyH_w,3437
2
- knit_graphs/Knit_Graph.py,sha256=yiVFVs4oDaSJUINu70KrdqllzUeXfPEBnbiKfxw1VZM,7836
2
+ knit_graphs/Knit_Graph.py,sha256=arRNaxUaV3uwgNJ_UKxS7zViHl46y5QErPM_vTA_q8Y,7753
3
3
  knit_graphs/Loop.py,sha256=S2YGS8f_CtbFzy-OJsY6_JzGaHiiVMXrROO6P-wByTo,5236
4
4
  knit_graphs/Pull_Direction.py,sha256=G2JLbUT8x-ZfLNX3yjslv61FaoZiODUOPyYeDqj3pqQ,596
5
- knit_graphs/Yarn.py,sha256=reBK5uT9A85Cp4WWkSssZE8DvAoRhVUw6vlQuA_VgWs,9609
6
- knit_graphs/__about__.py,sha256=wvno_JlxEhpqekSk_Ncm82e14hUl8xvlUYeXvcpG0DU,137
5
+ knit_graphs/Yarn.py,sha256=VYh1H-DUEhYBVUwytYBNMiX9M7AEvLNwZ5EmSvpWOt8,9193
6
+ knit_graphs/__about__.py,sha256=4HAjH7dgwx4z-xWcKW_BekxlXWI42CuUT_Q2Z4frTog,137
7
7
  knit_graphs/__init__.py,sha256=bPQ_U3Sf5VvF36ywW6v79_J51b7DdZPvXuaHAtlbmg4,114
8
8
  knit_graphs/artin_wale_braids/Crossing_Direction.py,sha256=YVYfv11V-mB9WmQzNuOjbEQQI-b07gl9KF31vwujb1g,430
9
9
  knit_graphs/artin_wale_braids/Loop_Braid_Graph.py,sha256=z9_VyQA5U9y-XjyaZ67kSmOr0Bg_N1932ghV3YzNrP0,2742
@@ -16,7 +16,7 @@ knit_graphs/knit_graph_generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
16
16
  knit_graphs/knit_graph_generators/basic_knit_graph_generators.py,sha256=eRmoqIhjymKERJhjnwuQll3psAf9HHwnHWDkTcZX6Uk,11330
17
17
  knit_graphs/knit_graph_visualizer/Stitch_Visualizer.py,sha256=l90bdaucCDzSmua7iILoNmpVQuQsuMKHq5r0DkakoL0,21411
18
18
  knit_graphs/knit_graph_visualizer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- knit_graphs-0.0.3.dist-info/METADATA,sha256=BJFF839AI04AN3bFavrl22iDE5CNtkrGBuFM1QTWpYE,5063
20
- knit_graphs-0.0.3.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
21
- knit_graphs-0.0.3.dist-info/licenses/LICENSE,sha256=M4U6L5axKj_93OoQXCm4RUIsUwHqEVzf7hsOVmyFPp0,1091
22
- knit_graphs-0.0.3.dist-info/RECORD,,
19
+ knit_graphs-0.0.5.dist-info/METADATA,sha256=M7uCjNOYPILJ18Sa8FQ9iPqOQrq4brxPk98mwQCw7qc,5063
20
+ knit_graphs-0.0.5.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
21
+ knit_graphs-0.0.5.dist-info/licenses/LICENSE,sha256=M4U6L5axKj_93OoQXCm4RUIsUwHqEVzf7hsOVmyFPp0,1091
22
+ knit_graphs-0.0.5.dist-info/RECORD,,