Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
parser-nwchem
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nomad-lab
parser-nwchem
Commits
261cabfe
Commit
261cabfe
authored
Dec 20, 2018
by
Daniel Speckhard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added structured logging, fixed file structure.
parent
b0e94083
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
28 additions
and
16 deletions
+28
-16
.gitignore
.gitignore
+1
-1
nwchemparser/__init__.py
nwchemparser/__init__.py
+0
-0
nwchemparser/generic/__init__.py
nwchemparser/generic/__init__.py
+0
-0
nwchemparser/parser.py
nwchemparser/parser.py
+23
-11
nwchemparser/scalainterface.py
nwchemparser/scalainterface.py
+0
-0
nwchemparser/setup_paths.py
nwchemparser/setup_paths.py
+0
-0
nwchemparser/tools/__init__.py
nwchemparser/tools/__init__.py
+0
-0
nwchemparser/versions/__init__.py
nwchemparser/versions/__init__.py
+0
-0
nwchemparser/versions/nwchem66/__init__.py
nwchemparser/versions/nwchem66/__init__.py
+0
-0
nwchemparser/versions/nwchem66/mainparser.py
nwchemparser/versions/nwchem66/mainparser.py
+0
-0
setup.py
setup.py
+4
-4
No files found.
.gitignore
View file @
261cabfe
...
...
@@ -55,4 +55,4 @@ lib/
env/
# Egg
parser/parser-nwchem/
nwchemparser.egg-info/
nwchemparser.egg-info/
parser/parser-nwchem/
nwchemparser/__init__.py
→
nwchemparser/__init__.py
View file @
261cabfe
File moved
parser/parser-nwchem/
nwchemparser/generic/__init__.py
→
nwchemparser/generic/__init__.py
View file @
261cabfe
File moved
parser/parser-nwchem/
nwchemparser/parser.py
→
nwchemparser/parser.py
View file @
261cabfe
# Copyright 2016-2018 Lauri Himanen, Fawzi Mohamed
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
builtins
import
next
from
builtins
import
range
#
from builtins import next
#
from builtins import range
import
os
import
re
import
logging
...
...
@@ -30,8 +30,20 @@ class NWChemParser(ParserInterface):
After the implementation has been setup, you can parse the files with
parse().
"""
def
__init__
(
self
,
metainfo_to_keep
=
None
,
backend
=
None
,
default_units
=
None
,
metainfo_units
=
None
,
debug
=
True
,
log_level
=
logging
.
ERROR
,
store
=
True
):
super
(
NWChemParser
,
self
).
__init__
(
metainfo_to_keep
,
backend
,
default_units
,
metainfo_units
,
debug
,
log_level
,
store
)
def
__init__
(
self
,
metainfo_to_keep
=
None
,
backend
=
None
,
default_units
=
None
,
metainfo_units
=
None
,
debug
=
True
,
logger
=
None
,
log_level
=
logging
.
ERROR
,
store
=
True
):
super
(
NWChemParser
,
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
):
"""Setups the version by looking at the output file and the version
...
...
@@ -50,7 +62,7 @@ class NWChemParser(ParserInterface):
if
version_id
is
None
:
msg
=
"Could not find a version specification from the given main file."
logger
.
exception
(
msg
)
self
.
logger
.
exception
(
msg
)
raise
RuntimeError
(
msg
)
# Setup the root folder to the fileservice that is used to access files
...
...
@@ -78,16 +90,16 @@ class NWChemParser(ParserInterface):
try
:
parser_module
=
importlib
.
import_module
(
base
)
except
ImportError
:
logger
.
warning
(
"Could not find a parser for version '{}'. Trying to default to the base implementation for NWChem 6.6"
.
format
(
version_id
))
self
.
logger
.
warning
(
"Could not find a parser for version '{}'. Trying to default to the base implementation for NWChem 6.6"
.
format
(
version_id
))
base
=
"nwchemparser.versions.nwchem66.mainparser"
try
:
parser_module
=
importlib
.
import_module
(
base
)
except
ImportError
:
logger
.
exception
(
"Tried to default to the NWChem 6.6 implementation but could not find the correct module."
)
self
.
logger
.
exception
(
"Tried to default to the NWChem 6.6 implementation but could not find the correct module."
)
raise
try
:
parser_class
=
getattr
(
parser_module
,
"NWChemMainParser"
)
except
AttributeError
:
logger
.
exception
(
"A parser class 'NWChemMainParser' could not be found in the module '[]'."
.
format
(
parser_module
))
self
.
logger
.
exception
(
"A parser class 'NWChemMainParser' could not be found in the module '[]'."
.
format
(
parser_module
))
raise
self
.
main_parser
=
parser_class
(
self
.
parser_context
)
parser/parser-nwchem/
nwchemparser/scalainterface.py
→
nwchemparser/scalainterface.py
View file @
261cabfe
File moved
parser/parser-nwchem/
nwchemparser/setup_paths.py
→
nwchemparser/setup_paths.py
View file @
261cabfe
File moved
parser/parser-nwchem/
nwchemparser/tools/__init__.py
→
nwchemparser/tools/__init__.py
View file @
261cabfe
File moved
parser/parser-nwchem/
nwchemparser/versions/__init__.py
→
nwchemparser/versions/__init__.py
View file @
261cabfe
File moved
parser/parser-nwchem/
nwchemparser/versions/nwchem66/__init__.py
→
nwchemparser/versions/nwchem66/__init__.py
View file @
261cabfe
File moved
parser/parser-nwchem/
nwchemparser/versions/nwchem66/mainparser.py
→
nwchemparser/versions/nwchem66/mainparser.py
View file @
261cabfe
File moved
setup.py
View file @
261cabfe
# Copyright 2016-2018 Lauri Himanen, Fawzi Mohamed
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
...
@@ -23,7 +23,7 @@ def main():
author
=
"Lauri Himanen"
,
author_email
=
"lauri.himanen@aalto.fi"
,
license
=
"GPL3"
,
package_dir
=
{
''
:
'
parser/parser-nwchem
'
},
package_dir
=
{
''
:
'
./
'
},
packages
=
find_packages
(),
install_requires
=
[
'nomadcore'
,
...
...
Write
Preview
Markdown
is supported
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