diff --git a/gprMax/subgrids/precursor_nodes.py b/gprMax/subgrids/precursor_nodes.py index ab679638..718310c9 100644 --- a/gprMax/subgrids/precursor_nodes.py +++ b/gprMax/subgrids/precursor_nodes.py @@ -218,9 +218,9 @@ class PrecursorNodesBase: def update_previous_timestep_fields(self, field_names): for fn in field_names: - val = getattr(self, fn + '_1') + val = getattr(self, f'{fn}_1') val_c = np.copy(val) - setattr(self, fn + '_0', val_c) + setattr(self, f'{fn}_0', val_c) def interpolate_to_sub_grid(self, field, coords): x, z, x_sg, z_sg = coords diff --git a/gprMax/subgrids/updates.py b/gprMax/subgrids/updates.py index 07b1a9c5..b38e3cc3 100644 --- a/gprMax/subgrids/updates.py +++ b/gprMax/subgrids/updates.py @@ -36,7 +36,7 @@ def create_updates(G): elif sg_type == SubGridHSG and not sg.filter: precursors = PrecursorNodes(G, sg) else: - logger.exception(str(sg) + ' is not a subgrid type') + logger.exception(f'{str(sg)} is not a subgrid type') raise ValueError sgu = SubgridUpdater(sg, precursors, G) diff --git a/gprMax/subgrids/user_objects.py b/gprMax/subgrids/user_objects.py index 1136ea01..586b20b1 100644 --- a/gprMax/subgrids/user_objects.py +++ b/gprMax/subgrids/user_objects.py @@ -45,7 +45,7 @@ class SubGridBase(UserObjectMulti): elif isinstance(node, UserObjectGeometry): self.children_geometry.append(node) else: - logger.exception(str(node) + ' this Object can not be added to a sub grid') + logger.exception(f'{str(node)} this Object can not be added to a sub grid') raise ValueError def set_discretisation(self, sg, grid): @@ -123,12 +123,16 @@ class SubGridBase(UserObjectMulti): self.subgrid = sg # Copy over built in materials - sg.materials = [copy(m) for m in grid.materials if m.numID in range(0, grid.n_built_in_materials + 1)] + sg.materials = [ + copy(m) + for m in grid.materials + if m.numID in range(grid.n_built_in_materials + 1) + ] # Don't mix and match different subgrid types for sg_made in grid.subgrids: if type(sg) != type(sg_made): - logger.exception(self.__str__() + ' please only use one type of subgrid') + logger.exception(f'{self.__str__()} please only use one type of subgrid') raise ValueError # Reference the subgrid under the main grid to which it belongs