You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modular CP2K output file parsers, mostly in the form of regular expressions plus other tools to mangle various CP2K output:
6
6
7
-
*`cp2kparse` ... parse CP2K output files (for restart & input files look at the [cp2k-input-tools](https://github.com/cp2k/cp2k-input-tools) project)
8
-
*`xyz_restart_parser` ... when restarts occur during an MD you may end up with duplicated frames in the trajectory, this tool filters them
7
+
*`cp2kparse` ... parse CP2K output (for restart & input files look at the [cp2k-input-tools](https://github.com/cp2k/cp2k-input-tools) project) and allow easy selection of common values.
8
+
*`xyz_restart_parser` ... when restarts occur during an MD you may end up with duplicated frames in the trajectory, this tool filters them (and can easily handle huge files)
9
9
*`cp2k_bs2csv` ... convert a CP2K band structure file to multiple (one-per-set) CSV files for easier plotting. There is also an API available if you need to import bandstructure data into your application.
10
-
*`cp2k_pdos` ... bring CP2Ks PDOS dump into a more CSV-like form for easier plotting/parsing
10
+
*`cp2k_pdos` ... apply a convolution with Gaussians on a regular grid on the CP2K PDOS output and generate a CSV file for further processing or plotting. The same grid is used for all input files with the min/max of the grid automatically determined, but no summation of the different projections is done.
11
11
12
12
## Requirements
13
13
14
14
* Python 3.6+
15
-
* regex 2020+
15
+
* regex 2021+
16
+
* click 8+
17
+
* numpy 1.19+
18
+
* optional: ruamel.yaml
16
19
17
20
For development: https://poetry.eustace.io/https://pytest.org/
18
21
@@ -23,18 +26,21 @@ There is a simple command-line interface `cp2kparse`:
23
26
24
27
```console
25
28
$ cp2kparse --help
26
-
usage: cp2kparse [-h] [-y] [-k <path>] [<file>]
29
+
Usage: cp2kparse [OPTIONS] [FILE|-]
27
30
28
-
Parse the CP2K output file and return a JSON
31
+
Parse the CP2K output FILE and return a structured output
29
32
30
-
positional arguments:
31
-
<file> CP2K output file, stdin if not specified
32
-
33
-
optional arguments:
34
-
-h, --help show this help message and exit
35
-
-y, --yaml output yaml instead of json
36
-
-k <path>, --key <path>
37
-
Path, ex.: 'energies/total force_eval'
33
+
Options:
34
+
-f, --format [json|yaml|highlight]
35
+
Output format (json or yaml are structure
36
+
formats, highlight shows which lines of the
37
+
output have been matched)
38
+
--color [auto|always] When to colorize output
39
+
-s, --safe-keys generate 'safe' key names (e.g. without
@@ -506,6 +512,41 @@ found restart point @1, dropping 1 frames, flushing 1
506
512
flushing remaining 2 frames
507
513
```
508
514
515
+
## Usage: cp2k_bs2csv
516
+
517
+
Given a `.bs` file as written by CP2K the script will generate CSV files with the same name and suffixes `.set-X.csv` in the same directory as the source file:
518
+
519
+
```console
520
+
$ cp2k_bs2csv WO3.bs
521
+
writing point set WO3.bs.set-1.csv (total number of k-points: 11)
522
+
with the following special points:
523
+
GAMMA: 0.00000000 / 0.00000000 / 0.00000000
524
+
X: 0.00000000 / 0.50000000 / 0.00000000
525
+
writing point set WO3.bs.set-2.csv (total number of k-points: 11)
526
+
with the following special points:
527
+
X: 0.00000000 / 0.50000000 / 0.00000000
528
+
M: 0.50000000 / 0.50000000 / 0.00000000
529
+
writing point set WO3.bsset-3.csv (total number of k-points: 11)
530
+
with the following special points:
531
+
M: 0.50000000 / 0.50000000 / 0.00000000
532
+
GAMMA: 0.00000000 / 0.00000000 / 0.00000000
533
+
writing point set WO3.bs.set-4.csv (total number of k-points: 11)
534
+
with the following special points:
535
+
GAMMA: 0.00000000 / 0.00000000 / 0.00000000
536
+
R: 0.50000000 / 0.50000000 / 0.50000000
537
+
writing point set WO3.bs.set-5.csv (total number of k-points: 11)
538
+
with the following special points:
539
+
R: 0.50000000 / 0.50000000 / 0.50000000
540
+
X: 0.00000000 / 0.50000000 / 0.00000000
541
+
writing point set WO3.bs.set-6.csv (total number of k-points: 11)
0 commit comments