Skip to content

Commit

Permalink
also check for empty maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Sep 27, 2024
1 parent f45022f commit 77ba1a5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/make_assets/structure_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@


# %% Plot some disordered structures in 2D
if os.environ.get("MP_API_KEY") is None:
raise RuntimeError("no mp api key, debugging")
mp_api_key = os.environ.get("MP_API_KEY")
if mp_api_key is None:
raise RuntimeError("api key is None")

elif mp_api_key is not None and len(mp_api_key.strip()) == 0:
raise RuntimeError("mp api key is empty")

disordered_structs = {
mp_id: MPRester(api_key=os.environ.get("MP_API_KEY")).get_structure_by_material_id(
mp_id, conventional_unit_cell=True
)
mp_id: MPRester().get_structure_by_material_id(mp_id, conventional_unit_cell=True)
for mp_id in ["mp-19017", "mp-12712"]
}

Expand Down

0 comments on commit 77ba1a5

Please sign in to comment.