Fix some Kpoints generated using wrong mesh types#3245
Conversation
e183710 to
891cc90
Compare
|
@janosh seems like the tests that are failing are unrelated? Not 100% sure. If they are indeed unrelated, this should be ready for merging |
…float]] > self._space_group_data = _get_symmetry_dataset(self._cell, symprec, angle_tolerance)
|
Tests were fine on self._cell
>>> (((...), (...), (...)), ((...),), (1,), ([...],))pymatgen/pymatgen/symmetry/analyzer.py Lines 103 to 118 in c335e43 |
|
@janosh This could possibly be discovering some other issue with the magmoms, because I don't think a single line from my new code has anything to do with magmoms? ¯_(ツ)_/¯ unsure |
if len(magmoms) > 0:
self._cell: tuple[Any, ...] = (
tuple(map(tuple, structure.lattice.matrix.tolist())),
tuple(map(tuple, structure.frac_coords.tolist())),
tuple(zs),
> tuple(map(tuple, magmoms)),
)
|
Not sure either why this is surfacing now. I think this is good to go except for one thing. Do we need to add 3 new POSCAR files? How about you pick some of 31 that we already have: from collections import defaultdict
from glob import glob
from pymatgen.io.vasp.inputs import Poscar
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from pymatgen.util.testing import TEST_FILES_DIR
# glob all POSCARs in test files dir and count their crystal types
crys_sys_counts = defaultdict(int)
test_potcars = [*glob(f"{TEST_FILES_DIR}/*POSCAR*"), *glob(f"{TEST_FILES_DIR}/**/*POSCAR*")]
print(f"{len(test_potcars)=}")
for filepath in test_potcars:
try:
poscar = Poscar.from_file(filepath)
crys_sys = SpacegroupAnalyzer(poscar.structure).get_crystal_system()
crys_sys_counts[crys_sys] += 1
except Exception:
pass
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3245 +/- ##
==========================================
- Coverage 74.65% 74.08% -0.57%
==========================================
Files 230 230
Lines 69384 69386 +2
Branches 16154 16155 +1
==========================================
- Hits 51799 51408 -391
- Misses 14513 14941 +428
+ Partials 3072 3037 -35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Addresses #3220. Also adds a lot of tests to (hopefully) make sure nothing like this happens again.