Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning classes #360

Open
wants to merge 16 commits into
base: v3-dev
Choose a base branch
from
6 changes: 6 additions & 0 deletions src/specklepy/core/api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
Stream,
Streams,
)
from specklepy.core.api.models.instances import InstanceDefinitionProxy, InstanceProxy
from specklepy.core.api.models.proxies import ColorProxy, GroupProxy
from specklepy.core.api.models.subscription_messages import (
ProjectModelsUpdatedMessage,
ProjectUpdatedMessage,
Expand Down Expand Up @@ -68,4 +70,8 @@
"Streams",
"Activity",
"ActivityCollection",
"InstanceProxy",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some proxy classes were added, but looks like renderMaterialProxy is missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I see, shall we move it in C# accordingly as well? Right now it's not in Proxies classes list
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently it relies on RenderMaterial which is in Objects, not Core. Both would have to be moved to Core if so

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, noticed it, added it to the same place as in C#

"InstanceDefinitionProxy",
"ColorProxy",
"GroupProxy",
]
28 changes: 28 additions & 0 deletions src/specklepy/core/api/models/instances.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from specklepy.objects.base import Base


class InstanceProxy(
Base,
speckle_type="Speckle.Core.Models.Instances.InstanceProxy",
):
"""
A proxy class for an instance (e.g, a rhino block, or an autocad block reference).
"""

definitionId: str
transform: list[float]
units: str
maxDepth: int


class InstanceDefinitionProxy(
Base,
speckle_type="Speckle.Core.Models.Instances.InstanceDefinitionProxy",
):
"""
A proxy class for an instance definition.
"""

objects: list[str]
maxDepth: int
name: str
27 changes: 27 additions & 0 deletions src/specklepy/core/api/models/proxies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from specklepy.objects.base import Base


class ColorProxy(
Base,
speckle_type="Speckle.Core.Models.Proxies.ColorProxy",
):
"""
Represents a color that is found on objects and collections in a root collection.
"""

objects: list[str]
value: int
name: str | None # nullable but required


class GroupProxy(
Base,
speckle_type="Speckle.Core.Models.Proxies.GroupProxy",
):
"""
Grouped objects with a meaningful way for host application so use this proxy if you want to group object references for any purpose.
i.e. in rhino -> creating group make objects selectable/moveable/editable together.
"""

objects: list[str]
name: str
15 changes: 0 additions & 15 deletions src/specklepy/objects/GIS/CRS.py

This file was deleted.

24 changes: 0 additions & 24 deletions src/specklepy/objects/GIS/__init__.py

This file was deleted.

74 changes: 0 additions & 74 deletions src/specklepy/objects/GIS/geometry.py

This file was deleted.

142 changes: 0 additions & 142 deletions src/specklepy/objects/GIS/layers.py

This file was deleted.

11 changes: 1 addition & 10 deletions src/specklepy/objects/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
"""Builtin Speckle object kit."""

from specklepy.objects import (
GIS,
encoding,
geometry,
other,
primitive,
structural,
units,
)
from specklepy.objects import encoding, geometry, other, primitive, structural, units
from specklepy.objects.base import Base

__all__ = [
Expand All @@ -19,5 +11,4 @@
"units",
"structural",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't structural be removed as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed!

"primitive",
"GIS",
]
5 changes: 3 additions & 2 deletions src/specklepy/objects/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,9 @@ class RevitParameter(Base, speckle_type="Objects.BuiltElements.Revit.Parameter")


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