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
1b57c4d6
Commit
1b57c4d6
authored
Dec 08, 2020
by
Markus Scheidgen
Browse files
Added more datetime formats. Fixed definitions for categories of categories.
parent
d945e002
Pipeline
#89129
passed with stages
in 40 minutes and 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/metainfo/metainfo.py
View file @
1b57c4d6
...
...
@@ -407,7 +407,17 @@ class _Datetime(DataType):
except
ValueError
:
pass
raise
TypeError
(
'Invalid date literal "{0}"'
.
format
(
datetime_str
))
try
:
return
datetime
.
strptime
(
datetime_str
,
'%Y-%m-%d %H:%M:%S.%f'
)
except
ValueError
:
pass
try
:
return
datetime
.
strptime
(
datetime_str
,
'%Y-%m-%d %H:%M:%S'
)
except
ValueError
:
pass
raise
TypeError
(
'Invalid date literal %s'
%
datetime_str
)
def
_convert
(
self
,
value
):
if
value
is
None
:
...
...
@@ -2597,10 +2607,14 @@ class Category(Definition):
definitions
=
set
()
for
definition
in
self
.
definitions
:
if
isinstance
(
definition
,
MCategory
):
definition
=
definition
.
m_def
if
isinstance
(
definition
,
Category
):
definition
.
get_all_definitions
(
definitions
)
if
definition
not
in
definitions
:
definitions
.
add
(
definition
)
if
isinstance
(
definition
,
Category
):
definition
.
get_all_definitions
(
definitions
)
return
definitions
...
...
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