Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
encyclopedia-physics-engine
Commits
0a9dfaa2
Commit
0a9dfaa2
authored
Apr 30, 2019
by
Markus Scheidgen
Browse files
Fixed mixed group types.
parent
c4aa7bbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
rest-api-service/app/api_v1_0/routes.py
View file @
0a9dfaa2
# 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"
]]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment