Skip to content

Commit

Permalink
first with electron
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan Fast authored and Ethan Fast committed Jun 23, 2017
0 parents commit 897a15f
Show file tree
Hide file tree
Showing 3,403 changed files with 222,349 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["react", "es2015", "stage-0"],
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/*
backend/app/large_files/*
65 changes: 65 additions & 0 deletions LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
REGISTERING AS get length of array {arr} ['get length of array {arr}', 'array {arr} length']
REGISTERING AS generate a random number ['generate a random number', 'generate number']
REGISTERING AS generate a random float ['generate a random float', 'generate float']
REGISTERING AS generate a random array of {n} numbers ['generate a random array of {n} numbers', 'generate numpy array of size {n}']
REGISTERING AS add two numbers: {x} and {y} ['add two numbers: {x} and {y}', 'add {x} and {y}', 'add {x} {y}', 'can you add {x} and {y}']
REGISTERING AS divide two numbers: {x} and {y} ['divide two numbers: {x} and {y}', 'divide {x} and {y}', 'divide {x} {y}']
REGISTERING AS print {value} ['print {value}', 'display {value}', '{value}', 'show me {value}']
REGISTERING AS load csv data from {file} ['load csv data from {file}', 'load csv {file}']
REGISTERING AS list columns from {dataframe} ['list columns from {dataframe}', 'list columns {dataframe}']
REGISTERING AS get {column} from {dataframe} ['get {column} from {dataframe}', 'get {column} {dataframe}']
REGISTERING AS filter {data} with {column} less than {number} ['filter {data} with {column} less than {number}', 'filter {data} {column} < {number}']
REGISTERING AS filter {data} with {column} greater than {number} ['filter {data} with {column} greater than {number}', 'filter {data} {column} > {number}']
REGISTERING AS selector test ['selector test']
REGISTERING AS save environment to {name} ['save environment to {name}', 'save environment {name}', 'save env to {name}']
REGISTERING AS load environment from {name} ['load environment from {name}', 'load environment {name}', 'load env from {name}']
REGISTERING AS save {value} to {name} ['save {value} to {name}', 'save {value} as {name}', 'save that {value} to {name}']
REGISTERING AS rename {name1} to {name2} ['rename {name1} to {name2}', 'change name {value} to {name}']
REGISTERING AS delete {name1} ['delete {name1}', 'remove {name1} from environment']
REGISTERING AS make a classification model: {features} to predict {classes} ['make a classification model: {features} to predict {classes}', 'build a new classification model', 'make a new classification model', 'classifier using {features} to predict {classes}', 'logistic regression model', 'logistic classifier']
REGISTERING AS make a regression model: {features} to predict {classes} ['make a regression model: {features} to predict {classes}', 'build a new regression model', 'make a new regression model', 'regression using {features} to predict {classes}']
REGISTERING AS lasso feature selection for {model} with L1 of {regularization} ['lasso feature selection for {model} with L1 of {regularization}', 'feature selection for {model} via lasso']
REGISTERING AS change {feature} in {dataframe} to {new_type} ['change {feature} in {dataframe} to {new_type}', 'change feature {feature} in dataframe {dataframe} to {type}']
REGISTERING AS remove {feature} from {dataframe} ['remove {feature} from {dataframe}', 'remove feature {feature} from {dataframe}']
REGISTERING AS vectorize {column} in {dataframe} ['vectorize {column} in {dataframe}', 'make word vectors for {feature} in dataframe {dataframe}']
REGISTERING AS select one or more features / columns ['select one or more features / columns', 'create a new group of features', 'create a feature set', 'select columns from dataframe', 'select a group of features']
REGISTERING AS show {model} coefficients ['show {model} coefficients', 'feature coefficients for model {model}', 'feature relationship coefficients', 'features coefficients', 'get coefficient']
REGISTERING AS create training and test data splits ['create training and test data splits', 'create train test data', 'split data into train and test']
REGISTERING AS train {model} on {data} ['train {model} on {data}', 'train {model} {data}', 'train model {model} on data {data}']
REGISTERING AS test {iris_model} on {iris_data} using f1 score with {weighting} ['test {iris_model} on {iris_data} using f1 score with {weighting}', 'test {iris_model} {iris_data} with {weighting}', 'test model {iris_model} on data {data} with {weighting}']
REGISTERING AS cross-validate classification {model} with {score} and {n} folds ['cross-validate classification {model} with {score} and {n} folds', 'cross-validate classification {model} {score} {n}', 'evaluate classifier performance', 'cross-validate {model}']
REGISTERING AS cross-validate regression {model} with {score} and {n} folds ['cross-validate regression {model} with {score} and {n} folds', 'cross-validate regression {model} {score} {n}', 'evaluate regression performance']
REGISTERING AS compare {model1} and {model2} using {metric} ['compare {model1} and {model2} using {metric}', 'compare {model1} {model2} using {metric}', 'which model is better under {metric}, {model1} or {model2}']
REGISTERING AS find the best l2 regularization parameter for {model} with {metric} ['find the best l2 regularization parameter for {model} with {metric}', 'best regularization for {model} {metric}', 'best l2 parameter for {model} under {metric}']
REGISTERING AS compute auc curve data for {model} ['compute auc curve data for {model}', 'auc curve {model}', 'auc data for {model}']
REGISTERING AS plot auc curve from {data} ['plot auc curve from {data}', 'plot auc data {data}', 'plot {data} auc']
REGISTERING AS plot auc curve for {model} ['plot auc curve for {model}', 'plot auc curve for model {model}']
REGISTERING AS plot two-sample test {data} ['plot two-sample test {data}', 'plot p-values {data}']
REGISTERING AS plot a histogram on {data} ['plot a histogram on {data}', 'plot histogram {data}', 'histogram {data}']
REGISTERING AS plot bars {data1} {data2} ['plot bars {data1} {data2}', 'plot barchart {data1} {data2}', 'barchart {data1} {data2}']
REGISTERING AS take mean of {array} ['take mean of {array}', 'mean of {array} of numbers', 'mean {array}', 'average of {array}', 'average value of {array}']
REGISTERING AS log-transform {array} ['log-transform {array}', 'log-transform {array} of numbers', 'log {array}', 'log of {array}', 'log value of {array}']
REGISTERING AS compute pearson correlation: {x} and {y} ['compute pearson correlation: {x} and {y}', 'pearson correlation between {x} and {y}', 'pearson correlation {x} {y}', 'how are {x} and {y} correlated']
REGISTERING AS find quartiles {array} ['find quartiles {array}']
REGISTERING AS two-sample statistical test {stats_test} on columns in {data1} and {data2} ['two-sample statistical test {stats_test} on columns in {data1} and {data2}', 'two-sample {stats_test} on columns in {data1} {data2}']
REGISTERING AS apply bonferroni correction to {data} ['apply bonferroni correction to {data}', 'bonferroni {data}']
REGISTERING AS apply holm correction to {data} ['apply holm correction to {data}', 'holm {data}']
REGISTERING AS show significant values for {data} ['show significant values for {data}', 'significant values {data}']
REGISTERING AS calculate two sample Student t-test on {x} and {y} ['calculate two sample Student t-test on {x} and {y}', 'Student t-test on {x} {y}', 'statistical test', 'two sample statistical test', 'test statistic']
REGISTERING AS calculate Welch t-test on {x} and {y} ['calculate Welch t-test on {x} and {y}', 'Welch t-test on {x} and {y}', 'statistical test', 'two sample statistical test', 'statistical']
REGISTERING AS calculate Mann-Whitney U test on {x} and {y} ['calculate Mann-Whitney U test on {x} and {y}', 'Mann-Whitney U test on {x} and {y}', 'statistical test', 'two sample statistical test']
REGISTERING AS help me run a t-test ['help me run a t-test']
REGISTERING AS test workloop ['test workloop']
REGISTERING AS while statement ['while statement']
REGISTERING AS if statement ['if statement']
REGISTERING AS poke holes ['poke holes']
REGISTERING AS convert entire interaction into a Python script ['convert entire interaction into a Python script']
REGISTERING AS inspect code for previous command ['inspect code for previous command']
REGISTERING AS save last iris command as {name} ['save last iris command as {name}', 'save last iris command {name}']
REGISTERING AS run liwc analysis on {documents} ['run liwc analysis on {documents}', 'liwc {documents}']
REGISTERING AS select the most positive coefficients for {class_name} in {coefficients} ['select the most positive coefficients for {class_name} in {coefficients}']
REGISTERING AS compute Go term enrichment on {gene_list} ['compute Go term enrichment on {gene_list}', 'compute Go term enrichment on a list of gene symbols']
REGISTERING AS generate empath category ['generate empath category', 'empath category']
REGISTERING AS analyze topics in {documents} ['analyze topics in {documents}', 'empath {documents}']
REGISTERING AS get tweets from {user} ['get tweets from {user}', 'tweet from {user}', 'what has {user} tweeted on twitter']
REGISTERING AS search tweets ['search tweets', 'search tweet for term on twitter']
15 changes: 15 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react'
import ReactDOM from 'react-dom'

var HelloBox = React.createClass({

render: function() {
return (
<div className="helloTag">
Hello world from ReactJS
</div>
);
}
});

ReactDOM.render(<HelloBox/>, document.getElementById('helloTag'));
141 changes: 141 additions & 0 deletions app/actions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import * as types from './types';

export function filterTable(filter) {
return {
type: types.FILTER,
filter
};
}

export function addMessage(message) {
return {
type: types.ADD_MESSAGE,
...message
};
}

export function addInputHistory(message) {
return {
type: types.ADD_INPUT_HISTORY,
...message
};
}

export function moveInputHistory(message) {
return {
type: types.MOVE_INPUT_HISTORY,
...message
};
}

export function hint(message) {
return {
type: types.HINT,
...message
};
}

export function updateFunc(message) {
return {
type: types.UPDATE_FUNC,
...message
};
}

export function updateResults(message) {
return {
type: types.UPDATE_RESULTS,
...message
};
}

export function updateDocEvent(message) {
return {
type: types.UPDATE_DOCS,
...message
};
}

export function setDocs(message) {
return {
type: types.SET_DOCS,
...message
};
}

export function setCodeEdit(message) {
return {
type: types.SET_CODE_EDIT,
...message
};
}

export function updateCodeEditor(name, value) {
return {
type: types.UPDATE_CODE_EDITOR,
value: value,
name: name
};
}

export function addCommandArg() {
return {
type: types.ADD_COMMAND_ARG,
};
}

export function addExample() {
return {
type: types.ADD_COMMAND_EXAMPLE,
};
}

export function updateCommandArg(id, values) {
return {
type: types.UPDATE_COMMAND_ARG,
id,
values:values
};
}

export function deleteCommandArg(id) {
return {
type: types.DELETE_COMMAND_ARG,
id,
};
}

export function deleteCommandExample(id) {
return {
type: types.DELETE_COMMAND_EXAMPLE,
id,
};
}

export function updateCommandExample(id, text) {
return {
type: types.UPDATE_COMMAND_EXAMPLE,
id,
text,
};
}

export function storeCurrentInput(input) {
return {
type: types.STORE_CURRENT_INPUT,
currentInput: input
};
}

export function hideConversation(id) {
return {
type: types.HIDE_CONVERSATION,
id
};
}

export function resetCommand() {
return {
type: types.RESET_COMMAND,
};
}
23 changes: 23 additions & 0 deletions app/actions/types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export const UPDATE_PREDICTIONS = 'UPDATE_PREDICTIONS';
export const ADD_INPUT_HISTORY = 'ADD_INPUT_HISTORY';
export const STORE_CURRENT_INPUT = 'STORE_CURRENT_INPUT';
export const MOVE_INPUT_HISTORY = 'MOVE_INPUT_HISTORY';
export const ADD_MESSAGE = 'ADD_MESSAGE';
export const ADD_SERVER_MESSAGE = 'ADD_SERVER_MESSAGE';
export const UPDATE_VARIABLES = 'UPDATE_VARIABLES';
export const UPDATE_HISTORY = 'UPDATE_HISTORY'; // convo history
export const HIDE_CONVERSATION = 'HIDE_CONVERSATION';
export const UPDATE_DOCS = 'UPDATE_DOCS';
export const UPDATE_FUNC = 'UPDATE_FUNC';
export const UPDATE_RESULTS = 'UPDATE_RESULTS';
export const SET_DOCS = 'SET_DOCS';
export const SET_CODE_EDIT = 'SET_CODE_EDIT';
export const UPDATE_CODE_EDITOR = 'UPDATE_CODE_EDITOR';
export const ADD_COMMAND_ARG = 'ADD_COMMAND_ARG';
export const UPDATE_COMMAND_ARG = 'UPDATE_COMMAND_ARG';
export const DELETE_COMMAND_ARG = 'DELETE_COMMAND_ARG';
export const ADD_COMMAND_EXAMPLE = 'ADD_COMMAND_EXAMPLE';
export const DELETE_COMMAND_EXAMPLE = 'DELETE_COMMAND_EXAMPLE';
export const UPDATE_COMMAND_EXAMPLE = 'UPDATE_COMMAND_EXAMPLE';
export const UPDATE_COMMAND = 'UPDATE_COMMAND';
export const RESET_COMMAND = 'RESET_COMMAND';
119 changes: 119 additions & 0 deletions app/api_calls/python.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import fetch from 'isomorphic-fetch';
import dispatch from '../index.js';
import { updateCodeEditor } from '../actions/index.js';

export const postMessages = (messages, state, conversation) => {
fetch('http://localhost:8000/new_loop', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({messages, state, conversation})
})
.then(response => response.json())
.then(json => {
dispatch(json);
dispatch({'type': 'UPDATE_VARIABLES', 'variables': json.variables});
})
.then(() => {
dispatch({'type': 'UPDATE_PREDICTIONS', 'predictions': [] });
});
};

export const updateHint = (text) => {
fetch('http://localhost:8000/hint', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({text})
})
.then(response => response.json())
.then(json => {
console.log(json);
dispatch({'type': 'UPDATE_PREDICTIONS', 'predictions': json.predictions});
});
};

export const updateDocs = (text) => {
fetch('http://localhost:8000/docs', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({text})
})
.then(response => response.json())
.then(json => {
console.log(json);
dispatch({'type': 'UPDATE_DOCS', 'doc': json.doc});
dispatch({'type': 'UPDATE_COMMAND', 'command': json.command});
});
};

export const doSearch = (text) => {
fetch('http://localhost:8000/function_list', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({text})
})
.then(response => response.json())
.then(json => {
console.log("UPDATE RESULTS", json);
dispatch({'type': 'UPDATE_RESULTS', 'results': json});
});
};

export const testFunction = (text) => {
console.log(text);
fetch('http://localhost:8000/function_test', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(text)
})
.then(response => response.json())
.then(json => {
console.log("UPDATE Test", json);
dispatch(updateCodeEditor('preview', json.func_string));
dispatch(updateCodeEditor('error', json.error.error_string));
// dispatch({'type': 'UPDATE_RESULTS', 'results': json});
});
};

export const setHistory = (messages, state, conversation) => {
fetch('http://localhost:8000/set_history', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({messages, state, conversation})
});
};

export const getVariables = () => {
fetch('http://localhost:8000/variables', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(json => dispatch(json));
};

export const getHistory = () => {
fetch('http://localhost:8000/history', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(json => dispatch(json));
};

// export default { postMessages, getVariables };
Loading

0 comments on commit 897a15f

Please sign in to comment.