Skip to content

Commit 492a6df

Browse files
committed
update dash-mp-components version
1 parent f6657a1 commit 492a6df

2 files changed

Lines changed: 2 additions & 47 deletions

File tree

crystal_toolkit/components/phonon.py

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import itertools
44
from copy import deepcopy
5-
from typing import TYPE_CHECKING, Any
5+
from typing import TYPE_CHECKING
66

77
import numpy as np
88
import plotly.graph_objects as go
@@ -16,7 +16,6 @@
1616
from pymatgen.analysis.graphs import StructureGraph
1717
from pymatgen.analysis.local_env import CrystalNN
1818
from pymatgen.core import Species
19-
from pymatgen.ext.matproj import MPRester
2019
from pymatgen.phonon.bandstructure import PhononBandStructureSymmLine
2120
from pymatgen.phonon.dos import CompletePhononDos
2221
from pymatgen.phonon.plotter import PhononBSPlotter
@@ -470,50 +469,6 @@ def _get_time_function_json(
470469

471470
return rdata
472471

473-
@staticmethod
474-
def _get_ph_bs_dos(
475-
data: dict[str, Any] | None,
476-
) -> tuple[PhononBandStructureSymmLine, CompletePhononDos]:
477-
data = data or {}
478-
479-
# this component can be loaded either from mpid or
480-
# directly from BandStructureSymmLine or CompleteDos objects
481-
# if mpid is supplied, it takes precedence
482-
483-
mpid = data.get("mpid")
484-
bandstructure_symm_line = data.get("bandstructure_symm_line")
485-
density_of_states = data.get("density_of_states")
486-
487-
if not mpid and (bandstructure_symm_line is None or density_of_states is None):
488-
return None, None
489-
490-
if mpid:
491-
with MPRester() as mpr:
492-
try:
493-
bandstructure_symm_line = (
494-
mpr.get_phonon_bandstructure_by_material_id(mpid)
495-
)
496-
except Exception as exc:
497-
print(exc)
498-
bandstructure_symm_line = None
499-
500-
try:
501-
density_of_states = mpr.get_phonon_dos_by_material_id(mpid)
502-
except Exception as exc:
503-
print(exc)
504-
density_of_states = None
505-
506-
else:
507-
if bandstructure_symm_line and isinstance(bandstructure_symm_line, dict):
508-
bandstructure_symm_line = PhononBandStructureSymmLine.from_dict(
509-
bandstructure_symm_line
510-
)
511-
512-
if density_of_states and isinstance(density_of_states, dict):
513-
density_of_states = CompletePhononDos.from_dict(density_of_states)
514-
515-
return bandstructure_symm_line, density_of_states
516-
517472
@staticmethod
518473
def get_brillouin_zone_scene(bs: PhononBandStructureSymmLine) -> Scene:
519474
if not bs:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ requires-python = ">=3.10"
1111
authors = [{ name = "Matt Horton", email = "mkhorton@lbl.gov" }]
1212

1313
dependencies = [
14-
"dash-mp-components==0.5.1rc2",
14+
"dash-mp-components==0.5.1rc5",
1515
"dash>=2.11.0",
1616
"flask-caching",
1717
"frozendict",

0 commit comments

Comments
 (0)