This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat << EOF > FILENAME | |
#!/bin/bash | |
echo \$PWD | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
tell application "iTerm" | |
create window with default profile | |
tell front window | |
tell current session | |
write text ("ranger " & "; exit") | |
end tell | |
end tell | |
end tell | |
return input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%env FW_CONFIG_FILE=/Users/lik/.atomate/config/FW_config.yaml | |
from pymatgen import Structure | |
from atomate.vasp.workflows.base.core import get_wf | |
from fireworks import LaunchPad,fw_config | |
fw_config.CONFIG_FILE_DIR # you can finetune the configuration for each project using this parameter | |
from atomate.vasp.powerups import add_modify_incar, add_additional_fields_to_taskdocs, add_priority | |
from pymongo import MongoClient | |
import json | |
from pymatgen import MPRester |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import tempfile | |
temp = tempfile.NamedTemporaryFile(mode='w+t') | |
try: | |
temp.write(string) | |
temp.seek(0) | |
print (temp.name) | |
finally: | |
temp.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymongo import MongoClient | |
import json | |
import pandas as pd | |
import numpy as np | |
from atomate.vasp.database import VaspCalcDb | |
def insert_task_incre(doc, db_file, name_root='test', **kwargs): | |
# open the database | |
with open('./test.db', 'r') as f: | |
db_dict = json.load(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cart_pos = np.dot(struct.lattice.matrix, frac_coord_vec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.getCollection("chgcar_fs.files").aggregate([ | |
{$group: { | |
_id: {task_id: "$metadata.task_id"}, | |
uniqueIds: {$addToSet: "$metadata.task_id"}, | |
count: {$sum: 1} | |
} | |
}, | |
{$match: { | |
count: {"$gt": 1} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from maggma.stores import MongoStore | |
from pymatgen.analysis.structure_matcher import StructureMatcher, ElementComparator | |
from pymatgen import Structure | |
sm = StructureMatcher(comparator=ElementComparator(), | |
primitive_cell=False) | |
def check_fws( struct_in ): | |
js_fw_store = MongoStore("", "", | |
host="", | |
username="", | |
password="", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from atomate.vasp.firetasks.parse_outputs import VaspDrone | |
drone = VaspDrone(parse_chgcar=True, parse_aeccar=True) | |
d = drone.assimilate('CALC_DIR') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atoms = AseAtomsAdaptor.get_atoms(struct) | |
import matplotlib.pyplot as plt | |
from ase.visualize.plot import plot_atoms | |
from ase.lattice.cubic import FaceCenteredCubic | |
fig, ax = plt.subplots(2,2) | |
plt.subplots_adjust(wspace=0, hspace=0) | |
rot=['0x,0y,0z', '90x,0y,0z', '0x,90y,0z', '0x,0y,90z'] | |
for itr, a in enumerate(ax.flatten()): | |
plot_atoms(atoms, a, radii=0.3, rotation=rot[itr], show_unit_cell=True, scale=0.5) |
OlderNewer