valyte 0.1.7__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/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
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.1
2
2
  Name: valyte
3
- Version: 0.1.7
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
@@ -13,15 +13,9 @@ Description-Content-Type: text/markdown
13
13
  Requires-Dist: numpy
14
14
  Requires-Dist: matplotlib
15
15
  Requires-Dist: pymatgen
16
- Dynamic: author
17
- Dynamic: author-email
18
- Dynamic: classifier
19
- Dynamic: description
20
- Dynamic: description-content-type
21
- Dynamic: home-page
22
- Dynamic: requires-dist
23
- Dynamic: requires-python
24
- Dynamic: summary
16
+ Requires-Dist: scipy
17
+ Requires-Dist: click
18
+ Requires-Dist: seekpath
25
19
 
26
20
  <p align="center">
27
21
  <img src="valyte/Logo.png" alt="Valyte Logo" width="100%"/>
@@ -119,6 +113,9 @@ valyte supercell 3 3 1 -i POSCAR_primitive -o POSCAR_3x3x1
119
113
 
120
114
  Automatically generate a KPOINTS file with high-symmetry paths for band structure calculations.
121
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
+
122
119
  ```bash
123
120
  valyte band kpt-gen [options]
124
121
  ```
@@ -127,12 +124,20 @@ valyte band kpt-gen [options]
127
124
  - `-i`, `--input`: Input POSCAR file (default: `POSCAR`).
128
125
  - `-n`, `--npoints`: Points per segment (default: `40`).
129
126
  - `-o`, `--output`: Output filename (default: `KPOINTS`).
127
+ - `--mode`: Path convention. Options: `bradcrack` (Default), `seekpath`, `latimer_munro`, `setyawan_curtarolo`.
130
128
 
131
129
  **Example:**
132
130
  ```bash
133
- valyte band kpt-gen -n 60 -i POSCAR_relaxed -o KPOINTS_band
131
+ # Default (Smart/BradCrack)
132
+ valyte band kpt-gen -n 60
133
+
134
+ # Explicitly use Seekpath convention
135
+ valyte band kpt-gen --mode seekpath
134
136
  ```
135
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
+
136
141
  ### 🕸️ Generate K-Points (Interactive)
137
142
 
138
143
  Generate a `KPOINTS` file for SCF calculations interactively.
@@ -0,0 +1,18 @@
1
+ valyte/Logo.png,sha256=HSZQsjsCj4y_8zeXE1kR1W7deb-6gXheEnmcLcSKUxw,4327936
2
+ valyte/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ valyte/band.py,sha256=RrzNQOzUlIXThVNJx_ONgpudJNAykjVwWgVNyl96h9w,12130
4
+ valyte/band_plot.py,sha256=2jP6fEh8qDYHXxDAs4S69xDcxrzWbYcjOAWiGHwjyF4,4766
5
+ valyte/cli.py,sha256=GzJ7ql6CJwfg52-rdJrGHaEO_BOy50QZNldXoMuJEpw,9886
6
+ valyte/dos_plot.py,sha256=PWlUSlF887-s2SXuHEjMiGLdo4_5419SVwVn1xTYvQQ,18972
7
+ valyte/kpoints.py,sha256=PxXsR7DugXUgWFcJfXigkfk6NY4Lu6bMivefGUIbCkY,3571
8
+ valyte/potcar.py,sha256=wd-QQNhbxfuQCZOTxCfcxQmCWJOoi3qgnIfK8H6fFxQ,2606
9
+ valyte/supercell.py,sha256=w6Ik_krXoshgliJDiyjoIZXuifzN0ydi6VSmpzutm9Y,996
10
+ valyte/valyte_band.png,sha256=1Bh-x7qvl1j4D9HGGbQK8OlMUrTU1mhU_kMILUsNiD8,246677
11
+ valyte/valyte_dos.png,sha256=ViE4CycCSqFi_ZtUhA7oGI1nTyt0mHoYI6yg5-Et35k,182523
12
+ valyte/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ valyte/data/bradcrack.json,sha256=Jpaf7giqp99BAhFdLv9pRFsx_m-ooQaQpOrPDusuZX4,22614
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,15 +0,0 @@
1
- valyte/Logo.png,sha256=HSZQsjsCj4y_8zeXE1kR1W7deb-6gXheEnmcLcSKUxw,4327936
2
- valyte/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- valyte/band.py,sha256=qipx3YIlcl2yV-g6nn_YPRJCidvlrxZKEQzSRyBkwac,1917
4
- valyte/band_plot.py,sha256=2jP6fEh8qDYHXxDAs4S69xDcxrzWbYcjOAWiGHwjyF4,4766
5
- valyte/cli.py,sha256=c5At8G4t6IoZEQKEJdBP72TzsKweUX5DIiaaUd9aQXg,8847
6
- valyte/dos_plot.py,sha256=PWlUSlF887-s2SXuHEjMiGLdo4_5419SVwVn1xTYvQQ,18972
7
- valyte/kpoints.py,sha256=_LISADqe11NBlv8LMjMkF5rWrREHB3aU5-nHvqxj3jk,3055
8
- valyte/supercell.py,sha256=w6Ik_krXoshgliJDiyjoIZXuifzN0ydi6VSmpzutm9Y,996
9
- valyte/valyte_band.png,sha256=1Bh-x7qvl1j4D9HGGbQK8OlMUrTU1mhU_kMILUsNiD8,246677
10
- valyte/valyte_dos.png,sha256=ViE4CycCSqFi_ZtUhA7oGI1nTyt0mHoYI6yg5-Et35k,182523
11
- valyte-0.1.7.dist-info/METADATA,sha256=9-nvh96xooqlK8HuM5aOo3N_pYw-EbHAva6lkkg0pKY,5637
12
- valyte-0.1.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
13
- valyte-0.1.7.dist-info/entry_points.txt,sha256=Ny3Z5rh3Ia7lEKoMDDZOm4_jS-Zde3qFHv8f1GLUdxk,43
14
- valyte-0.1.7.dist-info/top_level.txt,sha256=72-UqyU15JSWDjtBQf6cY0_UBqz0EU2FoVeXjd1JZ5M,7
15
- valyte-0.1.7.dist-info/RECORD,,