Skip to content

Commit

Permalink
fix a few deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Dec 17, 2024
1 parent e6797ce commit c176278
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mp_api/client/mprester.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def get_entries(
else ["entries", "thermo_type"] + property_data
)

docs = self.thermo.search(
docs = self.materials.thermo.search(
**input_params, # type: ignore
all_fields=False,
fields=fields,
Expand Down Expand Up @@ -1218,7 +1218,7 @@ def get_bandstructure_by_material_id(
Returns:
bandstructure (Union[BandStructure, BandStructureSymmLine]): BandStructure or BandStructureSymmLine object
"""
return self.electronic_structure_bandstructure.get_bandstructure_from_material_id( # type: ignore
return self.materials.electronic_structure_bandstructure.get_bandstructure_from_material_id( # type: ignore
material_id=material_id, path_type=path_type, line_mode=line_mode
)

Expand All @@ -1231,7 +1231,7 @@ def get_dos_by_material_id(self, material_id: str):
Returns:
dos (CompleteDos): CompleteDos object
"""
return self.electronic_structure_dos.get_dos_from_material_id(
return self.materials.electronic_structure_dos.get_dos_from_material_id(
material_id=material_id
) # type: ignore

Expand All @@ -1245,7 +1245,7 @@ def get_phonon_dos_by_material_id(self, material_id: str):
CompletePhononDos: A phonon DOS object.
"""
doc = self.phonon.search(material_ids=material_id, fields=["ph_dos"])
doc = self.materials.phonon.search(material_ids=material_id, fields=["ph_dos"])
if not doc:
return None
return doc[0].ph_dos if self.use_document_model else doc[0]["ph_dos"] # type: ignore
Expand All @@ -1259,7 +1259,7 @@ def get_phonon_bandstructure_by_material_id(self, material_id: str):
Returns:
PhononBandStructureSymmLine: phonon band structure.
"""
doc = self.phonon.search(material_ids=material_id, fields=["ph_bs"])
doc = self.materials.phonon.search(material_ids=material_id, fields=["ph_bs"])
if not doc:
return None

Expand All @@ -1279,7 +1279,7 @@ def get_wulff_shape(self, material_id: str):
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer

structure = self.get_structure_by_material_id(material_id)
doc = self.surface_properties.search(material_ids=material_id)
doc = self.materials.surface_properties.search(material_ids=material_id)

if not doc:
return None
Expand Down

0 comments on commit c176278

Please sign in to comment.