Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-big-dft
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
parser-big-dft
Commits
4114f96b
Commit
4114f96b
authored
6 years ago
by
Daniel Speckhard
Browse files
Options
Downloads
Patches
Plain Diff
Removing use of fairdi logging.
parent
38d58bcb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bigdftparser/parser.py
+7
-19
7 additions, 19 deletions
bigdftparser/parser.py
with
7 additions
and
19 deletions
bigdftparser/parser.py
+
7
−
19
View file @
4114f96b
...
@@ -17,6 +17,7 @@ import re
...
@@ -17,6 +17,7 @@ import re
import
logging
import
logging
import
importlib
import
importlib
from
nomadcore.baseclasses
import
ParserInterface
from
nomadcore.baseclasses
import
ParserInterface
logger
=
logging
.
getLogger
(
"
nomad
"
)
class
BigDFTParser
(
ParserInterface
):
class
BigDFTParser
(
ParserInterface
):
...
@@ -27,21 +28,8 @@ class BigDFTParser(ParserInterface):
...
@@ -27,21 +28,8 @@ class BigDFTParser(ParserInterface):
After the implementation has been setup, you can parse the files with
After the implementation has been setup, you can parse the files with
parse().
parse().
"""
"""
def
__init__
(
def
__init__
(
self
,
metainfo_to_keep
=
None
,
backend
=
None
,
default_units
=
None
,
metainfo_units
=
None
,
debug
=
True
,
log_level
=
logging
.
ERROR
,
store
=
True
):
self
,
metainfo_to_keep
=
None
,
backend
=
None
,
default_units
=
None
,
super
(
BigDFTParser
,
self
).
__init__
(
metainfo_to_keep
,
backend
,
default_units
,
metainfo_units
,
debug
,
log_level
,
store
)
metainfo_units
=
None
,
debug
=
True
,
logger
=
None
,
log_level
=
logging
.
ERROR
,
store
=
True
):
super
(
BigDFTParser
,
self
).
__init__
(
metainfo_to_keep
,
backend
,
default_units
,
metainfo_units
,
debug
,
log_level
,
store
)
if
logger
is
not
None
:
self
.
logger
=
logger
self
.
logger
.
debug
(
'
received logger
'
)
else
:
self
.
logger
=
logging
.
getLogger
(
__name__
)
def
setup_version
(
self
):
def
setup_version
(
self
):
"""
Setups the version by looking at the output file and the version
"""
Setups the version by looking at the output file and the version
...
@@ -62,7 +50,7 @@ class BigDFTParser(ParserInterface):
...
@@ -62,7 +50,7 @@ class BigDFTParser(ParserInterface):
if
version_id
is
None
:
if
version_id
is
None
:
msg
=
"
Could not find a version specification from the given main file.
"
msg
=
"
Could not find a version specification from the given main file.
"
self
.
logger
.
exception
(
msg
)
logger
.
exception
(
msg
)
raise
RuntimeError
(
msg
)
raise
RuntimeError
(
msg
)
# Setup the root folder to the fileservice that is used to access files
# Setup the root folder to the fileservice that is used to access files
...
@@ -90,17 +78,17 @@ class BigDFTParser(ParserInterface):
...
@@ -90,17 +78,17 @@ class BigDFTParser(ParserInterface):
try
:
try
:
parser_module
=
importlib
.
import_module
(
base
)
parser_module
=
importlib
.
import_module
(
base
)
except
ImportError
:
except
ImportError
:
self
.
logger
.
warning
(
"
Could not find a parser for version
'
{}
'
. Trying to default to the base implementation for BigDFT 1.8.0
"
.
format
(
version_id
))
logger
.
warning
(
"
Could not find a parser for version
'
{}
'
. Trying to default to the base implementation for BigDFT 1.8.0
"
.
format
(
version_id
))
base
=
"
bigdftparser.versions.bigdft18.mainparser
"
base
=
"
bigdftparser.versions.bigdft18.mainparser
"
try
:
try
:
parser_module
=
importlib
.
import_module
(
base
)
parser_module
=
importlib
.
import_module
(
base
)
except
ImportError
:
except
ImportError
:
self
.
logger
.
exception
(
"
Could not find the module
'
{}
'"
.
format
(
base
))
logger
.
exception
(
"
Could not find the module
'
{}
'"
.
format
(
base
))
raise
raise
try
:
try
:
class_name
=
"
BigDFTMainParser
"
class_name
=
"
BigDFTMainParser
"
parser_class
=
getattr
(
parser_module
,
class_name
)
parser_class
=
getattr
(
parser_module
,
class_name
)
except
AttributeError
:
except
AttributeError
:
self
.
logger
.
exception
(
"
A parser class
'
{}
'
could not be found in the module
'
[]
'
.
"
.
format
(
class_name
,
parser_module
))
logger
.
exception
(
"
A parser class
'
{}
'
could not be found in the module
'
[]
'
.
"
.
format
(
class_name
,
parser_module
))
raise
raise
self
.
main_parser
=
parser_class
(
self
.
parser_context
)
self
.
main_parser
=
parser_class
(
self
.
parser_context
)
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