File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ def validate_api_key(api_key: str | None = None) -> str:
8181
8282 api_key = SETTINGS .get ("PMG_MAPI_KEY" )
8383
84- if not api_key or ( wrong_len := len (api_key ) != 32 ) :
85- addendum = " Valid API keys are 32 characters." if wrong_len else ""
84+ if not api_key or len (api_key ) != 32 :
85+ addendum = " Valid API keys are 32 characters." if api_key else ""
8686 raise ValueError (
8787 "Please obtain a valid API key from https://materialsproject.org/api "
8888 f"and export it as an environment variable `MP_API_KEY`.{ addendum } "
Original file line number Diff line number Diff line change 22from __future__ import annotations
33
44from datetime import datetime
5+ import json
56from typing import Literal
67
78import plotly .graph_objects as plotly_go
@@ -643,7 +644,7 @@ def get_material_data(
643644 efermi = efermi ,
644645 elastic_anisotropy = elastic_anisotropy ,
645646 elements = elements ,
646- energy_above_hull = energy_above_hull ,
647+ energy_above_hull = tuple ( float ( x ) for x in json . loads ( energy_above_hull )) ,
647648 equilibrium_reaction_energy = equilibrium_reaction_energy ,
648649 exclude_elements = exclude_elements ,
649650 formation_energy = formation_energy ,
You can’t perform that action at this time.
0 commit comments