halfedge 0.5.0__tar.gz → 0.6.0__tar.gz

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 (28) hide show
  1. {halfedge-0.5.0/src/halfedge.egg-info → halfedge-0.6.0}/PKG-INFO +1 -1
  2. {halfedge-0.5.0 → halfedge-0.6.0}/pyproject.toml +2 -2
  3. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge/__init__.py +2 -0
  4. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge/type_attrib.py +28 -4
  5. {halfedge-0.5.0 → halfedge-0.6.0/src/halfedge.egg-info}/PKG-INFO +1 -1
  6. {halfedge-0.5.0 → halfedge-0.6.0}/tests/test_classes.py +0 -3
  7. {halfedge-0.5.0 → halfedge-0.6.0}/.github/workflows/pypi-project.yml +0 -0
  8. {halfedge-0.5.0 → halfedge-0.6.0}/.gitignore +0 -0
  9. {halfedge-0.5.0 → halfedge-0.6.0}/.pre-commit-config.yaml +0 -0
  10. {halfedge-0.5.0 → halfedge-0.6.0}/README.md +0 -0
  11. {halfedge-0.5.0 → halfedge-0.6.0}/setup.cfg +0 -0
  12. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge/half_edge_constructors.py +0 -0
  13. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge/half_edge_elements.py +0 -0
  14. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge/half_edge_object.py +0 -0
  15. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge/half_edge_querries.py +0 -0
  16. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge/py.typed +0 -0
  17. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge/validations.py +0 -0
  18. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge.egg-info/SOURCES.txt +0 -0
  19. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge.egg-info/dependency_links.txt +0 -0
  20. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge.egg-info/requires.txt +0 -0
  21. {halfedge-0.5.0 → halfedge-0.6.0}/src/halfedge.egg-info/top_level.txt +0 -0
  22. {halfedge-0.5.0 → halfedge-0.6.0}/tests/__init__.py +0 -0
  23. {halfedge-0.5.0 → halfedge-0.6.0}/tests/conftest.py +0 -0
  24. {halfedge-0.5.0 → halfedge-0.6.0}/tests/test_constructors.py +0 -0
  25. {halfedge-0.5.0 → halfedge-0.6.0}/tests/test_elements.py +0 -0
  26. {halfedge-0.5.0 → halfedge-0.6.0}/tests/test_object_pickups.py +0 -0
  27. {halfedge-0.5.0 → halfedge-0.6.0}/tests/test_operations.py +0 -0
  28. {halfedge-0.5.0 → halfedge-0.6.0}/tests/test_validations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: halfedge
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: A typical half-edge data structure with some padding
5
5
  Author-email: Shay Hill <shay_public@hotmail.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "halfedge"
3
- version = "0.5.0"
3
+ version = "0.6.0"
4
4
  description = "A typical half-edge data structure with some padding"
5
5
  authors = [{ name = "Shay Hill", email = "shay_public@hotmail.com" }]
6
6
  license = {text = "MIT"}
@@ -25,7 +25,7 @@ build-backend = "setuptools.build_meta"
25
25
 
26
26
  [tool.commitizen]
27
27
  name = "cz_conventional_commits"
28
- version = "0.5.0"
28
+ version = "0.6.0"
29
29
  tag_format = "$version"
30
30
  major-version-zero = true
31
31
  version_files = ["pyproject.toml:^version"]
@@ -8,6 +8,7 @@ from halfedge.type_attrib import (
8
8
  ContagionAttrib,
9
9
  IncompatibleAttrib,
10
10
  NumericAttrib,
11
+ StaticAttrib,
11
12
  Vector2Attrib,
12
13
  Vector3Attrib,
13
14
  )
@@ -22,6 +23,7 @@ __all__ = [
22
23
  "IncompatibleAttrib",
23
24
  "MeshElementBase",
24
25
  "NumericAttrib",
26
+ "StaticAttrib",
25
27
  "Vector2Attrib",
26
28
  "Vector3Attrib",
27
29
  "Vert",
@@ -79,7 +79,7 @@ class StaticAttrib(Generic[_T]):
79
79
  merged or split.
80
80
  """
81
81
 
82
- __slots__ = ("_value", "mesh")
82
+ __slots__ = ("_value", "_mesh")
83
83
 
84
84
  def __new__(
85
85
  cls: type[_TStaticAttrib],
@@ -99,7 +99,7 @@ class StaticAttrib(Generic[_T]):
99
99
  ) -> None:
100
100
  """Set value and mesh."""
101
101
  self._value = value
102
- self.mesh = mesh
102
+ self._mesh = mesh
103
103
 
104
104
  def copy_to_element(
105
105
  self: StaticAttrib[_T], mesh: BlindHalfEdges
@@ -127,6 +127,18 @@ class StaticAttrib(Generic[_T]):
127
127
  msg = "no value set and failed to infer from 'self.mesh'"
128
128
  raise AttributeError(msg)
129
129
 
130
+ @property
131
+ def mesh(self) -> BlindHalfEdges:
132
+ """Return the mesh to which this attribute is assigned.
133
+
134
+ :return: BlindHalfEdges instance
135
+ :raise AttributeError: If no mesh is set
136
+ """
137
+ if self._mesh is None:
138
+ msg = "no mesh set"
139
+ raise AttributeError(msg)
140
+ return self._mesh
141
+
130
142
  def _infer_value(self) -> _T:
131
143
  """Get value of self from self._mesh.
132
144
 
@@ -181,7 +193,7 @@ class Attrib(Generic[_T]):
181
193
  every case.
182
194
  """
183
195
 
184
- __slots__ = ("_value", "element")
196
+ __slots__ = ("_value", "_element")
185
197
 
186
198
  def __new__(
187
199
  cls: type[_TAttrib],
@@ -201,7 +213,7 @@ class Attrib(Generic[_T]):
201
213
  ) -> None:
202
214
  """Set value and element."""
203
215
  self._value = value
204
- self.element = element
216
+ self._element = element
205
217
 
206
218
  @property
207
219
  def value(self) -> _T:
@@ -219,6 +231,18 @@ class Attrib(Generic[_T]):
219
231
  msg = "no value set and failed to infer from 'self.element'"
220
232
  raise AttributeError(msg)
221
233
 
234
+ @property
235
+ def element(self) -> MeshElementBase:
236
+ """Return the element to which this attribute is assigned.
237
+
238
+ :return: MeshElementBase instance
239
+ :raise AttributeError: If no element is set
240
+ """
241
+ if self._element is None:
242
+ msg = "no element set"
243
+ raise AttributeError(msg)
244
+ return self._element
245
+
222
246
  def copy_to_element(self: Attrib[_T], element: MeshElementBase) -> Attrib[_T]:
223
247
  """Return a new instance with the same value, assigned to a new element.
224
248
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: halfedge
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: A typical half-edge data structure with some padding
5
5
  Author-email: Shay Hill <shay_public@hotmail.com>
6
6
  License: MIT
@@ -272,9 +272,6 @@ class TestElemAttribs:
272
272
  raise NotImplementedError()
273
273
 
274
274
  def _infer_value(self) -> int:
275
- if self.element is None:
276
- msg = "no element from which to infer a value"
277
- raise AttributeError(msg)
278
275
  return self.element.sn
279
276
 
280
277
  elem = MeshElementBase()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes