Skip to content

Commit

Permalink
removed unnecessary class methods in Dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkasirer committed Nov 20, 2024
1 parent ecd58a7 commit c86f438
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Removed `ElementType` class.
* Removed `Element.from_id` method.
* Removed `Element.type` property. Use `Element.is_*` properties instead.
* Removed `Dimension.from_element` method. Use `Dimension(element_id)` instead.
* Removed `Dimension.from_id` method. Use `Dimension(element_id)` instead.

## [0.8.0] 2024-11-15

Expand Down
36 changes: 0 additions & 36 deletions src/compas_cadwork/datamodel/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,39 +105,3 @@ def _init_anchors(self):
direction = dc.get_segment_direction(self.id, index)
anchors.append(AnchorPoint(point_to_compas(point), distance, vector_to_compas(direction)))
return tuple(anchors)

@classmethod
def from_id(cls, element_id: int) -> Dimension:
"""Creates a dimension object from an element id.
This is an override of :func:`Element.from_id`.
Parameters
----------
element_id : int
The id of the element to create the dimension from.
Returns
-------
:class:`Dimension`
The dimension object created from the element id.
"""
return cls(id=element_id)

@classmethod
def from_element(cls, element: Element) -> Dimension:
"""Creates a dimension object from an element.
Parameters
----------
element : :class:`Element`
The element to create the dimension from.
Returns
-------
:class:`Dimension`
The dimension object created from the element.
"""
return cls(id=element.id)

0 comments on commit c86f438

Please sign in to comment.