diff --git a/gprMax/cmds_geometry/add_grass.py b/gprMax/cmds_geometry/add_grass.py index 64d27034..89abfc48 100644 --- a/gprMax/cmds_geometry/add_grass.py +++ b/gprMax/cmds_geometry/add_grass.py @@ -55,9 +55,9 @@ class AddGrass(UserObjectGeometry): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self): + def _do_rotate(self): """Perform rotation.""" pts = np.array([self.kwargs['p1'], self.kwargs['p2']]) rot_pts = rotate_2point_object(pts, self.axis, self.angle, self.origin) @@ -82,8 +82,8 @@ class AddGrass(UserObjectGeometry): except KeyError: seed = None - if self.dorotate: - self.__dorotate() + if self.do_rotate: + self._do_rotate() # Get the correct fractal volume volumes = [volume for volume in grid.fractalvolumes if volume.ID == fractal_box_id] diff --git a/gprMax/cmds_geometry/add_surface_water.py b/gprMax/cmds_geometry/add_surface_water.py index 10bb3a7a..89429867 100644 --- a/gprMax/cmds_geometry/add_surface_water.py +++ b/gprMax/cmds_geometry/add_surface_water.py @@ -51,9 +51,9 @@ class AddSurfaceWater(UserObjectGeometry): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self): + def _do_rotate(self): """Perform rotation.""" pts = np.array([self.kwargs['p1'], self.kwargs['p2']]) rot_pts = rotate_2point_object(pts, self.axis, self.angle, self.origin) @@ -71,8 +71,8 @@ class AddSurfaceWater(UserObjectGeometry): logger.exception(self.__str__() + ' requires exactly eight parameters') raise - if self.dorotate: - self.__dorotate() + if self.do_rotate: + self._do_rotate() # Get the correct fractal volume volumes = [volume for volume in grid.fractalvolumes if volume.ID == fractal_box_id] diff --git a/gprMax/cmds_geometry/cmds_geometry.py b/gprMax/cmds_geometry/cmds_geometry.py index 5330342c..9ddaf268 100644 --- a/gprMax/cmds_geometry/cmds_geometry.py +++ b/gprMax/cmds_geometry/cmds_geometry.py @@ -32,7 +32,7 @@ class UserObjectGeometry: self.kwargs = kwargs self.hash = '#example' self.autotranslate = True - self.dorotate = False + self.do_rotate = False def __str__(self): """Readable string of parameters given to object.""" diff --git a/gprMax/cmds_geometry/edge.py b/gprMax/cmds_geometry/edge.py index f858782c..eddf7626 100644 --- a/gprMax/cmds_geometry/edge.py +++ b/gprMax/cmds_geometry/edge.py @@ -46,9 +46,9 @@ class Edge(UserObjectGeometry): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self): + def _do_rotate(self): """Performs rotation.""" pts = np.array([self.kwargs['p1'], self.kwargs['p2']]) rot_pts = rotate_2point_object(pts, self.axis, self.angle, self.origin) @@ -65,8 +65,8 @@ class Edge(UserObjectGeometry): logger.exception(self.__str__() + ' requires exactly 3 parameters') raise - if self.dorotate: - self.__dorotate() + if self.do_rotate: + self._do_rotate() p3 = uip.round_to_grid_static_point(p1) p4 = uip.round_to_grid_static_point(p2) diff --git a/gprMax/cmds_geometry/fractal_box.py b/gprMax/cmds_geometry/fractal_box.py index 4f1ae5ac..0f80e291 100644 --- a/gprMax/cmds_geometry/fractal_box.py +++ b/gprMax/cmds_geometry/fractal_box.py @@ -59,9 +59,9 @@ class FractalBox(UserObjectGeometry): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self): + def _do_rotate(self): """Performs rotation.""" pts = np.array([self.kwargs['p1'], self.kwargs['p2']]) rot_pts = rotate_2point_object(pts, self.axis, self.angle, self.origin) @@ -86,8 +86,8 @@ class FractalBox(UserObjectGeometry): except KeyError: seed = None - if self.dorotate: - self.__dorotate() + if self.do_rotate: + self._do_rotate() # Check averaging try: diff --git a/gprMax/cmds_geometry/plate.py b/gprMax/cmds_geometry/plate.py index 13555424..7a61b63a 100644 --- a/gprMax/cmds_geometry/plate.py +++ b/gprMax/cmds_geometry/plate.py @@ -47,9 +47,9 @@ class Plate(UserObjectGeometry): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self): + def _do_rotate(self): """Performs rotation.""" pts = np.array([self.kwargs['p1'], self.kwargs['p2']]) rot_pts = rotate_2point_object(pts, self.axis, self.angle, self.origin) @@ -75,8 +75,8 @@ class Plate(UserObjectGeometry): logger.exception(self.__str__() + ' No materials have been specified') raise - if self.dorotate: - self.__dorotate() + if self.do_rotate: + self._do_rotate() p3 = uip.round_to_grid_static_point(p1) p4 = uip.round_to_grid_static_point(p2) diff --git a/gprMax/cmds_geometry/triangle.py b/gprMax/cmds_geometry/triangle.py index f72e80f3..b94e0fd9 100644 --- a/gprMax/cmds_geometry/triangle.py +++ b/gprMax/cmds_geometry/triangle.py @@ -52,9 +52,9 @@ class Triangle(UserObjectGeometry): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self): + def _do_rotate(self): """Performs rotation.""" p1 = rotate_point(self.kwargs['p1'], self.axis, self.angle, self.origin) p2 = rotate_point(self.kwargs['p2'], self.axis, self.angle, self.origin) @@ -73,8 +73,8 @@ class Triangle(UserObjectGeometry): logger.exception(self.__str__() + ' specify 3 points and a thickness') raise - if self.dorotate: - self.__dorotate() + if self.do_rotate: + self._do_rotate() # Check averaging try: diff --git a/gprMax/cmds_multiuse.py b/gprMax/cmds_multiuse.py index 5b7a6f94..3805e7f4 100644 --- a/gprMax/cmds_multiuse.py +++ b/gprMax/cmds_multiuse.py @@ -53,7 +53,7 @@ class UserObjectMulti: self.order = None self.hash = '#example' self.autotranslate = True - self.dorotate = False + self.do_rotate = False def __str__(self): """Readable user string as per hash commands.""" @@ -209,9 +209,9 @@ class VoltageSource(UserObjectMulti): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self, grid): + def _do_rotate(self, grid): """Performs rotation.""" rot_pol_pts, self.kwargs['polarisation'] = rotate_polarisation(self.kwargs['p1'], self.kwargs['polarisation'], @@ -233,8 +233,8 @@ class VoltageSource(UserObjectMulti): 'parameters.')) raise - if self.dorotate: - self.__dorotate(grid) + if self.do_rotate: + self._do_rotate(grid) # Check polarity & position parameters if polarisation not in ('x', 'y', 'z'): @@ -347,9 +347,9 @@ class HertzianDipole(UserObjectMulti): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self, grid): + def _do_rotate(self, grid): """Performs rotation.""" rot_pol_pts, self.kwargs['polarisation'] = rotate_polarisation(self.kwargs['p1'], self.kwargs['polarisation'], @@ -369,8 +369,8 @@ class HertzianDipole(UserObjectMulti): 'parameters.') raise - if self.dorotate: - self.__dorotate(grid) + if self.do_rotate: + self._do_rotate(grid) # Check polarity & position parameters if polarisation not in ('x', 'y', 'z'): @@ -494,9 +494,9 @@ class MagneticDipole(UserObjectMulti): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self, grid): + def _do_rotate(self, grid): """Performs rotation.""" rot_pol_pts, self.kwargs['polarisation'] = rotate_polarisation(self.kwargs['p1'], self.kwargs['polarisation'], @@ -516,8 +516,8 @@ class MagneticDipole(UserObjectMulti): 'parameters.') raise - if self.dorotate: - self.__dorotate(grid) + if self.do_rotate: + self._do_rotate(grid) # Check polarity & position parameters if polarisation not in ('x', 'y', 'z'): @@ -626,9 +626,9 @@ class TransmissionLine(UserObjectMulti): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self, grid): + def _do_rotate(self, grid): """Performs rotation.""" rot_pol_pts, self.kwargs['polarisation'] = rotate_polarisation(self.kwargs['p1'], self.kwargs['polarisation'], @@ -649,8 +649,8 @@ class TransmissionLine(UserObjectMulti): 'parameters.') raise - if self.dorotate: - self.__dorotate(grid) + if self.do_rotate: + self._do_rotate(grid) # Warn about using a transmission line on GPU if (config.sim_config.general['solver'] == 'cuda' or @@ -773,9 +773,9 @@ class Rx(UserObjectMulti): self.axis = axis self.angle = angle self.origin = origin - self.dorotate = True + self.do_rotate = True - def __dorotate(self, G): + def _do_rotate(self, G): """Performs rotation.""" new_pt = (self.kwargs['p1'][0] + G.dx, self.kwargs['p1'][1] + G.dy, self.kwargs['p1'][2] + G.dz) @@ -800,8 +800,8 @@ class Rx(UserObjectMulti): logger.exception(self.params_str()) raise - if self.dorotate: - self.__dorotate(grid) + if self.do_rotate: + self._do_rotate(grid) p = uip.check_src_rx_point(p1, self.params_str()) p2 = uip.round_to_grid_static_point(p1)