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
476d5beb
Commit
476d5beb
authored
Apr 01, 2019
by
Markus Scheidgen
Browse files
Added git hash to processing metadata of calculations.
#135
parent
35351df9
Pipeline
#46209
failed with stages
in 15 minutes and 49 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gitinfo.sh
View file @
476d5beb
#!/bin/sh
echo
log, ref, version
=
\'
$(
git log
-1
--oneline
)
\'
,
\'
$(
git describe
--all
)
\'
,
\'
$(
git describe
)
\'
>
nomad/gitinfo.py
\ No newline at end of file
echo
log, ref, version, commit
=
\'
$(
git log
-1
--oneline
)
\'
,
\'
$(
git describe
--all
)
\'
,
\'
$(
git describe
)
\'
,
\'
$(
git rev-parse
--verify
HEAD
)
\'
>
nomad/gitinfo.py
\ No newline at end of file
nomad/config.py
View file @
476d5beb
...
...
@@ -21,6 +21,8 @@ import warnings
warnings
.
filterwarnings
(
"ignore"
,
message
=
"numpy.dtype size changed"
)
warnings
.
filterwarnings
(
"ignore"
,
message
=
"numpy.ufunc size changed"
)
from
nomad
import
gitinfo
class
NomadConfig
(
dict
):
"""
...
...
@@ -164,6 +166,7 @@ client = NomadConfig(
)
version
=
'0.4.4'
commit
=
gitinfo
.
commit
release
=
'devel'
domain
=
'DFT'
service
=
'unknown nomad service'
...
...
nomad/datamodel/base.py
View file @
476d5beb
...
...
@@ -89,6 +89,7 @@ class CalcWithMetadata():
self
.
processed
:
bool
=
False
self
.
last_processing
:
datetime
.
datetime
=
None
self
.
nomad_version
:
str
=
None
self
.
nomad_commit
:
str
=
None
# user metadata, i.e. quantities given and editable by the user
self
.
with_embargo
:
bool
=
None
...
...
nomad/processing/data.py
View file @
476d5beb
...
...
@@ -155,6 +155,7 @@ class Calc(Proc):
calc_with_metadata
.
published
=
False
calc_with_metadata
.
uploader
=
self
.
upload
.
uploader
.
to_popo
()
calc_with_metadata
.
nomad_version
=
config
.
version
calc_with_metadata
.
nomad_commit
=
config
.
commit
calc_with_metadata
.
last_processing
=
datetime
.
now
()
calc_with_metadata
.
files
=
self
.
upload_files
.
calc_files
(
self
.
mainfile
)
self
.
metadata
=
calc_with_metadata
.
to_dict
()
...
...
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