From 492a6dfe78835812459db007b445d7c8bb82ae71 Mon Sep 17 00:00:00 2001 From: Min-Hsueh Chiu Date: Fri, 6 Feb 2026 16:43:56 -0800 Subject: [PATCH] update dash-mp-components version --- crystal_toolkit/components/phonon.py | 47 +--------------------------- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 47 deletions(-) diff --git a/crystal_toolkit/components/phonon.py b/crystal_toolkit/components/phonon.py index c81bbe82..8f869e6e 100644 --- a/crystal_toolkit/components/phonon.py +++ b/crystal_toolkit/components/phonon.py @@ -2,7 +2,7 @@ import itertools from copy import deepcopy -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING import numpy as np import plotly.graph_objects as go @@ -16,7 +16,6 @@ from pymatgen.analysis.graphs import StructureGraph from pymatgen.analysis.local_env import CrystalNN from pymatgen.core import Species -from pymatgen.ext.matproj import MPRester from pymatgen.phonon.bandstructure import PhononBandStructureSymmLine from pymatgen.phonon.dos import CompletePhononDos from pymatgen.phonon.plotter import PhononBSPlotter @@ -470,50 +469,6 @@ def _get_time_function_json( return rdata - @staticmethod - def _get_ph_bs_dos( - data: dict[str, Any] | None, - ) -> tuple[PhononBandStructureSymmLine, CompletePhononDos]: - data = data or {} - - # this component can be loaded either from mpid or - # directly from BandStructureSymmLine or CompleteDos objects - # if mpid is supplied, it takes precedence - - mpid = data.get("mpid") - bandstructure_symm_line = data.get("bandstructure_symm_line") - density_of_states = data.get("density_of_states") - - if not mpid and (bandstructure_symm_line is None or density_of_states is None): - return None, None - - if mpid: - with MPRester() as mpr: - try: - bandstructure_symm_line = ( - mpr.get_phonon_bandstructure_by_material_id(mpid) - ) - except Exception as exc: - print(exc) - bandstructure_symm_line = None - - try: - density_of_states = mpr.get_phonon_dos_by_material_id(mpid) - except Exception as exc: - print(exc) - density_of_states = None - - else: - if bandstructure_symm_line and isinstance(bandstructure_symm_line, dict): - bandstructure_symm_line = PhononBandStructureSymmLine.from_dict( - bandstructure_symm_line - ) - - if density_of_states and isinstance(density_of_states, dict): - density_of_states = CompletePhononDos.from_dict(density_of_states) - - return bandstructure_symm_line, density_of_states - @staticmethod def get_brillouin_zone_scene(bs: PhononBandStructureSymmLine) -> Scene: if not bs: diff --git a/pyproject.toml b/pyproject.toml index 18065b0d..03bf957b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ requires-python = ">=3.10" authors = [{ name = "Matt Horton", email = "mkhorton@lbl.gov" }] dependencies = [ - "dash-mp-components==0.5.1rc2", + "dash-mp-components==0.5.1rc5", "dash>=2.11.0", "flask-caching", "frozendict",