From 8ccd6677726a13c4077c67b7456ac723303dd460 Mon Sep 17 00:00:00 2001
From: Lauri Himanen <lauri.himanen@gmail.com>
Date: Wed, 19 Feb 2020 21:33:28 +0200
Subject: [PATCH] Modified calculation grouping to be based on the group hash
 only, as the method hash now exactly identifies the method and cannot be used
 to identify e.g. parameter variations.

---
 rest-api-service/app/api_v1_0/routes.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/rest-api-service/app/api_v1_0/routes.py b/rest-api-service/app/api_v1_0/routes.py
index b142f5c..9ab1d9f 100644
--- a/rest-api-service/app/api_v1_0/routes.py
+++ b/rest-api-service/app/api_v1_0/routes.py
@@ -374,8 +374,7 @@ def get_calcs_groups(material_id):
             {"$sort": {"energy.e_val": 1}},
             {"$group": {
                 "_id": {
-                    "method_hash": "$method_hash",
-                    "group_eos_hash": "$%s" % hash_key
+                    "group_hash": "$%s" % hash_key
                 },
                 "calculations_list": {"$push": "$_id"},
                 "minimum": {"$first": {"energy": "$energy.e_val", "calc_id": "$_id"}}
@@ -388,8 +387,7 @@ def get_calcs_groups(material_id):
                 "calculations_list": True,
                 "energy_minimum": "$minimum.energy",
                 "representative_calculation_id": "$minimum.calc_id",
-                "method_hash": "$_id.method_hash",
-                "group_eos_hash": "$_id.group_eos_hash",
+                "group_hash": "$_id.group_hash",
                 "group_type": group_type,
                 "material_hash": material["material_hash"]
             }}
-- 
GitLab