diff --git a/examples/Crystal_Space/download_compounds_with_mp_api.py b/examples/Crystal_Space/download_compounds_with_mp_api.py index 6e559cb9..54b5b0e5 100644 --- a/examples/Crystal_Space/download_compounds_with_mp_api.py +++ b/examples/Crystal_Space/download_compounds_with_mp_api.py @@ -1,13 +1,13 @@ +import itertools import json -import time import string -import itertools -from pathlib import Path +import time from collections import defaultdict -from tqdm import tqdm +from pathlib import Path from mp_api.client import MPRester from pymatgen.core.composition import Composition +from tqdm import tqdm def download_mp_data( @@ -53,9 +53,7 @@ def download_mp_data( range(1, max_stoich + 1), num_elements ): formula_dict = {symbols[i]: stoich for i, stoich in enumerate(stoichs)} - formula_anonymous_list.append( - Composition(formula_dict).reduced_formula - ) + formula_anonymous_list.append(Composition(formula_dict).reduced_formula) formula_anonymous_list = sorted(set(formula_anonymous_list)) e_hull_dict = defaultdict(lambda: float("inf")) diff --git a/examples/Crystal_Space/generate_composition_with_smact.py b/examples/Crystal_Space/generate_composition_with_smact.py index e1b73dd1..55449d2b 100644 --- a/examples/Crystal_Space/generate_composition_with_smact.py +++ b/examples/Crystal_Space/generate_composition_with_smact.py @@ -1,13 +1,12 @@ -import warnings -from pathlib import Path - import itertools import multiprocessing +import warnings from functools import partial +from pathlib import Path -from tqdm import tqdm import pandas as pd from pymatgen.core.composition import Composition +from tqdm import tqdm from smact import Element, ordered_elements from smact.screening import smact_filter @@ -21,9 +20,7 @@ def convert_formula(combinations, num_elements, max_stoich): for counts in itertools.product( range(1, max_stoich + 1), repeat=num_elements ): - formula_dict = { - symbol: count for symbol, count in zip(symbols, counts) - } + formula_dict = {symbol: count for symbol, count in zip(symbols, counts)} formula = Composition(formula_dict).reduced_formula local_compounds.append(formula) return local_compounds diff --git a/examples/Crystal_Space/plot_embedding.py b/examples/Crystal_Space/plot_embedding.py index 90976726..8b76f5ef 100644 --- a/examples/Crystal_Space/plot_embedding.py +++ b/examples/Crystal_Space/plot_embedding.py @@ -1,10 +1,9 @@ -from typing import List from pathlib import Path +from typing import List import pandas as pd - -from plotly.subplots import make_subplots import plotly.graph_objects as go +from plotly.subplots import make_subplots def update_layout(