docs(objects): update docstring & add example obj

This commit is contained in:
izzy lyseggen
2021-01-18 11:43:19 +00:00
parent 3e7b620e1e
commit 2ca184538d
3 changed files with 28 additions and 2 deletions
+1 -1
View File
@@ -60,4 +60,4 @@ class Account(BaseModel):
return f"Account(email: {self.userInfo.email}, server: {self.serverInfo.url}, isDefault: {self.isDefault})"
def __str__(self) -> str:
return f"Account(email: {self.userInfo.email}, server: {self.serverInfo.url}, isDefault: {self.isDefault})"
return self.__repr__()
+2 -1
View File
@@ -54,7 +54,8 @@ class Resource(ResourceBase):
def create(self, stream_id: str, objects: List[Dict]) -> str:
"""
Create a new object on a stream. To send a base object, you can prepare it by running it through the `BaseObjectSerializer.travers_base` function to get a valid (serialisable) object to send.
Create a new object on a stream. To send a base object, you can prepare it by running it through the
`operations.serialize` function to get a valid (serialisable) object to send.
NOTE: this does not create a commit - you can create one with `SpeckleClient.commit.create`.
+25
View File
@@ -0,0 +1,25 @@
from __future__ import annotations
from typing import List, Optional
from .base import Base
CHUNKABLE_PROPS = {
"vertices": 100,
"faces": 100,
"colors": 100,
"textureCoordinates": 100,
"test_bases": 10,
}
class FakeMesh(Base):
vertices: List[float] = None
faces: List[int] = None
colors: List[int] = None
textureCoordinates: List[float] = None
test_bases: List[Base] = None
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self._chunkable.update(CHUNKABLE_PROPS)