Skip to content

Commit

Permalink
Added OQMD, MP, QM9 CFID datasets and VASP API XML update for phonons. (
Browse files Browse the repository at this point in the history
#130)

* Added OQMD, MP, QM9 CFID datasets.

* Added OQMD, MP, QM9 CFID datasets.

* vasp2xml schema update.
  • Loading branch information
knc6 authored Oct 20, 2020
1 parent d18dc61 commit 66cfa96
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 33 deletions.
2 changes: 1 addition & 1 deletion jarvis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Version number."""
__version__ = "2020.10.18"
__version__ = "2020.10.19"
15 changes: 13 additions & 2 deletions jarvis/db/figshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,22 @@ def datasets(dataset=""):
url = "https://ndownloader.figshare.com/files/22471022"
js_tag = "jdft_3d-4-26-2020.json"
print("Obtaining 3D dataset ...")

elif dataset == "cfid_3d":
url = "https://ndownloader.figshare.com/files/22470818"
js_tag = "jml_3d-4-26-2020.json"
print("Obtaining 3D CFID dataset ...")
print("Obtaining JARVIS-3D CFID dataset 37k...")
elif dataset == "mp_3d":
url = "https://ndownloader.figshare.com/files/24979850"
js_tag = "CFID_mp_desc_data_84k.json"
print("Obtaining Materials Project-3D CFID dataset 84k...")
elif dataset == "oqmd_3d":
url = "https://ndownloader.figshare.com/files/24981170"
js_tag = "CFID_OQMD_460k.json"
print("Obtaining OQMD-3D CFID dataset 460k...")
elif dataset == "qm9":
url = "https://ndownloader.figshare.com/files/25159592"
js_tag = "qm9_data_cfid.json"
print("Obtaining QM9-molecule CFID dataset 134k...")
else:
ValueError("Dataset doesnt exist", dataset)
return url, js_tag
Expand Down
60 changes: 31 additions & 29 deletions jarvis/db/vasp_to_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from jarvis.analysis.thermodynamics.energetics import form_enp
from jarvis.tasks.boltztrap.run import run_boltztrap
from jarvis.tasks.phonopy.run import run_phonopy
# from jarvis.io.phonopy.outputs import bandstructure_plot

from jarvis.io.phonopy.outputs import bandstructure_plot
from jarvis.ai.pkgs.utils import get_ml_data
from jarvis.analysis.diffraction.xrd import XRD
import numpy as np
Expand Down Expand Up @@ -1188,7 +1189,7 @@ def elastic_props(
if os.path.isfile(totdos):

mesh_yaml = outcar.replace("OUTCAR", "mesh.yaml")
# band_yaml = outcar.replace("OUTCAR", "band.yaml")
band_yaml = outcar.replace("OUTCAR", "band.yaml")
with open(mesh_yaml, "r") as f:
doc = yaml.load(f)
nmodes = doc["phonon"][0]["band"]
Expand Down Expand Up @@ -1231,32 +1232,32 @@ def elastic_props(
)

# Comment until 4 MB text size error
# frequencies, distances, labels,label_points = bandstructure_plot(
# band_yaml
# )
# tmp = ""
# for i in range(np.array(frequencies).shape[1]):
# tmp += ",".join(map(str, np.array(frequencies)[:, i])) + ";"
# line += (
# "<phonon_bandstructure_distances>'"
# + ",".join(map(str, distances))
# + "'</phonon_bandstructure_distances>"
# )
# line += (
# "<phonon_bandstructure_frequencies>'"
# + tmp
# + "'</phonon_bandstructure_frequencies>"
# )
# line += (
# "<phonon_bandstructure_labels>'"
# + ",".join(map(str, labels))
# + "'</phonon_bandstructure_labels>"
# )
# line += (
# "<phonon_bandstructure_label_points>'"
# + ",".join(map(str, label_points))
# + "'</phonon_bandstructure_label_points>"
# )
frequencies, distances, labels, label_points = bandstructure_plot(
band_yaml
)
tmp = ""
for i in range(np.array(frequencies).shape[1]):
tmp += ",".join(map(str, np.array(frequencies)[:, i])) + ";"
line += (
"<phonon_bandstructure_distances>'"
+ ",".join(map(str, distances))
+ "'</phonon_bandstructure_distances>"
)
line += (
"<phonon_bandstructure_frequencies>'"
+ tmp
+ "'</phonon_bandstructure_frequencies>"
)
line += (
"<phonon_bandstructure_labels>'"
+ ",".join(map(str, labels))
+ "'</phonon_bandstructure_labels>"
)
line += (
"<phonon_bandstructure_label_points>'"
+ ",".join(map(str, label_points))
+ "'</phonon_bandstructure_label_points>"
)
return line

def main_elastic(self):
Expand All @@ -1267,6 +1268,7 @@ def main_elastic(self):
data = ""

for i in glob.glob("MAIN-ELAST*.json"):

try:
folder = i.split(".json")[0]
out = os.getcwd() + "/" + folder + "/OUTCAR"
Expand Down Expand Up @@ -1707,12 +1709,12 @@ def write_xml(self, filename="temp.xml"):
"""


"""
if __name__ == "__main__":
folder = "/rk2/knc6/JARVIS-DFT/Elements-bulkk/mp-149_bulk_PBEBO"
filename = "JVASP-1002.xml"
VaspToApiXmlSchema(folder=folder).write_xml(filename=filename)

"""
folder = "/rk2/knc6/JARVIS-DFT/TE-bulk/mp-541837_bulk_PBEBO"
filename = "JVASP-1067.xml"
VaspToApiXmlSchema(folder=folder).write_xml(filename=filename)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
setup(
name="jarvis-tools",

version="2020.10.18",
version="2020.10.19",

long_description=long_d,
install_requires=[
Expand Down

0 comments on commit 66cfa96

Please sign in to comment.