Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show FutureWarning and DeprecationWarning for pytest #4138

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
545e2a5
show FutureWarning and DeprecationWarning
DanielYang59 Oct 26, 2024
64c99d8
TODO: mark FutureWarning and DeprecationWarning for this PR
DanielYang59 Oct 26, 2024
3a79e83
Merge branch 'master' into show-deprecation-warn
DanielYang59 Oct 27, 2024
c213125
from pymatgen.core.interface import GrainBoundaryGenerator
DanielYang59 Oct 27, 2024
bc8d0ae
Suppress DeprecationWarnings on pkg_resources from pybtex
DanielYang59 Oct 27, 2024
52348ea
suppress all warning from pybtex
DanielYang59 Oct 27, 2024
0d697e9
use single quote
DanielYang59 Oct 27, 2024
35ad4ca
ignore Userwarning
DanielYang59 Oct 27, 2024
0aad506
bump plotly to avoid SyntaxWarning
DanielYang59 Oct 27, 2024
0dd7e40
DeprecationWarning: Testing an element's truth value will always retu…
DanielYang59 Oct 27, 2024
47bca8c
suppress spglib.get_symmetry
DanielYang59 Oct 27, 2024
b4bee46
fix get_vasp_input
DanielYang59 Oct 27, 2024
6a62d63
add comment
DanielYang59 Oct 27, 2024
0dad00c
replace piezo sensitivity
DanielYang59 Oct 27, 2024
f693604
suppress warning
DanielYang59 Oct 27, 2024
f84bfd3
suppress known bader warning
DanielYang59 Oct 27, 2024
4b92c08
add comment for something Im unable to fix
DanielYang59 Oct 27, 2024
1d9f673
fix lammps input
DanielYang59 Oct 27, 2024
bc5024f
n_elems
DanielYang59 Oct 27, 2024
846c5fa
simplify warning filter in test
DanielYang59 Oct 27, 2024
a122ec9
fix get_vasp_input
DanielYang59 Oct 27, 2024
bc755b2
avoid warning leakage
DanielYang59 Oct 27, 2024
8c1cee5
fix lobster
DanielYang59 Oct 27, 2024
401df09
replace phonopy
DanielYang59 Oct 27, 2024
856bfc0
revert filter warn for that we might want to fix
DanielYang59 Oct 27, 2024
050bf49
fix pandas na filter
DanielYang59 Oct 27, 2024
d5a749d
enhance filter msg
DanielYang59 Oct 27, 2024
2f54d9d
NEED CONFIRM: replace plotly colorbar
DanielYang59 Oct 27, 2024
80d3d6a
suppress intended test for MaterialsProjectCompatibility
DanielYang59 Oct 27, 2024
96ff0e3
fix pd.read_json
DanielYang59 Oct 27, 2024
1ec42d9
replace matrix with array
DanielYang59 Oct 27, 2024
6ed8a65
suppress too many figure warning
DanielYang59 Oct 27, 2024
a1538f9
fix openff
DanielYang59 Oct 27, 2024
3dd3a3b
clean up warning filter
DanielYang59 Oct 27, 2024
241621a
add comment
DanielYang59 Oct 27, 2024
041c874
filter intended usage
DanielYang59 Oct 27, 2024
e4df7b3
clean up warn filter
DanielYang59 Oct 27, 2024
e01dec6
revert plotly bump
DanielYang59 Oct 27, 2024
e69e3f0
enhance comment
DanielYang59 Oct 27, 2024
c9e4301
Merge branch 'master' into show-deprecation-warn
DanielYang59 Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pymatgen/analysis/piezo_sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,17 +620,17 @@ def get_rand_FCM(self, asum=15, force=10):
for n in range(n_sites):
dyn_mass[m][n] = dyn[m][n] * np.sqrt(masses[m]) * np.sqrt(masses[n])

supercell = pn_struct.get_supercell()
primitive = pn_struct.get_primitive()
supercell = pn_struct.supercell
primitive = pn_struct.primitive

converter = dyntofc.DynmatToForceConstants(primitive, supercell)

dyn = np.reshape(np.swapaxes(dyn_mass, 1, 2), (n_sites * 3, n_sites * 3))

converter.set_dynamical_matrices(dynmat=[dyn])
converter.dynamical_matrices = [dyn]

converter.run()
return converter.get_force_constants()
return converter.force_constants
DanielYang59 marked this conversation as resolved.
Show resolved Hide resolved


def get_piezo(BEC, IST, FCM, rcond=0.0001):
Expand Down
4 changes: 2 additions & 2 deletions tests/analysis/test_piezo_sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def test_rand_fcm(self):
structure = get_phonopy_structure(self.piezo_struct)
pn_struct = Phonopy(structure, np.eye(3), np.eye(3))

pn_struct.set_force_constants(rand_FCM)
pn_struct.force_constants = rand_FCM
dyn = pn_struct.get_dynamical_matrix_at_q([0, 0, 0])
dyn = np.reshape(dyn, (10, 3, 10, 3)).swapaxes(1, 2)
dyn = np.real(dyn)
Expand Down Expand Up @@ -296,7 +296,7 @@ def test_rand_piezo(self):
structure = get_phonopy_structure(self.piezo_struct)
pn_struct = Phonopy(structure, np.eye(3), np.eye(3))

pn_struct.set_force_constants(rand_FCM)
pn_struct.force_constants = rand_FCM
dyn = pn_struct.get_dynamical_matrix_at_q([0, 0, 0])
dyn = np.reshape(dyn, (10, 3, 10, 3)).swapaxes(1, 2)
dyn = np.real(dyn)
Expand Down