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
42f21688
Commit
42f21688
authored
Jul 16, 2020
by
Markus Scheidgen
Browse files
Fix lazy cli importing after parsers refactor.
parent
6b80b7e6
Pipeline
#78749
passed with stages
in 25 minutes and 33 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/cli/__init__.py
View file @
42f21688
...
...
@@ -36,6 +36,7 @@ lazy_import.lazy_module('nomad.config')
lazy_import
.
lazy_module
(
'nomad.infrastructure'
)
lazy_import
.
lazy_module
(
'nomad.utils'
)
lazy_import
.
lazy_module
(
'nomad.parsing'
)
lazy_import
.
lazy_module
(
'nomad.parsing.parsers'
)
lazy_import
.
lazy_module
(
'nomad.normalizing'
)
lazy_import
.
lazy_module
(
'nomad.datamodel'
)
lazy_import
.
lazy_module
(
'nomad.search'
)
...
...
@@ -46,5 +47,5 @@ lazy_import.lazy_module('nomad.client')
lazy_import
.
lazy_module
(
'nomadcore'
)
lazy_import
.
lazy_module
(
'nomadcore.simple_parser'
)
from
.
import
dev
,
parse
,
admin
,
client
# noqa
from
.
import
dev
,
admin
,
parse
,
client
# noqa
from
.cli
import
run_cli
,
cli
# noqa
nomad/cli/client/__init__.py
View file @
42f21688
...
...
@@ -45,6 +45,7 @@ lazy_import.lazy_module('nomad.files')
lazy_import
.
lazy_module
(
'nomad.search'
)
lazy_import
.
lazy_module
(
'nomad.datamodel'
)
lazy_import
.
lazy_module
(
'nomad.parsing'
)
lazy_import
.
lazy_module
(
'nomad.parsing.parsers'
)
lazy_import
.
lazy_module
(
'nomad.infrastructure'
)
lazy_import
.
lazy_module
(
'nomad.doi'
)
lazy_import
.
lazy_module
(
'nomad.client'
)
...
...
nomad/cli/parse.py
View file @
42f21688
...
...
@@ -5,7 +5,6 @@ import click
import
sys
from
nomad
import
utils
,
parsing
,
normalizing
,
datamodel
from
nomad.parsing.parsers
import
parser_dict
,
match_parser
import
nomadcore
...
...
@@ -21,15 +20,16 @@ def parse(
Run the given parser on the downloaded calculation. If no parser is given,
do parser matching and use the respective parser.
'''
from
nomad.parsing
import
parsers
mainfile
=
os
.
path
.
basename
(
mainfile_path
)
if
logger
is
None
:
logger
=
utils
.
get_logger
(
__name__
)
if
parser_name
is
not
None
:
parser
=
parser_dict
.
get
(
parser_name
)
parser
=
parsers
.
parser_dict
.
get
(
parser_name
)
assert
parser
is
not
None
,
'the given parser must exist'
else
:
parser
=
match_parser
(
mainfile_path
,
strict
=
strict
)
parser
=
parsers
.
match_parser
(
mainfile_path
,
strict
=
strict
)
if
isinstance
(
parser
,
parsing
.
MatchingParser
):
parser_name
=
parser
.
name
else
:
...
...
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