From b22f0ca13859c0c0a552e451f10c4bb09cf46b3a Mon Sep 17 00:00:00 2001
From: Martin Kuban <kuban@physik.hu-berlin.de>
Date: Tue, 18 Aug 2020 13:55:49 +0200
Subject: [PATCH] Added equal function for fingerprints

---
 nomad_dos_fingerprints/DOSfingerprint.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/nomad_dos_fingerprints/DOSfingerprint.py b/nomad_dos_fingerprints/DOSfingerprint.py
index 77e59b0..b102711 100644
--- a/nomad_dos_fingerprints/DOSfingerprint.py
+++ b/nomad_dos_fingerprints/DOSfingerprint.py
@@ -47,6 +47,9 @@ class DOSFingerprint():
     def get_similarities(self, list_of_fingerprints):
         return np.array([self.similarity_function(self, fp) for fp in list_of_fingerprints])
 
+    def __eq__(self, other):
+        return self.bins == other.bins and self.indices == other.indices and self.stepsize == other.stepsize and self.grid_id == other.grid_id and self.filling_factor == other.filling_factor
+
     def _integrate_to_bins(self, xs, ys):
         """
         Performs stepwise numerical integration of ``ys`` over the range of ``xs``. The stepsize of the generated histogram is controlled by DOSFingerprint().stepsize.
-- 
GitLab