Load the point cloud from a .npz file.
(cls, f: Union[str, BinaryIO])
| 30 | |
| 31 | @classmethod |
| 32 | def load(cls, f: Union[str, BinaryIO]) -> "PointCloud": |
| 33 | """ |
| 34 | Load the point cloud from a .npz file. |
| 35 | """ |
| 36 | if isinstance(f, str): |
| 37 | with open(f, "rb") as reader: |
| 38 | return cls.load(reader) |
| 39 | else: |
| 40 | obj = np.load(f) |
| 41 | keys = list(obj.keys()) |
| 42 | return PointCloud( |
| 43 | coords=obj["coords"], |
| 44 | channels={k: obj[k] for k in keys if k != "coords"}, |
| 45 | ) |
| 46 | |
| 47 | def save(self, f: Union[str, BinaryIO]): |
| 48 | """ |
nothing calls this directly
no test coverage detected