Skip to content

Commit 9751f96

Browse files
authored
Phonon convenience imports (#3544)
* add pymatgen/phonon/__init__.py convenience imports * test_convenience_imports()
1 parent ba655df commit 9751f96

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

pymatgen/phonon/__init__.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
"""Phonon DOS and bandstructure analysis package."""
1+
"""pymatgen phonon package with functionality for phonon DOS + bandstructure analysis and more."""
2+
3+
from __future__ import annotations
4+
5+
from pymatgen.phonon.bandstructure import PhononBandStructure, PhononBandStructureSymmLine
6+
from pymatgen.phonon.dos import CompletePhononDos, PhononDos
7+
from pymatgen.phonon.gruneisen import (
8+
GruneisenParameter,
9+
GruneisenPhononBandStructure,
10+
GruneisenPhononBandStructureSymmLine,
11+
)
12+
from pymatgen.phonon.ir_spectra import IRDielectricTensor
13+
from pymatgen.phonon.plotter import (
14+
GruneisenPhononBSPlotter,
15+
GruneisenPlotter,
16+
PhononBSPlotter,
17+
PhononDosPlotter,
18+
ThermoPlotter,
19+
plot_brillouin_zone,
20+
)
21+
from pymatgen.phonon.thermal_displacements import ThermalDisplacementMatrices

tests/phonon/__init__.py

Whitespace-only changes.

tests/phonon/test_init.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from __future__ import annotations
2+
3+
import pymatgen.phonon as ph
4+
import pymatgen.phonon.bandstructure as bs
5+
import pymatgen.phonon.dos as dos
6+
import pymatgen.phonon.gruneisen as gru
7+
import pymatgen.phonon.plotter as plotter
8+
9+
10+
def test_convenience_imports():
11+
assert ph.PhononBandStructure == bs.PhononBandStructure
12+
assert ph.PhononBandStructureSymmLine == bs.PhononBandStructureSymmLine
13+
assert ph.PhononDos == dos.PhononDos
14+
assert ph.CompletePhononDos == dos.CompletePhononDos
15+
assert ph.GruneisenParameter == gru.GruneisenParameter
16+
assert ph.GruneisenPhononBandStructure == gru.GruneisenPhononBandStructure
17+
assert ph.GruneisenPhononBandStructureSymmLine == gru.GruneisenPhononBandStructureSymmLine
18+
assert ph.PhononDosPlotter == plotter.PhononDosPlotter
19+
assert ph.PhononBSPlotter == plotter.PhononBSPlotter
20+
assert ph.GruneisenPlotter == plotter.GruneisenPlotter
21+
assert ph.GruneisenPhononBSPlotter == plotter.GruneisenPhononBSPlotter

0 commit comments

Comments
 (0)