Commit 0a9dfaa2 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed mixed group types.

parent c4aa7bbe
# Copyright 2016-2018 Ioan Vancea, Markus Scheidgen
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -352,7 +352,7 @@ def get_calcs_groups(material_id):
if isinstance(material, tuple):
return material
def pipeline(hash_key, minsize):
def pipeline(hash_key, group_type, minsize):
return [
{"$match": {"material_id": str(material_id)}},
{"$lookup": {
......@@ -382,13 +382,13 @@ def get_calcs_groups(material_id):
"representative_calculation_id": "$minimum.calc_id",
"method_hash": "$_id.method_hash",
"group_eos_hash": "$_id.group_eos_hash",
"group_type": "equation of state",
"group_type": group_type,
"material_hash": material["material_hash"]
}}
]
eos_groups = list(dmss.calc.collection.aggregate(pipeline("group_eos_hash", 4)))
convergence_groups = list(dmss.calc.collection.aggregate(pipeline("group_parametervariation_hash", 2)))
eos_groups = list(dmss.calc.collection.aggregate(pipeline("group_eos_hash", "equation of state", 4)))
convergence_groups = list(dmss.calc.collection.aggregate(pipeline("group_parametervariation_hash", "parameter variation", 2)))
groups = eos_groups + convergence_groups
for group in groups:
group["calculations_list"] = [int(calc) for calc in group["calculations_list"]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment