Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-atk
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
nomad-lab
parser-atk
Commits
10f066f3
Commit
10f066f3
authored
Mar 20, 2020
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Remove dependency on old metainfo.
parent
cb91cdd8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
atkparser/parser_atk.py
+4
-20
4 additions, 20 deletions
atkparser/parser_atk.py
atkparser/setup_paths.py
+0
-20
0 additions, 20 deletions
atkparser/setup_paths.py
with
4 additions
and
40 deletions
atkparser/parser_atk.py
+
4
−
20
View file @
10f066f3
...
...
@@ -13,7 +13,6 @@
# limitations under the License.
from
__future__
import
division
import
os
from
contextlib
import
contextmanager
import
numpy
as
np
import
logging
...
...
@@ -22,8 +21,6 @@ from ase.data import chemical_symbols
from
atkparser.atkio
import
Reader
from
ase.data
import
atomic_masses
from
nomadcore.unit_conversion.unit_conversion
import
convert_unit
as
cu
from
nomadcore.local_meta_info
import
loadJsonFile
,
InfoKindEl
from
nomadcore.parser_backend
import
JsonParseEventsWriterBackend
from
atkparser.libxc_names
import
get_libxc_xc_names
...
...
@@ -40,15 +37,7 @@ def c(value, unit=None):
parser_info
=
{
"
name
"
:
"
parser_atk
"
,
"
version
"
:
"
1.0
"
}
path
=
'
../../../../nomad-meta-info/meta_info/nomad_meta_info/
'
+
\
'
atk.nomadmetainfo.json
'
import
nomad_meta_info
metaInfoPath
=
os
.
path
.
normpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
nomad_meta_info
.
__file__
)),
"
atk.nomadmetainfo.json
"
))
metaInfoEnv
,
warnings
=
loadJsonFile
(
filePath
=
metaInfoPath
,
dependencyLoader
=
None
,
extraArgsHandling
=
InfoKindEl
.
ADD_EXTRA_ARGS
,
uri
=
None
)
class
ATKParserWrapper
():
"""
A proper class envolop for running this parser using nomad-FAIRDI infra.
"""
...
...
@@ -58,12 +47,13 @@ class ATKParserWrapper():
def
parse
(
self
,
mainfile
):
logging
.
info
(
'
ATK parser started
'
)
logging
.
getLogger
(
'
nomadcore
'
).
setLevel
(
logging
.
WARNING
)
backend
=
self
.
backend_factory
(
meta
I
nfo
Env
)
backend
=
self
.
backend_factory
(
'
atk.nomad
meta
i
nfo
.json
'
)
parse_without_class
(
mainfile
,
backend
)
return
backend
def
parse_without_class
(
filename
,
backend
):
p
=
backend
# JsonParseEventsWriterBackend(metaInfoEnv)
p
=
backend
o
=
open_section
r
=
Reader
(
filename
)
...
...
@@ -191,9 +181,3 @@ def parse_without_class(filename, backend):
p
.
addValue
(
'
program_name
'
,
'
ATK
'
)
p
.
addValue
(
'
program_version
'
,
r
.
atk_version
)
return
p
if
__name__
==
'
__main__
'
:
import
sys
filename
=
sys
.
argv
[
1
]
parse
(
filename
)
This diff is collapsed.
Click to expand it.
atkparser/setup_paths.py
deleted
100644 → 0
+
0
−
20
View file @
cb91cdd8
# Copyright 2016-2018 Mikkel Strange, 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.
import
sys
,
os
,
os
.
path
baseDir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
commonDir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
baseDir
,
"
../../../../python-common/common/python
"
))
if
not
commonDir
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
commonDir
)
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
sign in
to comment