Skip to content
Snippets Groups Projects
Commit 007a72d8 authored by Himanen, Lauri (himanel1)'s avatar Himanen, Lauri (himanel1)
Browse files

Updated README with new standalone example.

parent f1c0863e
No related branches found
No related tags found
No related merge requests found
...@@ -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 = analyzer.parse() results = parser.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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment