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
nomad-FAIR
Commits
a807f9e2
Commit
a807f9e2
authored
Dec 16, 2021
by
David Sikter
Browse files
Removing UserProvidableMetadata. The ArchiveParser no longer updates any metadata quantities.
parent
9b3bbc0c
Pipeline
#117998
passed with stages
in 40 minutes and 23 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/datamodel/__init__.py
View file @
a807f9e2
...
...
@@ -74,7 +74,7 @@ import sys
from
nomad.metainfo
import
Environment
from
.datamodel
import
(
Dataset
,
User
,
Author
,
EditableUserMetadata
,
UserProvidableMetadata
,
AuthLevel
,
Dataset
,
User
,
Author
,
EditableUserMetadata
,
AuthLevel
,
UploadMetadata
,
MongoUploadMetadata
,
MongoEntryMetadata
,
MongoSystemMetadata
,
EntryMetadata
,
EntryArchive
)
from
.optimade
import
OptimadeEntry
,
Species
...
...
nomad/datamodel/datamodel.py
View file @
a807f9e2
...
...
@@ -290,16 +290,9 @@ class DatasetReference(metainfo.Reference):
dataset_reference
=
DatasetReference
()
class
UserProvidableMetadata
(
metainfo
.
MCategory
):
'''
NOMAD entry metadata quantities that can be edited by the user before publish,
i.e. via metadata files or api/ui.
'''
class
EditableUserMetadata
(
metainfo
.
MCategory
):
''' NOMAD entry metadata quantities that can be edited by the user before or after publish. '''
m_def
=
metainfo
.
Category
(
categories
=
[
UserProvidableMetadata
])
pass
class
MongoUploadMetadata
(
metainfo
.
MCategory
):
...
...
@@ -486,11 +479,10 @@ class EntryMetadata(metainfo.MSection):
The code specific identifier extracted from the entry's raw files by the parser,
if supported.
'''
,
categories
=
[
UserProvidableMetadata
],
a_elasticsearch
=
Elasticsearch
(
entry_type
))
external_id
=
metainfo
.
Quantity
(
type
=
str
,
categories
=
[
MongoEntryMetadata
,
UserProvidableMetadata
,
EditableUserMetadata
],
type
=
str
,
categories
=
[
MongoEntryMetadata
,
EditableUserMetadata
],
description
=
'''
A user provided external id. Usually the id for an entry in an external database
where the data was imported from.
...
...
@@ -570,7 +562,7 @@ class EntryMetadata(metainfo.MSection):
external_db
=
metainfo
.
Quantity
(
type
=
metainfo
.
MEnum
(
'EELSDB'
,
'Materials Project'
,
'AFLOW'
,
'OQMD'
),
categories
=
[
MongoUploadMetadata
,
UserProvidableMetadata
,
EditableUserMetadata
],
categories
=
[
MongoUploadMetadata
,
EditableUserMetadata
],
description
=
'The repository or external database where the original data resides'
,
a_elasticsearch
=
Elasticsearch
(
material_entry_type
))
...
...
@@ -645,7 +637,6 @@ class EntryMetadata(metainfo.MSection):
domain
=
metainfo
.
Quantity
(
type
=
metainfo
.
MEnum
(
'dft'
,
'ems'
),
description
=
'The material science domain'
,
categories
=
[
UserProvidableMetadata
],
a_elasticsearch
=
Elasticsearch
(
material_entry_type
))
n_quantities
=
metainfo
.
Quantity
(
...
...
nomad/parsing/parser.py
View file @
a807f9e2
...
...
@@ -24,7 +24,7 @@ import os.path
from
functools
import
lru_cache
from
nomad
import
config
from
nomad.datamodel
import
EntryArchive
,
UserProvidableMetadata
,
EntryMetadata
from
nomad.datamodel
import
EntryArchive
,
EntryMetadata
class
Parser
(
metaclass
=
ABCMeta
):
...
...
@@ -242,12 +242,7 @@ class ArchiveParser(MatchingParser):
metadata_data
=
archive_data
.
get
(
EntryArchive
.
metadata
.
name
,
None
)
if
metadata_data
is
not
None
:
metadata
=
archive
.
metadata
for
key
,
value
in
metadata_data
.
items
():
if
UserProvidableMetadata
.
m_def
not
in
getattr
(
EntryMetadata
,
key
).
categories
:
continue
metadata
.
m_update_from_dict
({
key
:
value
})
# Setting metadata in this way is not supported (any more)
del
(
archive_data
[
EntryArchive
.
metadata
.
name
])
archive
.
m_update_from_dict
(
archive_data
)
...
...
nomad/processing/base.py
View file @
a807f9e2
...
...
@@ -521,7 +521,6 @@ class Proc(Document):
virtually absolute certainty). Because we may need to reload, an object calling a
sync operations should have no unsaved changes.
'''
blocking_processes
=
all_blocking_processes
[
self
.
__class__
.
__name__
]
try_counter
=
0
while
True
:
if
self
.
queue_blocked
:
...
...
Write
Preview
Supports
Markdown
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