# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python [conda env:root] *
#     language: python
#     name: conda-root-py
# ---

# # Import Modules

# +
import os
import sys

from ase import io
from ase.visualize import view
# -

os.environ.keys()
print(
    'os.environ["repo_185b"]:',
    os.environ["repo_185b"]
    )


# assert False

atoms_path = os.path.join(
    os.environ["dropbox"],
    "__temp__",
    "VBiO4_mp-23506_primitive.cif",
    )

# +
# atoms = io.read("/home/raulf2012/GoogleDrive/GDrive_Stanford/TeamDrives/chemeng_185b/Computational_DFT/bulk_structures/VBiO4_mp-23506_primitive.cif")

# atoms = io.read("/mnt/c/Users/raul_desktop/Desktop/VBiO4_mp-23506_primitive.cif")
atoms = io.read(atoms_path)


#  atoms = io.read(
#      os.environ["repo_185b"],
#      "bulk_structures/VBiO4_mp-23506_primitive.cif",
#      )
# -

atoms

# +
lat = atoms.cell.get_bravais_lattice()

print(lat.description())

# lat.plot_bz(show=True)
# lat.plot_bz?

# +
BandPath = atoms.cell.bandpath(
    path="GXLTWRX1ZGYSW,L1Y,Y1Z",
    npoints=200,
    density=None,
    special_points=None,
    eps=0.0002,
    pbc=True,
    )


path_list = []
for i_cnt, char in enumerate(BandPath.path):
    # Skip ',' character
    if char == ",":
        continue

    if char == "1":
        path_list[-1] += "1"
        continue

    path_list.append(char)


kpts = BandPath.kpts

kpoints_plot = BandPath.get_linear_kpoint_axis()

X = kpoints_plot[1]
x = kpoints_plot[0]

save_dict = dict(
    kpts=kpts.tolist(),
    X=X.tolist(),
    x=x.tolist(),
    pathlist=path_list,
    )
# -

# # Write data to json

import json
with open("bandpath.json", "w") as outfile:  
    json.dump(save_dict, outfile, indent=2)

# # Read json data

# +
# #######################################################################
import json
data_path = os.path.join(
    os.environ["repo_185b"],
    "workflow/band_path",
    "bandpath.json",
    )
with open(data_path, "r") as fle:
    data = json.load(fle)
    
kpts = data["kpts"]
X = data["X"]
x = data["x"]
# #######################################################################

# + active=""
#
#
#
#

# + jupyter={"source_hidden": true}
# kpts.tolist()
# X.tolist()
# x.tolist()

# + jupyter={"source_hidden": true}
# view(atoms)

# + jupyter={"source_hidden": true}
# repo_185b 
# /home/flores12/00_dropbox/01_norskov/00_git_repos/CHEMENG185B_DFT

# + jupyter={"source_hidden": true}
# # atoms.cell.get_bravais_lattice?
# -



# + jupyter={"source_hidden": true}
# atoms.cell.bandpath(
#     path="L",
#     npoints=None,
#     density=None,
#     special_points=None,
#     eps=0.0002,
#     pbc=True,
#     )

# + jupyter={"source_hidden": true}
# path_list = []
# for i_cnt, char in enumerate(BandPath.path):
#     # Skip ',' character
#     if char == ",":
#         continue

#     if char == "1":
#         path_list[-1] += "1"
#         continue

#     path_list.append(char)

# + jupyter={"source_hidden": true}
# "G",
# "X",
# "L",
# "T",
# "W",
# "R",
# "X1",
# "Z",
# "G",
# "Y",
# "S",
# "W",
# "L1",
# "Y",
# "Y1",
# "Z",

StarcoderdataJupyterScriptsDedupFiltered