Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-octopus
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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-octopus
Commits
ab9ce80c
Commit
ab9ce80c
authored
7 years ago
by
Ask Hjorth Larsen
Browse files
Options
Downloads
Patches
Plain Diff
remove other unused module
parent
f1ee8be9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
parser/parser-octopus/util.py
+0
-50
0 additions, 50 deletions
parser/parser-octopus/util.py
src/main/scala/eu/nomad_lab/parsers/OctopusParser.scala
+1
-2
1 addition, 2 deletions
src/main/scala/eu/nomad_lab/parsers/OctopusParser.scala
with
1 addition
and
52 deletions
parser/parser-octopus/util.py
deleted
100644 → 0
+
0
−
50
View file @
f1ee8be9
from
nomadcore.simple_parser
import
mainFunction
,
runParser
OCT_ENERGY_UNIT_NAME
=
'
usrOctEnergyUnit
'
f_num
=
r
'
[-+]?(\d*\.\d+|\d+\.\d*)
'
# e.g.: 0.7 1. -.1
e_num
=
r
'
[-+]?\d*\.\d+[EeDd][-+]\d*
'
# e.g.: -7.642e-300
i_num
=
r
'
[-+\d]*
'
def
numpattern
(
id
,
unit
=
None
,
pattern
=
f_num
):
if
unit
is
None
:
pat
=
r
'
(?P<%(id)s>%(pattern)s)
'
else
:
pat
=
r
'
(?P<%(id)s__%(unit)s>%(pattern)s)
'
return
pat
%
dict
(
id
=
id
,
unit
=
unit
,
pattern
=
pattern
)
def
pat
(
meta
,
regex
):
return
'
(?P<%s>%s)
'
%
(
meta
,
regex
)
def
word
(
meta
):
return
pat
(
meta
,
regex
=
r
'
\S*
'
)
def
integer
(
meta
):
return
pat
(
meta
,
regex
=
i_num
)
def
floating
(
meta
):
return
pat
(
meta
,
regex
=
'
%s|%s
'
%
(
f_num
,
e_num
))
def
parse_file_without_decorations
(
pew
,
meta_info_env
,
matchers
,
parser_info
,
supercontext
,
fname
):
"""
Run SimpleMatcher on a file printing only sequence of json.
"""
# If we set outF, it only redirects some of the stuff.
# It writes "[" followed by json followed by "]", to
# different streams. By redirecting one of them we can get only
# the json. Strange but true!
class
DevNull
:
def
write
(
self
,
txt
):
pass
# This is to prevent another header (nomad_parse_events_1_0 etc.)
def
parsefile
(
parser_builder
,
uri
,
path
,
backend
,
super_context
):
with
open
(
path
)
as
fd
:
runParser
(
parser_builder
,
backend
,
super_context
,
fd
)
mainFunction
(
matchers
,
meta_info_env
,
parser_info
,
outF
=
DevNull
(),
# Eats surrounding []
parseFile
=
parsefile
,
cachingLevelForMetaName
=
{},
superBackend
=
pew
,
superContext
=
supercontext
,
mainFile
=
fname
)
This diff is collapsed.
Click to expand it.
src/main/scala/eu/nomad_lab/parsers/OctopusParser.scala
+
1
−
2
View file @
ab9ce80c
/*
/*
Copyright 2016-201
7
The NOMAD Developers Group
Copyright 2016-201
8
The NOMAD Developers Group
Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License.
...
@@ -49,7 +49,6 @@ Simulation Box:
...
@@ -49,7 +49,6 @@ Simulation Box:
"parser-octopus/parser_octopus.py"
,
"parser-octopus/parser_octopus.py"
,
"parser-octopus/aseoct.py"
,
"parser-octopus/aseoct.py"
,
"parser-octopus/generate-octopus-json.py"
,
"parser-octopus/generate-octopus-json.py"
,
"parser-octopus/util.py"
,
"parser-octopus/setup_paths.py"
,
"parser-octopus/setup_paths.py"
,
"nomad_meta_info/public.nomadmetainfo.json"
,
"nomad_meta_info/public.nomadmetainfo.json"
,
"nomad_meta_info/common.nomadmetainfo.json"
,
"nomad_meta_info/common.nomadmetainfo.json"
,
...
...
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