Added logging and f-strings.

这个提交包含在:
Craig Warren
2019-10-11 11:57:43 +01:00
父节点 505605fd0f
当前提交 7b1fc6decf
共有 14 个文件被更改,包括 113 次插入93 次删除

查看文件

@@ -24,9 +24,9 @@ from ..exceptions import CmdInputError
from ..materials import Material
from ..utilities import round_value
log = logging.getLogger(__name__)
class AddSurfaceWater(UserObjectGeometry):
"""Allows you to add surface water to a :class:`gprMax.cmds_geometry.fractal_box.FractalBox` in the model.
@@ -41,7 +41,6 @@ class AddSurfaceWater(UserObjectGeometry):
"""
def __init__(self, **kwargs):
"""Constructor."""
super().__init__(**kwargs)
self.order = 11
self.hash = '#add_surface_water'
@@ -144,5 +143,7 @@ class AddSurfaceWater(UserObjectGeometry):
if testwater:
raise CmdInputError(self.__str__() + ' requires the time step for the model to be less than the relaxation time required to model water.')
if config.is_messages():
log.info('Water on surface from {xs * grid.dx:g}m, {ys * grid.dy:g}m, {zs * grid.dz:g}m, to {xf * grid.dx:g}m, {yf * grid.dy:g}m, {zf * grid.dz:g}m with depth {filldepth:g}m, added to {surface.operatingonID}.')
log.info(f'Water on surface from {xs * grid.dx:g}m, {ys * grid.dy:g}m, \
{zs * grid.dz:g}m, to {xf * grid.dx:g}m, {yf * grid.dy:g}m, \
{zf * grid.dz:g}m with depth {filldepth:g}m, added to \
{surface.operatingonID}.')