Skip to content
Snippets Groups Projects
Commit 032df021 authored by Theodore Chang's avatar Theodore Chang
Browse files

Merge branch 'some-doc-fix' into 'develop'

Fix docs

See merge request !1213
parents b248febc c2890982
No related branches found
No related tags found
1 merge request!1213Fix docs
Pipeline #162779 failed
......@@ -9,26 +9,30 @@ JSON representation of the basic metadata) and `--show-archive` (a JSON represen
nomad parse --show-archive <path-to-your-mainfile-code-output-file>
```
You can also use the NOMAD parsers within Python, as shown below. This will give you the parse results as metainfo objects to conveniently analyze the results in Python. See metainfo for more details on how to use the metainfo in Python.
You can also use the NOMAD parsers within Python, as shown below.
This will give you the parse results as metainfo objects to conveniently analyze the results in Python.
See metainfo for more details on how to use the metainfo in Python.
```python
# requires: nomad-lab[parsing,infrastructure]
import sys
from nomad.client import parse, normalize_all
# match and run the parser
archive = parse(sys.argv[1])
archives = parse(sys.argv[1])
# run all normalizers
normalize_all(archive)
for archive in archives:
normalize_all(archive)
# get the 'main section' section_run as a metainfo object
section_run = archive.run[0]
# get the 'main section' section_run as a metainfo object
section_run = archive.run[0]
# get the same data as JSON serializable Python dict
python_dict = section_run.m_to_dict()
# get the same data as JSON serializable Python dict
python_dict = section_run.m_to_dict()
```
You can also clone a parser project to debug or fix a parser:
```sh
git clone https://github.com/nomad-coe/nomad-parser-vasp.git
cd nomad-parser-vasp
......@@ -36,7 +40,9 @@ git checkout metainfo-refactor
python -m nomad.cli nomad parse --show-archive <path-to-your-vasp-file>
```
Our parsers are hosted in github. They are in the [nomad-coe](https://github.com/nomad-coe) organization. They are typically named `nomad-parser-<code-name>`. The parser version
that fits the NOMAD v1 metainfo schema is typically in the `metainfo-refactor` branch.
Run the CLI with `python -m nomad.cli` to automatically include the current working directory
in the Python path. This will use the cloned parser code over the installed parser code.
\ No newline at end of file
Our parsers are hosted in GitHub.
They are in the [nomad-coe](https://github.com/nomad-coe) organization.
They are typically named `nomad-parser-<code-name>`.
The parser version that fits the NOMAD v1 metainfo schema is typically in the `metainfo-refactor` branch.
Run the CLI with `python -m nomad.cli` to automatically include the current working directory in the Python path.
This will use the cloned parser code over the installed parser code.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment