Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-FAIR
Commits
3ce1eaaf
Commit
3ce1eaaf
authored
4 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
JSON encode MSection values for nomad specific optimade properties.
#450
parent
55424fde
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!233
v0.9.8 - Merge for release
,
!232
Optimade fixes #450
Pipeline
#89633
passed with warnings
4 years ago
Stage: build
Stage: test
Stage: deploy
Stage: release
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
nomad/app/optimade/models.py
+8
-3
8 additions, 3 deletions
nomad/app/optimade/models.py
with
8 additions
and
3 deletions
nomad/app/optimade/models.py
+
8
−
3
View file @
3ce1eaaf
...
@@ -30,7 +30,7 @@ import numpy as np
...
@@ -30,7 +30,7 @@ import numpy as np
from
nomad
import
config
,
datamodel
,
files
from
nomad
import
config
,
datamodel
,
files
from
nomad.app.common
import
RFC3339DateTime
from
nomad.app.common
import
RFC3339DateTime
from
nomad.normalizing.optimade
import
optimade_chemical_formula_reduced
from
nomad.normalizing.optimade
import
optimade_chemical_formula_reduced
from
nomad.metainfo
import
Datetime
,
MEnum
from
nomad.metainfo
import
Datetime
,
MEnum
,
MSection
from
nomad.datamodel
import
EntryMetadata
from
nomad.datamodel
import
EntryMetadata
from
nomad.datamodel.dft
import
DFTMetadata
from
nomad.datamodel.dft
import
DFTMetadata
from
nomad.datamodel.optimade
import
OptimadeEntry
from
nomad.datamodel.optimade
import
OptimadeEntry
...
@@ -320,9 +320,14 @@ class EntryDataObject:
...
@@ -320,9 +320,14 @@ class EntryDataObject:
try
:
try
:
if
request_field
.
startswith
(
'
_nmd_dft_
'
):
if
request_field
.
startswith
(
'
_nmd_dft_
'
):
attrs
[
request_field
]
=
getattr
(
calc
.
dft
,
request_field
[
9
:])
response_value
=
getattr
(
calc
.
dft
,
request_field
[
9
:])
else
:
else
:
attrs
[
request_field
]
=
getattr
(
calc
,
request_field
[
5
:])
response_value
=
getattr
(
calc
,
request_field
[
5
:])
if
isinstance
(
response_value
,
MSection
):
response_value
=
response_value
.
m_to_dict
()
attrs
[
request_field
]
=
response_value
except
AttributeError
:
except
AttributeError
:
# if unknown properties where provided, we will ignore them
# if unknown properties where provided, we will ignore them
pass
pass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment