|
2 | 2 |
|
3 | 3 | import itertools |
4 | 4 | from copy import deepcopy |
5 | | -from typing import TYPE_CHECKING, Any |
| 5 | +from typing import TYPE_CHECKING |
6 | 6 |
|
7 | 7 | import numpy as np |
8 | 8 | import plotly.graph_objects as go |
|
16 | 16 | from pymatgen.analysis.graphs import StructureGraph |
17 | 17 | from pymatgen.analysis.local_env import CrystalNN |
18 | 18 | from pymatgen.core import Species |
19 | | -from pymatgen.ext.matproj import MPRester |
20 | 19 | from pymatgen.phonon.bandstructure import PhononBandStructureSymmLine |
21 | 20 | from pymatgen.phonon.dos import CompletePhononDos |
22 | 21 | from pymatgen.phonon.plotter import PhononBSPlotter |
@@ -470,50 +469,6 @@ def _get_time_function_json( |
470 | 469 |
|
471 | 470 | return rdata |
472 | 471 |
|
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 | | - |
517 | 472 | @staticmethod |
518 | 473 | def get_brillouin_zone_scene(bs: PhononBandStructureSymmLine) -> Scene: |
519 | 474 | if not bs: |
|
0 commit comments