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
#!/bin/bash -l | |
source /home/phuck/mp_prod/bin/activate | |
export FW_CONFIG_FILE=$FW_CONFIG_mp_prod | |
export DB_LOC=/home/phuck/mp_prod/config/dbs | |
export VENV_LOC=/home/phuck/mp_prod/bin/activate | |
export SCRIPT_LOC=/home/phuck/mp_prod/config/scripts | |
# xdusage doesn't work in a cronjob due to sudo usage, needs tty!? |
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
# filelist (needs to be in order!) | |
FILELIST= physics/part_title.txt \ | |
physics/intro.txt \ | |
physics/ana/chapter_title.txt \ | |
physics/ana/exp.txt \ | |
physics/ana/dsets_evttrk.txt \ | |
physics/ana/evtplane.txt \ | |
physics/ana/pid.txt \ | |
physics/ana/pairrec.txt \ | |
physics/effcorr.txt \ |
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
#!/bin/bash | |
set -o errexit | |
# Author: David Underhill | |
# Script to permanently delete files/folders from your git repository. To use | |
# it, cd to your repository's root and then run the script with a list of paths | |
# you want to delete, e.g., git-delete-history path1 path2 | |
if [ $# -eq 0 ]; then | |
exit 0 |
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 | |
from pymatgen.matproj.rest import MPRester | |
from pymatgen.io.cifio import CifParser | |
ENDPOINT, API_KEY = "https://www.materialsproject.org/rest", os.environ.get('MAPI_KEY') | |
with MPRester(API_KEY, endpoint=ENDPOINT) as m: | |
# retrieve all references for a given mp-id | |
# curl -H "x-api-key:$MAPI_KEY" https://www.materialsproject.org/rest/materials/mp-568345/refs | |
print m.get_materials_id_references('mp-568') |
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
# mktmpenv | |
# pip install numpy | |
# pip install scipy | |
# pip install pymongo | |
# pip install monty | |
# pip install -U setuptools | |
# pip install -e git+git@github:materialsproject/mpworks#egg=mpworks | |
import os | |
from pymongo import MongoClient | |
from monty.serialization import loadfn |
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
\documentclass{article} | |
\newcommand\wordcount{ | |
\immediate\write18{texcount -sub=section \jobname.tex | grep "Section" | sed -e 's/+.*//' | sed -n \thesection p > 'count.txt'} | |
(\input{count.txt}words)} | |
\begin{document} | |
\section{Introduction} | |
In publishing and graphic design, lorem ipsum is placeholder text (filler text) commonly used to demonstrate the graphics elements of a document or visual presentation, such as font, typography, and layout. The lorem ipsum text is typically a section of a Latin text by Cicero with words altered, added and removed that make it nonsensical in meaning and not proper Latin. | |
\wordcount |
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 os.path import isfile | |
from pymatgen import Structure | |
from pymatgen.analysis.structure_matcher import StructureMatcher, ElementComparator | |
from pymatgen.io.cifio import CifWriter, CifParser | |
from mpworks.snl_utils.snl_mongo import SNLMongoAdapter | |
sma = SNLMongoAdapter.auto_load() | |
def get_structure(gid): | |
ciffile = 'snlgroup_id_%d.cif' % gid |
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 pandas as pd | |
from plotly.matplotlylib import Exporter, PlotlyRenderer | |
from plotly.plotly import plot | |
import matplotlib.pyplot as plt | |
data = { | |
'esN': [0, 1, 2, 3], | |
'ewe_is0': [ -398.11901997, -398.11902774, -398.11897111, -398.11882215 ], | |
'ewe_is1': [ -398.11793027, -398.11792966, -398.11786308, None ], | |
'ewe_is2': [ -398.11397008, -398.11396421, None, None ] |