diff --git a/VERSION b/VERSION index 68c123c..51176c7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.10 +0.11 diff --git a/src/lisfloodutilities/compare/__init__.py b/src/lisfloodutilities/compare/__init__.py index 70b6e37..aa855b5 100644 --- a/src/lisfloodutilities/compare/__init__.py +++ b/src/lisfloodutilities/compare/__init__.py @@ -30,7 +30,7 @@ def compare_dirs(self, path_a, path_b, skip_missing=True): logger.info('skipping %s as it is not in %s', fb.name, path_b.as_posix()) continue else: - self.errors += [f'{fb.name} is missing in {path_b.as_posix()}'] + self.errors += ['{} is missing in {}'.format(fb.name, path_b.as_posix())] continue errors = self.compare_files(fa.as_posix(), fb.as_posix()) if errors: @@ -48,7 +48,7 @@ def compare_files(self, file_a, file_b): logger.info('Comparing %s and %s', file_a, file_b) map_a = PCRasterMap(file_a) map_b = PCRasterMap(file_b) - err = [f'{file_a} different from {file_b}'] if map_a != map_b else None + err = ['{} different from {}'.format(file_a, file_b)] if map_a != map_b else None map_a.close() map_b.close() return err @@ -67,7 +67,7 @@ def compare_files(self, file_a, file_b): b1 = fp1.readline() b2 = fp2.readline() if (b1 != b2) or (not b1 and b2) or (not b2 and b1): - err = [f'{file_a} different from {file_b}'] + err = ['{} different from {}'.format(file_a, file_b)] return err if not b1: return None @@ -108,7 +108,7 @@ def compare_arrays(self, vara_step, varb_step, varname=None, step=None, filepath step = step if step is not None else '(no time)' filepath = os.path.basename(filepath) if filepath else '' varname = varname or '' - mess = f'{filepath}/{varname}@{step} - {perc_wrong:3.2f}% of different values - max diff: {max_diff:3.2f}' + mess = '{}/{}@{} - {:3.2f}% of different values - max diff: {:3.2f}'.format(filepath, varname, step, perc_wrong, max_diff) logger.error(mess) return mess @@ -126,7 +126,7 @@ def compare_files(self, file_a, file_b): if len(stepsa) != len(stepsb): len_stepsa = len(stepsa) len_stepsb = len(stepsb) - return f'Files: {file_a} vs {file_b}: different size in time axis A:{len_stepsa} B:{len_stepsb}' + return 'Files: {} vs {}: different size in time axis A:{} B:{}'.format(file_a, file_b, len_stepsa, len_stepsb) for step, _ in enumerate(stepsa): values_a = vara[step][:, :] values_b = varb[step][:, :]