你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-04 11:36:52 +08:00
Make add data functions private in VtkHdfFile class
- Adding cell and point data is very dependent on the type of the VTKHDF file. Therefore these should be private in the base class so an instance of the VtkHdfFile class can only add field data.
这个提交包含在:
@@ -177,7 +177,7 @@ class VtkImageData(VtkHdfFile):
|
||||
"If no offset is specified, data.shape must be one larger in each dimension than"
|
||||
f" this vtkImageData object. {data.shape} != {points_shape}"
|
||||
)
|
||||
return super().add_point_data(name, data, points_shape, offset)
|
||||
return super()._add_point_data(name, data, points_shape, offset)
|
||||
|
||||
def add_cell_data(
|
||||
self, name: str, data: npt.NDArray, offset: Optional[npt.NDArray[np.int32]] = None
|
||||
@@ -198,4 +198,4 @@ class VtkImageData(VtkHdfFile):
|
||||
"If no offset is specified, data.shape must match the dimensions of this"
|
||||
f" VtkImageData object. {data.shape} != {self.shape}"
|
||||
)
|
||||
return super().add_cell_data(name, data, self.shape, offset)
|
||||
return super()._add_cell_data(name, data, self.shape, offset)
|
||||
|
@@ -252,7 +252,7 @@ class VtkUnstructuredGrid(VtkHdfFile):
|
||||
|
||||
shape[0] = self.global_number_of_points
|
||||
|
||||
return super().add_point_data(name, data, shape, self.points_offset)
|
||||
return super()._add_point_data(name, data, shape, self.points_offset)
|
||||
|
||||
def add_cell_data(self, name: str, data: npt.NDArray):
|
||||
"""Add cell data to the VTKHDF file.
|
||||
@@ -280,4 +280,4 @@ class VtkUnstructuredGrid(VtkHdfFile):
|
||||
|
||||
shape[0] = self.global_number_of_cells
|
||||
|
||||
return super().add_cell_data(name, data, shape, self.cells_offset)
|
||||
return super()._add_cell_data(name, data, shape, self.cells_offset)
|
||||
|
@@ -482,7 +482,7 @@ class VtkHdfFile(AbstractContextManager):
|
||||
|
||||
self.file_handler.create_dataset(path, shape=shape, dtype=dtype)
|
||||
|
||||
def add_point_data(
|
||||
def _add_point_data(
|
||||
self,
|
||||
name: str,
|
||||
data: npt.NDArray,
|
||||
@@ -502,7 +502,7 @@ class VtkHdfFile(AbstractContextManager):
|
||||
dataset_path = self._build_dataset_path("PointData", name)
|
||||
self._write_dataset(dataset_path, data, shape=shape, offset=offset)
|
||||
|
||||
def add_cell_data(
|
||||
def _add_cell_data(
|
||||
self,
|
||||
name: str,
|
||||
data: npt.NDArray,
|
||||
|
在新工单中引用
屏蔽一个用户