diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1448800..db1e2db0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,8 +7,9 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files -- repo: https://github.com/psf/black - rev: 23.7.0 + - id: check-toml +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 23.9.1 hooks: - id: black args: ["--line-length", "120"] # Adjust the max line length value as needed. diff --git a/examples/antenna_like_GSSI_1500_fs.in b/examples/antenna_like_GSSI_1500_fs.in index ff6cdbb9..e880dbdd 100644 --- a/examples/antenna_like_GSSI_1500_fs.in +++ b/examples/antenna_like_GSSI_1500_fs.in @@ -8,4 +8,4 @@ from toolboxes.GPRAntennaModels.GSSI import antenna_like_GSSI_1500 gssi_objects = antenna_like_GSSI_1500(0.125, 0.094, 0.100, resolution=0.001) for obj in gssi_objects: print(obj.__str__()) -#end_python: \ No newline at end of file +#end_python: diff --git a/gprMax/cmds_multiuse.py b/gprMax/cmds_multiuse.py index 7b56dcb6..20cebdc1 100644 --- a/gprMax/cmds_multiuse.py +++ b/gprMax/cmds_multiuse.py @@ -171,8 +171,8 @@ class ExcitationFile(UserObjectMulti): # Interpolate waveform values w.userfunc = interpolate.interp1d(waveformtime, singlewaveformvalues, **kwargs) - logger.info(self.grid_name(grid) + - f"User waveform {w.ID} created using {timestr} and, if " + logger.info( + self.grid_name(grid) + f"User waveform {w.ID} created using {timestr} and, if " f"required, interpolation parameters (kind: {kwargs['kind']}, " f"fill value: {kwargs['fill_value']})." ) @@ -837,9 +837,7 @@ class Rx(UserObjectMulti): def _do_rotate(self, grid): """Performs rotation.""" - new_pt = (self.kwargs["p1"][0] + grid.dx, - self.kwargs["p1"][1] + grid.dy, - self.kwargs["p1"][2] + grid.dz) + new_pt = (self.kwargs["p1"][0] + grid.dx, self.kwargs["p1"][1] + grid.dy, self.kwargs["p1"][2] + grid.dz) pts = np.array([self.kwargs["p1"], new_pt]) rot_pts = rotate_2point_object(pts, self.axis, self.angle, self.origin) self.kwargs["p1"] = tuple(rot_pts[0, :]) diff --git a/gprMax/fields_outputs.py b/gprMax/fields_outputs.py index 15053a90..24b0b6fa 100644 --- a/gprMax/fields_outputs.py +++ b/gprMax/fields_outputs.py @@ -69,7 +69,8 @@ def write_hdf5_outputfile(outputfile, G): # Write meta data and data for any subgrids sg_rxs = [True for sg in G.subgrids if sg.rxs] - if sg_rxs: + sg_tls = [True for sg in G.subgrids if sg.transmissionlines] + if sg_rxs or sg_tls: for sg in G.subgrids: grp = f.create_group(f"/subgrids/{sg.name}") write_hd5_data(grp, sg, is_subgrid=True) diff --git a/gprMax/model_build_run.py b/gprMax/model_build_run.py index 2dfd1426..4ca40867 100644 --- a/gprMax/model_build_run.py +++ b/gprMax/model_build_run.py @@ -276,7 +276,8 @@ class ModelBuildRun: # Write output data to file if they are any receivers in any grids sg_rxs = [True for sg in self.G.subgrids if sg.rxs] - if self.G.rxs or sg_rxs: + sg_tls = [True for sg in self.G.subgrids if sg.transmissionlines] + if self.G.rxs or sg_rxs or self.G.transmissionlines or sg_tls: write_hdf5_outputfile(config.get_model_config().output_file_path_ext, self.G) # Write any snapshots to file for each grid diff --git a/gprMax/pml.py b/gprMax/pml.py index 6c6654e8..38032728 100644 --- a/gprMax/pml.py +++ b/gprMax/pml.py @@ -231,14 +231,13 @@ class PML: self.initialise_field_arrays() def check_kappamin(self): - """Checks that the sum of all kappamin values, i.e. when a multi-pole - PML is used, is not less than one. + """Checks that the sum of all kappamin values, i.e. when a multi-pole + PML is used, is not less than one. """ kappamin = sum(cfs.kappa.min for cfs in self.CFS) if kappamin < 1: - logger.exception(f"Sum of kappamin value(s) for PML is {kappamin} " - "and must be greater than one.") + logger.exception(f"Sum of kappamin value(s) for PML is {kappamin} " "and must be greater than one.") raise ValueError def initialise_field_arrays(self):