fix problem with casting None to int

这个提交包含在:
Sylwia Majchrowska
2021-07-31 18:21:50 +02:00
父节点 5927840bb4
当前提交 51abd1397c
共有 2 个文件被更改,包括 9 次插入3 次删除

查看文件

@@ -179,7 +179,10 @@ class AddSurfaceRoughness(UserObjectGeometry):
surface.surfaceID = requestedsurface
surface.fractalrange = fractalrange
surface.operatingonID = volume.ID
surface.seed = int(seed)
if seed is not None:
surface.seed = int(seed)
else:
surface.seed = seed
surface.weighting = weighting
# List of existing surfaces IDs

查看文件

@@ -66,7 +66,7 @@ class FractalBox(UserObjectGeometry):
rot_pts = rotate_2point_object(pts, self.axis, self.angle, self.origin)
self.kwargs['p1'] = tuple(rot_pts[0, :])
self.kwargs['p2'] = tuple(rot_pts[1, :])
def create(self, grid, uip):
try:
p1 = self.kwargs['p1']
@@ -140,7 +140,10 @@ class FractalBox(UserObjectGeometry):
volume.ID = ID
volume.operatingonID = mixing_model_id
volume.nbins = nbins
volume.seed = int(seed)
if seed is not None:
volume.seed = int(seed)
else:
volume.seed = seed
volume.weighting = weighting
volume.averaging = averagefractalbox
volume.mixingmodel = mixingmodel