valyte 0.1.8__py3-none-any.whl → 0.1.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- valyte/band.py +11 -0
- valyte/cli.py +18 -0
- valyte/kpoints.py +12 -0
- valyte/potcar.py +61 -0
- {valyte-0.1.8.dist-info → valyte-0.1.9.dist-info}/METADATA +13 -2
- {valyte-0.1.8.dist-info → valyte-0.1.9.dist-info}/RECORD +9 -8
- {valyte-0.1.8.dist-info → valyte-0.1.9.dist-info}/WHEEL +0 -0
- {valyte-0.1.8.dist-info → valyte-0.1.9.dist-info}/entry_points.txt +0 -0
- {valyte-0.1.8.dist-info → valyte-0.1.9.dist-info}/top_level.txt +0 -0
valyte/band.py
CHANGED
|
@@ -15,6 +15,8 @@ try:
|
|
|
15
15
|
except ImportError:
|
|
16
16
|
import importlib_resources as ilr_files
|
|
17
17
|
|
|
18
|
+
from valyte.potcar import generate_potcar
|
|
19
|
+
|
|
18
20
|
|
|
19
21
|
def generate_band_kpoints(poscar_path="POSCAR", npoints=40, output="KPOINTS", symprec=0.01, mode="bradcrack"):
|
|
20
22
|
"""
|
|
@@ -111,6 +113,15 @@ def generate_band_kpoints(poscar_path="POSCAR", npoints=40, output="KPOINTS", sy
|
|
|
111
113
|
except Exception as e:
|
|
112
114
|
print(f"❌ Error writing KPOINTS file: {e}")
|
|
113
115
|
|
|
116
|
+
# --- POTCAR Generation ---
|
|
117
|
+
try:
|
|
118
|
+
print("ℹ️ Generating default POTCAR (PBE)...")
|
|
119
|
+
generate_potcar(poscar_path=poscar_path, functional="PBE", output="POTCAR")
|
|
120
|
+
except Exception as e:
|
|
121
|
+
print(f"⚠️ Could not generate POTCAR: {e}")
|
|
122
|
+
print(" (Proceeding without stopping, as KPOINTS are already generated)")
|
|
123
|
+
|
|
124
|
+
|
|
114
125
|
|
|
115
126
|
class BradCrackKpath:
|
|
116
127
|
"""
|
valyte/cli.py
CHANGED
|
@@ -27,6 +27,7 @@ from valyte.band import generate_band_kpoints
|
|
|
27
27
|
from valyte.band_plot import plot_band_structure
|
|
28
28
|
from valyte.dos_plot import load_dos, plot_dos
|
|
29
29
|
from valyte.kpoints import generate_kpoints_interactive
|
|
30
|
+
from valyte.potcar import generate_potcar
|
|
30
31
|
|
|
31
32
|
def parse_element_selection(inputs):
|
|
32
33
|
"""
|
|
@@ -123,6 +124,12 @@ def main():
|
|
|
123
124
|
# --- K-Point Generation (Interactive) ---
|
|
124
125
|
subparsers.add_parser("kpt", help="Interactive K-Point Generation (SCF)")
|
|
125
126
|
|
|
127
|
+
# --- POTCAR Generation ---
|
|
128
|
+
potcar_parser = subparsers.add_parser("potcar", help="Generate POTCAR")
|
|
129
|
+
potcar_parser.add_argument("-i", "--input", default="POSCAR", help="Input POSCAR file")
|
|
130
|
+
potcar_parser.add_argument("-o", "--output", default="POTCAR", help="Output filename")
|
|
131
|
+
potcar_parser.add_argument("--functional", default="PBE", help="Functional (default: PBE)")
|
|
132
|
+
|
|
126
133
|
args = parser.parse_args()
|
|
127
134
|
|
|
128
135
|
if args.command == "dos":
|
|
@@ -172,6 +179,17 @@ def main():
|
|
|
172
179
|
print(f"❌ Error: {e}")
|
|
173
180
|
sys.exit(1)
|
|
174
181
|
|
|
182
|
+
elif args.command == "potcar":
|
|
183
|
+
try:
|
|
184
|
+
generate_potcar(
|
|
185
|
+
poscar_path=args.input,
|
|
186
|
+
functional=args.functional,
|
|
187
|
+
output=args.output
|
|
188
|
+
)
|
|
189
|
+
except Exception as e:
|
|
190
|
+
print(f"❌ Error: {e}")
|
|
191
|
+
sys.exit(1)
|
|
192
|
+
|
|
175
193
|
elif args.command == "band":
|
|
176
194
|
if args.band_command == "kpt-gen":
|
|
177
195
|
try:
|
valyte/kpoints.py
CHANGED
|
@@ -10,6 +10,7 @@ import sys
|
|
|
10
10
|
import numpy as np
|
|
11
11
|
from pymatgen.core import Structure
|
|
12
12
|
from pymatgen.io.vasp.inputs import Kpoints
|
|
13
|
+
from valyte.potcar import generate_potcar
|
|
13
14
|
|
|
14
15
|
def generate_kpoints_interactive():
|
|
15
16
|
"""
|
|
@@ -94,3 +95,14 @@ def generate_kpoints_interactive():
|
|
|
94
95
|
output_file = "KPOINTS"
|
|
95
96
|
kpts.write_file(output_file)
|
|
96
97
|
print(f"\n✅ Generated {output_file}!")
|
|
98
|
+
|
|
99
|
+
# --- POTCAR Generation (if missing) ---
|
|
100
|
+
potcar_file = "POTCAR"
|
|
101
|
+
if not os.path.exists(potcar_file):
|
|
102
|
+
try:
|
|
103
|
+
print(f"\nℹ️ POTCAR not found. Generating default POTCAR (PBE)...")
|
|
104
|
+
generate_potcar(poscar_path=poscar_path, functional="PBE", output=potcar_file)
|
|
105
|
+
except Exception as e:
|
|
106
|
+
print(f"⚠️ Could not generate POTCAR: {e}")
|
|
107
|
+
else:
|
|
108
|
+
print(f"ℹ️ POTCAR already exists, skipping generation.")
|
valyte/potcar.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
from pymatgen.core import Structure
|
|
4
|
+
from pymatgen.io.vasp.outputs import Potcar
|
|
5
|
+
|
|
6
|
+
def generate_potcar(poscar_path="POSCAR", functional="PBE", output="POTCAR"):
|
|
7
|
+
"""
|
|
8
|
+
Generates a POTCAR file based on the species in the POSCAR using Pymatgen configuration.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
poscar_path (str): Path to input POSCAR file.
|
|
12
|
+
functional (str): Functional to use (e.g., "PBE", "PBE_52", "PBE_54", "LDA").
|
|
13
|
+
Defaults to "PBE" which usually maps to the configured default (often PBE_54).
|
|
14
|
+
output (str): Output filename.
|
|
15
|
+
"""
|
|
16
|
+
if not os.path.exists(poscar_path):
|
|
17
|
+
print(f"❌ Error: Input file '{poscar_path}' not found.")
|
|
18
|
+
return
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
structure = Structure.from_file(poscar_path)
|
|
22
|
+
species = structure.symbol_set
|
|
23
|
+
|
|
24
|
+
# Sort species to match POSCAR order if structure.symbol_set isn't ordered
|
|
25
|
+
# Actually Potcar.from_structure usually handles this but let's be safe if we manually construct.
|
|
26
|
+
# Ideally: use Potcar.from_structure if available or construct list.
|
|
27
|
+
# structure.symbol_set returns a tuple/list of unique species.
|
|
28
|
+
|
|
29
|
+
# Pymatgen's Potcar.from_file is for reading.
|
|
30
|
+
# We want to CREATE.
|
|
31
|
+
# Potcar(symbols, functional)
|
|
32
|
+
|
|
33
|
+
# Let's verify which method is best.
|
|
34
|
+
# structure.species gives list of all sites.
|
|
35
|
+
# We need unique species in order of appearance in POSCAR (usually).
|
|
36
|
+
# Wrapper: pymatgen.io.vasp.sets often handles this (e.g. MPRelaxSet),
|
|
37
|
+
# but that generates INCAR/KPOINTS too.
|
|
38
|
+
# Let's stick to just Potcar.
|
|
39
|
+
|
|
40
|
+
print(f"Reading structure from {poscar_path}...")
|
|
41
|
+
print(f"Detected species: {species}")
|
|
42
|
+
|
|
43
|
+
# Use simple Potcar construction.
|
|
44
|
+
# Note: functional argument in pymatgen Potcar init is 'functional'.
|
|
45
|
+
# Assuming Pymatgen is configured correctly, this should work.
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
# Try explicit functional mapping if user provides "PBE" but config uses "PBE_54" etc
|
|
49
|
+
potcar = Potcar(species, functional=functional)
|
|
50
|
+
except OSError:
|
|
51
|
+
# Fallback or specific error msg about PMG setup
|
|
52
|
+
print(f"⚠️ Could not find POTCARs for functional '{functional}'.")
|
|
53
|
+
print(" Please ensure PMG_VASP_PSP_DIR is set in ~/.pmgrc.yaml")
|
|
54
|
+
raise
|
|
55
|
+
|
|
56
|
+
potcar.write_file(output)
|
|
57
|
+
|
|
58
|
+
print(f"✅ Generated {output} using functional '{functional}'")
|
|
59
|
+
|
|
60
|
+
except Exception as e:
|
|
61
|
+
print(f"❌ Error generating POTCAR: {e}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: valyte
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: A comprehensive CLI tool for VASP pre-processing (Supercells, K-points) and post-processing (DOS, Band Structure plotting)
|
|
5
5
|
Home-page: https://github.com/nikyadav002/Valyte-Project
|
|
6
6
|
Author: Nikhil
|
|
@@ -113,6 +113,9 @@ valyte supercell 3 3 1 -i POSCAR_primitive -o POSCAR_3x3x1
|
|
|
113
113
|
|
|
114
114
|
Automatically generate a KPOINTS file with high-symmetry paths for band structure calculations.
|
|
115
115
|
|
|
116
|
+
> [!TIP]
|
|
117
|
+
> **Smart K-Path Generation (New in v0.1.7+)**: Valyte now automatically determines the standard path (e.g., `\Gamma - Y - V` for Monoclinic cells) using the **Bradley-Cracknell** convention by default. This ensures clean, publication-ready labels without external dependencies.
|
|
118
|
+
|
|
116
119
|
```bash
|
|
117
120
|
valyte band kpt-gen [options]
|
|
118
121
|
```
|
|
@@ -121,12 +124,20 @@ valyte band kpt-gen [options]
|
|
|
121
124
|
- `-i`, `--input`: Input POSCAR file (default: `POSCAR`).
|
|
122
125
|
- `-n`, `--npoints`: Points per segment (default: `40`).
|
|
123
126
|
- `-o`, `--output`: Output filename (default: `KPOINTS`).
|
|
127
|
+
- `--mode`: Path convention. Options: `bradcrack` (Default), `seekpath`, `latimer_munro`, `setyawan_curtarolo`.
|
|
124
128
|
|
|
125
129
|
**Example:**
|
|
126
130
|
```bash
|
|
127
|
-
|
|
131
|
+
# Default (Smart/BradCrack)
|
|
132
|
+
valyte band kpt-gen -n 60
|
|
133
|
+
|
|
134
|
+
# Explicitly use Seekpath convention
|
|
135
|
+
valyte band kpt-gen --mode seekpath
|
|
128
136
|
```
|
|
129
137
|
|
|
138
|
+
> [!IMPORTANT]
|
|
139
|
+
> The command will generate a **`POSCAR_standard`** file. You **MUST** use this structure for your band structure calculation (i.e., `cp POSCAR_standard POSCAR`) because the K-path corresponds to this specific orientation. Using your original POSCAR may result in incorrect paths.
|
|
140
|
+
|
|
130
141
|
### 🕸️ Generate K-Points (Interactive)
|
|
131
142
|
|
|
132
143
|
Generate a `KPOINTS` file for SCF calculations interactively.
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
valyte/Logo.png,sha256=HSZQsjsCj4y_8zeXE1kR1W7deb-6gXheEnmcLcSKUxw,4327936
|
|
2
2
|
valyte/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
valyte/band.py,sha256=
|
|
3
|
+
valyte/band.py,sha256=RrzNQOzUlIXThVNJx_ONgpudJNAykjVwWgVNyl96h9w,12130
|
|
4
4
|
valyte/band_plot.py,sha256=2jP6fEh8qDYHXxDAs4S69xDcxrzWbYcjOAWiGHwjyF4,4766
|
|
5
|
-
valyte/cli.py,sha256=
|
|
5
|
+
valyte/cli.py,sha256=GzJ7ql6CJwfg52-rdJrGHaEO_BOy50QZNldXoMuJEpw,9886
|
|
6
6
|
valyte/dos_plot.py,sha256=PWlUSlF887-s2SXuHEjMiGLdo4_5419SVwVn1xTYvQQ,18972
|
|
7
|
-
valyte/kpoints.py,sha256=
|
|
7
|
+
valyte/kpoints.py,sha256=PxXsR7DugXUgWFcJfXigkfk6NY4Lu6bMivefGUIbCkY,3571
|
|
8
|
+
valyte/potcar.py,sha256=wd-QQNhbxfuQCZOTxCfcxQmCWJOoi3qgnIfK8H6fFxQ,2606
|
|
8
9
|
valyte/supercell.py,sha256=w6Ik_krXoshgliJDiyjoIZXuifzN0ydi6VSmpzutm9Y,996
|
|
9
10
|
valyte/valyte_band.png,sha256=1Bh-x7qvl1j4D9HGGbQK8OlMUrTU1mhU_kMILUsNiD8,246677
|
|
10
11
|
valyte/valyte_dos.png,sha256=ViE4CycCSqFi_ZtUhA7oGI1nTyt0mHoYI6yg5-Et35k,182523
|
|
11
12
|
valyte/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
13
|
valyte/data/bradcrack.json,sha256=Jpaf7giqp99BAhFdLv9pRFsx_m-ooQaQpOrPDusuZX4,22614
|
|
13
|
-
valyte-0.1.
|
|
14
|
-
valyte-0.1.
|
|
15
|
-
valyte-0.1.
|
|
16
|
-
valyte-0.1.
|
|
17
|
-
valyte-0.1.
|
|
14
|
+
valyte-0.1.9.dist-info/METADATA,sha256=fONHYXiNPujBFABQT_XSdPGF8U_5yuGD5h1vKewVm7M,6272
|
|
15
|
+
valyte-0.1.9.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
16
|
+
valyte-0.1.9.dist-info/entry_points.txt,sha256=Ny3Z5rh3Ia7lEKoMDDZOm4_jS-Zde3qFHv8f1GLUdxk,43
|
|
17
|
+
valyte-0.1.9.dist-info/top_level.txt,sha256=72-UqyU15JSWDjtBQf6cY0_UBqz0EU2FoVeXjd1JZ5M,7
|
|
18
|
+
valyte-0.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|