Skip to content

Commit

Permalink
Collections namespace, clean PolygonGeometry class (#351)
Browse files Browse the repository at this point in the history
* collections namespace change

* add all C# GIS classes, deprecate the rest

* deprecate GisPolygonGeometry properly

* typo

* add constructors

* add multipatch geometry and units

* reverse new classes

* typos

* formatting

* formatting

* optional collection name

* init fix

* pass applicationId if needed

* remove init - causing all classes inheriting also implement it

* remove init
  • Loading branch information
KatKatKateryna authored Nov 5, 2024
1 parent 10f7499 commit 82d39e6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/specklepy/objects/GIS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
GisPolygonElement,
GisPolygonGeometry,
GisRasterElement,
PolygonGeometry,
)
from specklepy.objects.GIS.layers import RasterLayer, VectorLayer

__all__ = [
"VectorLayer",
"RasterLayer",
"GisPolygonGeometry",
"PolygonGeometry",
"GisPolygonElement",
"GisLineElement",
"GisPointElement",
Expand Down
12 changes: 6 additions & 6 deletions src/specklepy/objects/GIS/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
)


class GisPolygonGeometry(
Base, speckle_type="Objects.GIS.PolygonGeometry", detachable={"displayValue"}
):
class PolygonGeometry(Base, speckle_type="Objects.GIS.PolygonGeometry"):
"""GIS Polygon Geometry"""

boundary: Optional[Union[Polyline, Arc, Line, Circle, Polycurve]] = None
voids: Optional[List[Union[Polyline, Arc, Line, Circle, Polycurve]]] = None
displayValue: Optional[List[Mesh]] = None
boundary: Optional[Polyline]
voids: Optional[List[Polyline]]


GisPolygonGeometry = PolygonGeometry


class GisPolygonElement(Base, speckle_type="Objects.GIS.PolygonElement"):
Expand Down
10 changes: 10 additions & 0 deletions src/specklepy/objects/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,19 @@ class RevitParameter(Base, speckle_type="Objects.BuiltElements.Revit.Parameter")
isTypeParameter: bool = False


@deprecated(version="2.20", reason="Namespace changed, collectionType deprecated")
class Collection(
Base, speckle_type="Speckle.Core.Models.Collection", detachable={"elements"}
):
name: Optional[str] = None
collectionType: Optional[str] = None
elements: Optional[List[Base]] = None


class Collection( # noqa: F811
Base,
speckle_type="Speckle.Core.Models.Collections.Collection",
detachable={"elements"},
):
name: Optional[str] = None
elements: Optional[List[Base]]

0 comments on commit 82d39e6

Please sign in to comment.