Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-cp2k
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-cp2k
Commits
007a72d8
Commit
007a72d8
authored
9 years ago
by
Himanen, Lauri (himanel1)
Browse files
Options
Downloads
Patches
Plain Diff
Updated README with new standalone example.
parent
f1c0863e
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
README.md
+9
-16
9 additions, 16 deletions
README.md
with
9 additions
and
16 deletions
README.md
+
9
−
16
View file @
007a72d8
...
@@ -28,30 +28,23 @@ overridden only where necesssary.
...
@@ -28,30 +28,23 @@ overridden only where necesssary.
The parser is designed to be usable also outside the NoMaD project as a
The parser is designed to be usable also outside the NoMaD project as a
separate python package. This standalone python-only mode is primarily for
separate python package. This standalone python-only mode is primarily for
people who want to easily access the parser without the need to setup the whole
people who want to easily access the parser without the need to setup the whole
"NOMAD Stack". It is also used when running unit tests. The nomadtoolkit
"NOMAD Stack". It is also used when running unit tests. Here is an example of
package is currently used by the developer only and is thus not available
the call syntax:
through gitlab. Here is an example of the call syntax:
```
python
```
python
from
nomadtoolkit
import
Analyzer
from
cp2kparser
import
CP2KParser
from
cp2kparser
import
CP2KParser
import
matplotlib.pyplot
as
mpl
import
matplotlib.pyplot
as
mpl
#===============================================================================
# 1. Initialize a parser by giving a path to the CP2K output file and a list of
# 1. Initialize a parser by giving a path to the calculation folder that
# default units
# contains all the relevant files.
path
=
"
/home/lauri/Dropbox/nomad-dev/nomad-lab-base/parsers/cp2k/test/unittests/cp2k_2.6.2/energy_force/unittest.out
"
path
=
"
path/to/folder
"
parser
=
CP2KParser
(
path
)
# 2. Initialize the analyzer.
# By default all the quantities will be in SI. You can override the units here.
default_units
=
[
"
eV
"
]
default_units
=
[
"
eV
"
]
analyzer
=
Analyzer
(
parser
,
default_units
)
parser
=
CP2KParser
(
path
,
default_units
=
default_units
)
#
3
. Parse
#
2
. Parse
results
=
analyz
er
.
parse
()
results
=
pars
er
.
parse
()
#
4
.
Analyze
the results
#
3
.
Query
the results
with using the id's created specifically for NOMAD.
scf_energies
=
results
[
"
energy_total_scf_iteration
"
]
scf_energies
=
results
[
"
energy_total_scf_iteration
"
]
mpl
.
plot
(
scf_energies
)
mpl
.
plot
(
scf_energies
)
mpl
.
show
()
mpl
.
show
()
...
...
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