ScienceFrontend aims to improve the front-end user experience for command-line-interface (CLI) scientific scripts. Scientific CLI scripts often require a number of dependencies and can be difficult for users unfamiliar with CLI. The goal of ScienceFrontend is to provide a simple, uniform front-end experience while also eliminating end-user software dependencies (besides having a web browser). Naturally, ScienceFrontend is open-source.
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 matplotlib.pyplot as plt | |
from numpy import * | |
def draw_contour (data, xlabel, ylabel): | |
plt.xlabel(xlabel) | |
plt.ylabel(ylabel) | |
plt.contourf(data) #use plt.contour() for non-filled contours; plt.contourf() for filled | |
plt.show() | |
def run_test(): #plots a 'checkerboard' in 2D |
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 time import sleep | |
from shutil import copyfile | |
import os | |
def copy_loop(total_loops, interval, src_file, dst_file): | |
for x in range(total_loops): | |
f_name = dst_file + "_" + str(x) |
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
var accelX = Accel.getX //Assuming Accel.getX can read from Pebble or whatever | |
var accelY = Accel.getY | |
var accelZ = Accel.getZ | |
var threshold = 14.5 //total accel bigger than this means seizure | |
//METHOD 1: Checking xyz individually | |
if (accelX > threshold || accelY > threshold || accelZ > threshold ) { | |
console.log('seizure') |
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
\chapter{Synthesis Database} | |
\section{Building the Corpus} | |
A corpus of articles was constructed by first creating search queries using information from the Materials Project (MP) article database \cite{Jain2013}, and then running these queries against various published Application Programming Interfaces (APIs) \cite{ElsevierAPI} or direct-downloading articles in the case where an API was not available. The MP database consisted of a table of approximately 30 000 articles, with each row containing an article's title, author list, abstract and DOI. | |
For each article's title in the MP database, common words (e.g. a, the) were omitted and the remaining words were used to form a boolean search query (e.g. query=synthesis+zeolite\&count=5). Here, the `count' parameter specified how many related articles to retrieve for each query. These queries were used to download article identification numbers (either DOIs or PIIs) from various publishers, with the majority of articles retrieved from Elsevier using the text mi |
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
ComputedEntry Fe1 O1 | |
Energy = -12.4718 | |
Correction = -3.4353 | |
Parameters: | |
run_type = GGA+U | |
is_hubbard = True | |
potcar_symbols = [u'pbe O', u'pbe Fe_pv'] | |
hubbards = {u'Fe': 5.3, u'O': 0.0} | |
Data: | |
icsd_ids = [633029, 633031, 31081, 60683, 180972, 180973, 180974, 53519, 27856, 633036, 633038, 82233, 76639] |
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
def bin_search(f, y, lo, hi, tol, nmax): | |
mid = (hi + lo)/2. | |
if f(lo) < y < f(hi) or f(lo) > y > f(hi): | |
for i in range(nmax): | |
fmid = f(mid) | |
if abs(fmid - y) <= tol: break | |
if (fmid < y and f(lo) < f(hi)) or (fmid > y and f(lo)>f(hi)): | |
#going right | |
lo = mid | |
else: |
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
def bin_search(f, y, lo, hi, tol, nmax): | |
if f(lo) < y < f(hi) or f(lo) > y > f(hi): | |
for i in range(nmax): | |
mid = (hi+lo)/2. | |
fmid = f(mid) | |
if abs(fmid - y) <= tol: break | |
if (fmid < y and f(lo) < f(hi)) or (fmid > y and f(lo)>f(hi)): | |
#going right | |
lo = mid | |
else: |
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
#This script will sit in synthesis-database | |
from subprocess import call | |
from os import listdir | |
from models import Paper | |
pdf_list = [] | |
pdf_dir = 'files/pdfs/' | |
xml_dir = 'files/xmls/' | |
tagged_xml_dir = 'files/tagged_xmls/' | |
tag_list = 'files/to-tag-list.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
#e.g. sentence = "To confirm recent reports [7, 8, 9] that human EB-1 is a plus-tip-tracking protein in vitro, | |
# we visualized EB1 interacting with microtubules [2, 35] polymerizing from stabilized seeds using 2-color TIRF microscopy." | |
def get_connotation(word): | |
# some black magic | |
return score #(1 = positive, -1 = negative, 0 = neutral) | |
def find_features(sentence): |
OlderNewer