halfedge 0.11.0__tar.gz → 0.12.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: halfedge
3
- Version: 0.11.0
3
+ Version: 0.12.0
4
4
  Summary: A typical half-edge data structure with some padding
5
5
  Author: Shay Hill
6
6
  Author-email: Shay Hill <shay_public@hotmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "halfedge"
3
- version = "0.11.0"
3
+ version = "0.12.0"
4
4
  description = "A typical half-edge data structure with some padding"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -27,7 +27,7 @@ dev = [
27
27
 
28
28
  [tool.commitizen]
29
29
  kame = "cz_conventional_commits"
30
- version = "0.11.0"
30
+ version = "0.12.0"
31
31
  tag_format = "$version"
32
32
  major-version-zero = true
33
33
  version_files = ["pyproject.toml:^version"]
@@ -79,7 +79,7 @@ class StaticAttrib(Generic[_T]):
79
79
  merged or split.
80
80
  """
81
81
 
82
- __slots__ = ("_mesh", "_value")
82
+ __slots__ = ("_mesh", "cached_value")
83
83
 
84
84
  def __new__(
85
85
  cls,
@@ -98,7 +98,7 @@ class StaticAttrib(Generic[_T]):
98
98
  self, value: _T | None = None, mesh: BlindHalfEdges | None = None
99
99
  ) -> None:
100
100
  """Set value and mesh."""
101
- self._value = value
101
+ self.cached_value = value
102
102
  self._mesh = mesh
103
103
 
104
104
  def copy_to_element(
@@ -109,7 +109,7 @@ class StaticAttrib(Generic[_T]):
109
109
  :param mesh: BlindHalfEdges instance to which attrib will be assigned.
110
110
  :return: Attrib instance
111
111
  """
112
- return type(self)(self._value, mesh)
112
+ return type(self)(self.cached_value, mesh)
113
113
 
114
114
  @property
115
115
  def value(self) -> _T:
@@ -118,12 +118,12 @@ class StaticAttrib(Generic[_T]):
118
118
  :return: Value of the attribute
119
119
  :raises AttributeError: If no value is set and _infer_value fails
120
120
  """
121
- if self._value is not None:
122
- return self._value
121
+ if self.cached_value is not None:
122
+ return self.cached_value
123
123
  with suppress(NotImplementedError, ValueError):
124
124
  value = self._infer_value()
125
- self._value = value
126
- return self._value
125
+ self.cached_value = value
126
+ return self.cached_value
127
127
  msg = "no value set and failed to infer from 'self.mesh'"
128
128
  raise AttributeError(msg)
129
129
 
@@ -188,7 +188,7 @@ class Attrib(Generic[_T]):
188
188
  and `_infer_value` to customize behavior while inheriting all other functionality.
189
189
  """
190
190
 
191
- __slots__ = ("_element", "_value")
191
+ __slots__ = ("_element", "cached_value")
192
192
 
193
193
  def __new__(
194
194
  cls,
@@ -207,7 +207,7 @@ class Attrib(Generic[_T]):
207
207
  self, value: _T | None = None, element: MeshElementBase | None = None
208
208
  ) -> None:
209
209
  """Set value and element."""
210
- self._value = value
210
+ self.cached_value = value
211
211
  self._element = element
212
212
 
213
213
  @property
@@ -217,12 +217,12 @@ class Attrib(Generic[_T]):
217
217
  :return: Value of the attribute
218
218
  :raises AttributeError: If no value is set and _infer_value fails
219
219
  """
220
- if self._value is not None:
221
- return self._value
220
+ if self.cached_value is not None:
221
+ return self.cached_value
222
222
  with suppress(NotImplementedError, ValueError):
223
223
  value = self._infer_value()
224
- self._value = value
225
- return self._value
224
+ self.cached_value = value
225
+ return self.cached_value
226
226
  msg = "no value set and failed to infer from 'self.element'"
227
227
  raise AttributeError(msg)
228
228
 
@@ -244,7 +244,7 @@ class Attrib(Generic[_T]):
244
244
  :param element: New element
245
245
  :return: Attrib instance
246
246
  """
247
- return type(self)(self._value, element)
247
+ return type(self)(self.cached_value, element)
248
248
 
249
249
  @classmethod
250
250
  def merge(cls, *merge_from: _TAttrib | None) -> _TAttrib | None:
File without changes