Skip to content

Commit

Permalink
fix(Python): Use field for PolyData default points
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Feb 10, 2023
1 parent cc035f8 commit 74fb1aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/python/itkwasm/itkwasm/polydata.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ class PolyDataType:
cellPixelType: PixelTypes = PixelTypes.Scalar
cellPixelComponents: int = 1

def _default_points() -> ArrayLike:
return np.empty((0,), np.float32)

@dataclass
class PolyData:
polyDataType: Union[PolyDataType, Dict] = field(default_factory=PolyDataType)
name: str = 'polydata'

numberOfPoints: int = 0
points: ArrayLike = np.empty((0,), np.float32)
points: ArrayLike = field(default_factory=_default_points)

verticesBufferSize: int = 0
vertices: Optional[ArrayLike] = None
Expand Down

0 comments on commit 74fb1aa

Please sign in to comment.