From 5ce387abf97da80464dc24dd3926ba734657ab2b Mon Sep 17 00:00:00 2001 From: Edward Linscott Date: Fri, 4 Oct 2024 11:17:15 +0200 Subject: [PATCH] Add more detailed debugging message --- src/koopmans/files.py | 2 +- tests/helpers/patches/_check.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/koopmans/files.py b/src/koopmans/files.py index 48bc970e1..6f1f27260 100644 --- a/src/koopmans/files.py +++ b/src/koopmans/files.py @@ -68,7 +68,7 @@ def __eq__(self, other): if not isinstance(other, FilePointer): return False # Note that we don't check self.parent.absolute_directory - return self.parent.directory == other.parent.directory and self.name == other.name + return self.absolute_directory == other.absolute_directory and self.name == other.name def __reduce__(self): # We don't want to store the entire parent object in the database; we only need the directory information diff --git a/tests/helpers/patches/_check.py b/tests/helpers/patches/_check.py index af080600d..8356d88e1 100644 --- a/tests/helpers/patches/_check.py +++ b/tests/helpers/patches/_check.py @@ -348,10 +348,10 @@ def _run(self): utils.warn(f'Inputs differ from the benchmark') for k in self.inputs.model_fields: utils.warn(f'Input {k} differs') - for x in getattr(self.inputs, k): - utils.warn(f'input {k}: {x}') - for x in getattr(bench_process.inputs, k): - utils.warn(f'bench {k}: {x}') + utils.warn('input has ' + ', '.join([x.name for x in getattr(self.inputs, k)])) + utils.warn('bench has ' + ', '.join([x.name for x in getattr(bench_process.inputs, k)])) + for x, y in zip(getattr(self.inputs, k), getattr(bench_process.inputs, k)): + utils.warn(f'input {k}: {x} != {y}') raise ValueError() unpatched_run(self)