Skip to content

Commit

Permalink
fix requirement ,try mp and odbx
Browse files Browse the repository at this point in the history
  • Loading branch information
qwe789qwec committed Oct 18, 2024
1 parent 53ed38b commit 6508ebb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
8 changes: 6 additions & 2 deletions Xerus/queriers/mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ def make_cifs(data: pd.DataFrame, symprec: float = 1e-2, folder_path: os.PathLik
if not os.path.isdir(folder_path):
os.mkdir(folder_path)
for mid, name, struc in zip(data['material_id'], data['formula_pretty'], data.structure):
writer = CifWriter(struc, symprec=symprec)
filename = folder_path + os.sep + name + "_" + "MP_" + mid + ".cif"
try:
writer = CifWriter(struc, symprec=symprec)
filename = folder_path + os.sep + name + "_" + "MP_" + mid + ".cif"
except:
print("Could not write {}".format(name))
continue

if name != 'O2':
writer.write_file(filename)
Expand Down
16 changes: 8 additions & 8 deletions Xerus/queriers/multiquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ def multiquery(element_list: List[str], name: str, resync:bool = False) -> None:

odbx_misc_path = os.path.join(abs_path, f"{name}_{query_type}_odbx_misc")
print(f"Querying odbx through OPTIMADE")
odbx_misc_optimade = OptimadeQuery(
base_url="https://optimade-misc.odbx.science/v1",
elements=element_list,
folder_path=Path(odbx_misc_path),
extra_filters={"_odbx_hull_distance": "<0.05"}
)
odbx_misc_optimade.query()
td.append(odbx_misc_path)
# odbx_misc_optimade = OptimadeQuery(
# base_url="https://optimade-misc.odbx.science/v1",
# elements=element_list,
# folder_path=Path(odbx_misc_path),
# extra_filters={"_odbx_hull_distance": "<0.05"}
# )
# odbx_misc_optimade.query()
# td.append(odbx_misc_path)

test_folder = os.path.join(abs_path,f"{name}_{query_type}_cifs")
movecifs(dump_folders=td, test_folder=test_folder)
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
alembic==1.7.5
plotly>=5
requests>=2.25.1
h5py>=2.10.0
matplotlib==3.3.4
seaborn==0.11.2
scipy==1.5.3
numpy==1.20.1
numpy==1.21.6
pymongo<4
optuna==2.4.0
pytest>=6.2.1
Expand All @@ -14,3 +15,4 @@ optimade
mp-api
streamlit
streamlit-aggrid
# conda install conda-forge::libgfortran4

0 comments on commit 6508ebb

Please sign in to comment.