hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
⌀
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
0d2939abfb34717f2d595a7d4da9bf3a39e52861
crgalley/romspline
romspline/random_seeds.py
[ "MIT" ]
Python
make
null
def make(self, x, y, Nseeds, parallel=True): """Make reduced-order splines for Nseeds number of random sets of seed points. Input ----- x -- samples y -- data to be downsampled Nseeds -- number of random sets of seed points parallel -- parallelize the computation...
Make reduced-order splines for Nseeds number of random sets of seed points. Input ----- x -- samples y -- data to be downsampled Nseeds -- number of random sets of seed points parallel -- parallelize the computation for each random seed set? (defaul...
Make reduced-order splines for Nseeds number of random sets of seed points. Input Attributes Comments The `parallel` option also accepts positive integers indicating the number of processors that the user wants to use. Parallelization uses some features from the concurrent.futures module.
[ "Make", "reduced", "-", "order", "splines", "for", "Nseeds", "number", "of", "random", "sets", "of", "seed", "points", ".", "Input", "Attributes", "Comments", "The", "`", "parallel", "`", "option", "also", "accepts", "positive", "integers", "indicating", "the"...
def make(self, x, y, Nseeds, parallel=True): self.errors = np.zeros(Nseeds, dtype='double') self.sizes = np.zeros(Nseeds, dtype='double') self.seeds = np.zeros((Nseeds, self._deg+1), dtype='double') self.Xs = [] if ...
[ "def", "make", "(", "self", ",", "x", ",", "y", ",", "Nseeds", ",", "parallel", "=", "True", ")", ":", "self", ".", "errors", "=", "np", ".", "zeros", "(", "Nseeds", ",", "dtype", "=", "'double'", ")", "self", ".", "sizes", "=", "np", ".", "zer...
Make reduced-order splines for Nseeds number of random sets of seed points.
[ "Make", "reduced", "-", "order", "splines", "for", "Nseeds", "number", "of", "random", "sets", "of", "seed", "points", "." ]
[ "\"\"\"Make reduced-order splines for Nseeds number of random sets of seed points.\n \n Input\n -----\n x -- samples\n y -- data to be downsampled\n Nseeds -- number of random sets of seed points\n parallel -- parallelize the computation for each random seed set?\n ...
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "Nseeds", "type": null }, { "param": "parallel", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
0d2939abfb34717f2d595a7d4da9bf3a39e52861
crgalley/romspline
romspline/random_seeds.py
[ "MIT" ]
Python
plot_sizes
<not_specific>
def plot_sizes(self, n=20, ax=None, show=True, xlabel='Size of reduced data', ylabel='Occurrence'): """Plot a histogram of the reduced data sizes produced by building reduced-order splines from random sets of seed points. Input ----- n -- number of histogram bins (default...
Plot a histogram of the reduced data sizes produced by building reduced-order splines from random sets of seed points. Input ----- n -- number of histogram bins (default 20) ax -- matplotlib plot/axis object (default None) show -- display the...
Plot a histogram of the reduced data sizes produced by building reduced-order splines from random sets of seed points. Input Output If show=True then the plot is displayed. Otherwise, the matplotlib plot/axis object is output.
[ "Plot", "a", "histogram", "of", "the", "reduced", "data", "sizes", "produced", "by", "building", "reduced", "-", "order", "splines", "from", "random", "sets", "of", "seed", "points", ".", "Input", "Output", "If", "show", "=", "True", "then", "the", "plot",...
def plot_sizes(self, n=20, ax=None, show=True, xlabel='Size of reduced data', ylabel='Occurrence'): if self._made: if ax is None: fig, ax = plt.subplots(nrows=1, ncols=1) ax.hist(self.sizes, n, color='k', alpha=0.33); mean = np.mean(self.sizes) std = np.std(self.sizes) ax.axvli...
[ "def", "plot_sizes", "(", "self", ",", "n", "=", "20", ",", "ax", "=", "None", ",", "show", "=", "True", ",", "xlabel", "=", "'Size of reduced data'", ",", "ylabel", "=", "'Occurrence'", ")", ":", "if", "self", ".", "_made", ":", "if", "ax", "is", ...
Plot a histogram of the reduced data sizes produced by building reduced-order splines from random sets of seed points.
[ "Plot", "a", "histogram", "of", "the", "reduced", "data", "sizes", "produced", "by", "building", "reduced", "-", "order", "splines", "from", "random", "sets", "of", "seed", "points", "." ]
[ "\"\"\"Plot a histogram of the reduced data sizes produced by building\n reduced-order splines from random sets of seed points.\n \n Input\n -----\n n -- number of histogram bins\n (default 20)\n ax -- matplotlib plot/axis object\n (default None)\n s...
[ { "param": "self", "type": null }, { "param": "n", "type": null }, { "param": "ax", "type": null }, { "param": "show", "type": null }, { "param": "xlabel", "type": null }, { "param": "ylabel", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n", "type": null, "docstring": null, "docstring_tokens": [], ...
0d2939abfb34717f2d595a7d4da9bf3a39e52861
crgalley/romspline
romspline/random_seeds.py
[ "MIT" ]
Python
small_spline
<not_specific>
def small_spline(x, y, num, tol=1e-6, deg=None, rel=False, parallel=True, verbose=False): """Build reduced-order splines for a number of randomly selected input seed points for the purpose of finding the spline with the smallest such reduced data over the sampled seeds. The degree of the spline polynomial can a...
Build reduced-order splines for a number of randomly selected input seed points for the purpose of finding the spline with the smallest such reduced data over the sampled seeds. The degree of the spline polynomial can also be varied. Input ----- x -- samples y -- data to be downsample...
Build reduced-order splines for a number of randomly selected input seed points for the purpose of finding the spline with the smallest such reduced data over the sampled seeds. The degree of the spline polynomial can also be varied. Input Output Reduced-order spline object with the smallest reduced data size for ...
[ "Build", "reduced", "-", "order", "splines", "for", "a", "number", "of", "randomly", "selected", "input", "seed", "points", "for", "the", "purpose", "of", "finding", "the", "spline", "with", "the", "smallest", "such", "reduced", "data", "over", "the", "sampl...
def small_spline(x, y, num, tol=1e-6, deg=None, rel=False, parallel=True, verbose=False): if deg is None: degs = range(1, 6) else: if len(np.shape(deg)) == 1: degs = deg elif len(np.shape(deg)) == 0: degs = [deg] else: raise Exception("Input for `deg` option...
[ "def", "small_spline", "(", "x", ",", "y", ",", "num", ",", "tol", "=", "1e-6", ",", "deg", "=", "None", ",", "rel", "=", "False", ",", "parallel", "=", "True", ",", "verbose", "=", "False", ")", ":", "if", "deg", "is", "None", ":", "degs", "="...
Build reduced-order splines for a number of randomly selected input seed points for the purpose of finding the spline with the smallest such reduced data over the sampled seeds.
[ "Build", "reduced", "-", "order", "splines", "for", "a", "number", "of", "randomly", "selected", "input", "seed", "points", "for", "the", "purpose", "of", "finding", "the", "spline", "with", "the", "smallest", "such", "reduced", "data", "over", "the", "sampl...
[ "\"\"\"Build reduced-order splines for a number of randomly selected\n input seed points for the purpose of finding the spline with the\n smallest such reduced data over the sampled seeds. The degree of\n the spline polynomial can also be varied.\n \n Input\n -----\n x -- samples\n y -- da...
[ { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "num", "type": null }, { "param": "tol", "type": null }, { "param": "deg", "type": null }, { "param": "rel", "type": null }, { "param": "parallel", "type": null ...
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "y", "type": null, "docstring": null, "docstring_tokens": [], ...
d98b9de9e2d7b2f977b6341cf3f45f881ed58532
crgalley/romspline
romspline/cross_validation.py
[ "MIT" ]
Python
_cross_validation
<not_specific>
def _cross_validation(x, y, validation, training, tol=1e-6, rel=False, deg=5): """K-fold cross validation on a given partition Input ----- x -- samples y -- data values at samples validation -- validation subset of data indexes training -- training subset of data indexes ...
K-fold cross validation on a given partition Input ----- x -- samples y -- data values at samples validation -- validation subset of data indexes training -- training subset of data indexes tol -- L-infinity error tolerance for reduced-order spline ...
K-fold cross validation on a given partition Input Output sample index where largest validation error occurs largest validation error Comment The union of the validation and training subsets must contain all the data array indexes.
[ "K", "-", "fold", "cross", "validation", "on", "a", "given", "partition", "Input", "Output", "sample", "index", "where", "largest", "validation", "error", "occurs", "largest", "validation", "error", "Comment", "The", "union", "of", "the", "validation", "and", ...
def _cross_validation(x, y, validation, training, tol=1e-6, rel=False, deg=5): assert len(x) == len(y), "Expecting x and y arrays to have same lengths." assert len(np.hstack([validation, training])) == len(x), "Expecting union of validation and training sets to have same lengths as x and y arrays." x_training = x...
[ "def", "_cross_validation", "(", "x", ",", "y", ",", "validation", ",", "training", ",", "tol", "=", "1e-6", ",", "rel", "=", "False", ",", "deg", "=", "5", ")", ":", "assert", "len", "(", "x", ")", "==", "len", "(", "y", ")", ",", "\"Expecting x...
K-fold cross validation on a given partition Input
[ "K", "-", "fold", "cross", "validation", "on", "a", "given", "partition", "Input" ]
[ "\"\"\"K-fold cross validation on a given partition\n \n Input\n -----\n x -- samples\n y -- data values at samples\n validation -- validation subset of data indexes\n training -- training subset of data indexes\n tol -- L-infinity error tolerance for reduced-order splin...
[ { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "validation", "type": null }, { "param": "training", "type": null }, { "param": "tol", "type": null }, { "param": "rel", "type": null }, { "param": "deg", "type"...
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "y", "type": null, "docstring": null, "docstring_tokens": [], ...
d98b9de9e2d7b2f977b6341cf3f45f881ed58532
crgalley/romspline
romspline/cross_validation.py
[ "MIT" ]
Python
Kfold
null
def Kfold(self, x, y, K=10, parallel=True, random=True): """K-fold cross-validation Input ----- x -- samples y -- data to be downsampled K -- number of partitions (default 10) parallel -- parallelize the computation over each partition? ...
K-fold cross-validation Input ----- x -- samples y -- data to be downsampled K -- number of partitions (default 10) parallel -- parallelize the computation over each partition? (default True) random -- fill the partiti...
K-fold cross-validation Input Attributes args -- data array indexes of largest validation errors on each validation set errors -- validation errors on each validation set Comments The default option for `K` is 10 so that a random 10% subset of the data is used to validate the trial reduced-order splines. If `r...
[ "K", "-", "fold", "cross", "-", "validation", "Input", "Attributes", "args", "--", "data", "array", "indexes", "of", "largest", "validation", "errors", "on", "each", "validation", "set", "errors", "--", "validation", "errors", "on", "each", "validation", "set"...
def Kfold(self, x, y, K=10, parallel=True, random=True): assert len(x) == len(y), "Expecting input data to have same length." self._K = int(K) self._size = len(x) self.args = np.zeros(K, dtype='int') self.errors = np.zeros(K, dtype='double') if random: self._partitions = random_partitions(...
[ "def", "Kfold", "(", "self", ",", "x", ",", "y", ",", "K", "=", "10", ",", "parallel", "=", "True", ",", "random", "=", "True", ")", ":", "assert", "len", "(", "x", ")", "==", "len", "(", "y", ")", ",", "\"Expecting input data to have same length.\""...
K-fold cross-validation Input
[ "K", "-", "fold", "cross", "-", "validation", "Input" ]
[ "\"\"\"K-fold cross-validation\n \n Input\n -----\n x -- samples\n y -- data to be downsampled\n K -- number of partitions\n (default 10)\n parallel -- parallelize the computation over each partition?\n (default True)\n random ...
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "K", "type": null }, { "param": "parallel", "type": null }, { "param": "random", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
d98b9de9e2d7b2f977b6341cf3f45f881ed58532
crgalley/romspline
romspline/cross_validation.py
[ "MIT" ]
Python
MonteCarloKfold
null
def MonteCarloKfold(self, x, y, n, K=10, parallel=True, random=True, verbose=False): """Perform a number n of K-fold cross-validations Input ----- x -- samples y -- data to be downsampled n -- number of times to repeat K-fold cross-validation wit...
Perform a number n of K-fold cross-validations Input ----- x -- samples y -- data to be downsampled n -- number of times to repeat K-fold cross-validation with a random distribution of the data into the K partitions K ...
Perform a number n of K-fold cross-validations Input Attributes all_args -- array of data array indexes of validation errors on each validation set all_errors -- array of validation errors on each realized validation set Comments The default option for `K` is 10 so that a random 10% subset of the data is used t...
[ "Perform", "a", "number", "n", "of", "K", "-", "fold", "cross", "-", "validations", "Input", "Attributes", "all_args", "--", "array", "of", "data", "array", "indexes", "of", "validation", "errors", "on", "each", "validation", "set", "all_errors", "--", "arra...
def MonteCarloKfold(self, x, y, n, K=10, parallel=True, random=True, verbose=False): self.all_args = np.zeros((n,K), dtype='int') self.all_errors = np.zeros((n,K), dtype='double') self.all_args_ge_tol = [] self.all_errors_ge_tol = [] for nn in range(n): if verbose and not (nn+1)%10: pr...
[ "def", "MonteCarloKfold", "(", "self", ",", "x", ",", "y", ",", "n", ",", "K", "=", "10", ",", "parallel", "=", "True", ",", "random", "=", "True", ",", "verbose", "=", "False", ")", ":", "self", ".", "all_args", "=", "np", ".", "zeros", "(", "...
Perform a number n of K-fold cross-validations Input
[ "Perform", "a", "number", "n", "of", "K", "-", "fold", "cross", "-", "validations", "Input" ]
[ "\"\"\"Perform a number n of K-fold cross-validations\n \n Input\n -----\n x -- samples\n y -- data to be downsampled\n n -- number of times to repeat K-fold cross-validation\n with a random distribution of the data into the \n K partiti...
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "n", "type": null }, { "param": "K", "type": null }, { "param": "parallel", "type": null }, { "param": "random", "type": null ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
d98b9de9e2d7b2f977b6341cf3f45f881ed58532
crgalley/romspline
romspline/cross_validation.py
[ "MIT" ]
Python
stats
null
def stats(self): """Compute means and medians of each set of validation errors from a Monte Carlo K-fold cross-validation study. The validation errors considered are those greater than or equal to the reduced-order spline tolerance. Attributes Made --------------- means_all_errors_ge...
Compute means and medians of each set of validation errors from a Monte Carlo K-fold cross-validation study. The validation errors considered are those greater than or equal to the reduced-order spline tolerance. Attributes Made --------------- means_all_errors_ge_tol -- means of each ...
Compute means and medians of each set of validation errors from a Monte Carlo K-fold cross-validation study. The validation errors considered are those greater than or equal to the reduced-order spline tolerance. Attributes Made Comments A single trial of a Monte Carlo K-fold cross-validation study produces K vali...
[ "Compute", "means", "and", "medians", "of", "each", "set", "of", "validation", "errors", "from", "a", "Monte", "Carlo", "K", "-", "fold", "cross", "-", "validation", "study", ".", "The", "validation", "errors", "considered", "are", "those", "greater", "than"...
def stats(self): _means = [] _medians = [] for ee in self.all_errors_ge_tol: if ee != []: _means.append( np.mean(ee) ) _medians.append( np.median(ee) ) self.means_all_errors_ge_tol = _means self.medians_all_errors_ge_tol = _medians
[ "def", "stats", "(", "self", ")", ":", "_means", "=", "[", "]", "_medians", "=", "[", "]", "for", "ee", "in", "self", ".", "all_errors_ge_tol", ":", "if", "ee", "!=", "[", "]", ":", "_means", ".", "append", "(", "np", ".", "mean", "(", "ee", ")...
Compute means and medians of each set of validation errors from a Monte Carlo K-fold cross-validation study.
[ "Compute", "means", "and", "medians", "of", "each", "set", "of", "validation", "errors", "from", "a", "Monte", "Carlo", "K", "-", "fold", "cross", "-", "validation", "study", "." ]
[ "\"\"\"Compute means and medians of each set of validation errors from \n a Monte Carlo K-fold cross-validation study. The validation errors\n considered are those greater than or equal to the reduced-order\n spline tolerance.\n \n Attributes Made\n ---------------\n means_all_errors_ge_tol ...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d98b9de9e2d7b2f977b6341cf3f45f881ed58532
crgalley/romspline
romspline/cross_validation.py
[ "MIT" ]
Python
plot_monte_carlo_errors
<not_specific>
def plot_monte_carlo_errors(self, x=None, n=20, axes='plot', ax=None, show=True, color='k', marker='.'): """Plot all the Monte Carlo K-fold cross-validation errors versus the samples at which the error is recorded in each of the validation partitions. Input ----- x -- samples ...
Plot all the Monte Carlo K-fold cross-validation errors versus the samples at which the error is recorded in each of the validation partitions. Input ----- x -- samples (default None) n -- number of bins if plotting a histogram axes -- axis scales for ...
Plot all the Monte Carlo K-fold cross-validation errors versus the samples at which the error is recorded in each of the validation partitions. Input
[ "Plot", "all", "the", "Monte", "Carlo", "K", "-", "fold", "cross", "-", "validation", "errors", "versus", "the", "samples", "at", "which", "the", "error", "is", "recorded", "in", "each", "of", "the", "validation", "partitions", ".", "Input" ]
def plot_monte_carlo_errors(self, x=None, n=20, axes='plot', ax=None, show=True, color='k', marker='.'): if self._made and state._MATPLOTLIB: self.stats() if ax is None: fig, ax = plt.subplots(nrows=1, ncols=1) args = np.asarray(self.all_args).flatten() errors = np.asarray(self.all_e...
[ "def", "plot_monte_carlo_errors", "(", "self", ",", "x", "=", "None", ",", "n", "=", "20", ",", "axes", "=", "'plot'", ",", "ax", "=", "None", ",", "show", "=", "True", ",", "color", "=", "'k'", ",", "marker", "=", "'.'", ")", ":", "if", "self", ...
Plot all the Monte Carlo K-fold cross-validation errors versus the samples at which the error is recorded in each of the validation partitions.
[ "Plot", "all", "the", "Monte", "Carlo", "K", "-", "fold", "cross", "-", "validation", "errors", "versus", "the", "samples", "at", "which", "the", "error", "is", "recorded", "in", "each", "of", "the", "validation", "partitions", "." ]
[ "\"\"\"Plot all the Monte Carlo K-fold cross-validation errors\n versus the samples at which the error is recorded \n in each of the validation partitions.\n \n Input\n -----\n x -- samples\n (default None)\n n -- number of bins if plotting a histogram\n axes ...
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "n", "type": null }, { "param": "axes", "type": null }, { "param": "ax", "type": null }, { "param": "show", "type": null }, { "param": "color", "type": null ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
fbb9a1e8ce9d5cfbdad000f80897a94d355fb125
crgalley/romspline
romspline/convergence.py
[ "MIT" ]
Python
make
null
def make(self, x, y, levs=None): """Decimate the input data at the required levs and compute the resulting reduced-order spline interpolants. Input ----- x -- samples y -- data to be downsampled levs -- decimation levels (levs) such that if levs=4 then every ...
Decimate the input data at the required levs and compute the resulting reduced-order spline interpolants. Input ----- x -- samples y -- data to be downsampled levs -- decimation levels (levs) such that if levs=4 then every fourth entry is skipped for building the...
Decimate the input data at the required levs and compute the resulting reduced-order spline interpolants. Input Attributes
[ "Decimate", "the", "input", "data", "at", "the", "required", "levs", "and", "compute", "the", "resulting", "reduced", "-", "order", "spline", "interpolants", ".", "Input", "Attributes" ]
def make(self, x, y, levs=None): if levs is None: self.levs = np.array([8, 4, 2]) else: self.levs = np.array(levs) if 1 not in self.levs: self.levs = np.hstack([self.levs, 1]) if self._spline: self.splines[1] = self._spline else: self.splines[1] = greedy.ReducedOrderSpl...
[ "def", "make", "(", "self", ",", "x", ",", "y", ",", "levs", "=", "None", ")", ":", "if", "levs", "is", "None", ":", "self", ".", "levs", "=", "np", ".", "array", "(", "[", "8", ",", "4", ",", "2", "]", ")", "else", ":", "self", ".", "lev...
Decimate the input data at the required levs and compute the resulting reduced-order spline interpolants.
[ "Decimate", "the", "input", "data", "at", "the", "required", "levs", "and", "compute", "the", "resulting", "reduced", "-", "order", "spline", "interpolants", "." ]
[ "\"\"\"Decimate the input data at the required levs and compute the \n resulting reduced-order spline interpolants.\n \n Input\n -----\n x -- samples\n y -- data to be downsampled\n levs -- decimation levels (levs) such that if levs=4 then \n every fourth entry is skipp...
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "levs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
seed
null
def seed(self, x, seeds=None): """Seed the greedy algorithm with (deg+1) evenly spaced indices""" if seeds is None: f = lambda m, n: [ii*n//m + n//(2*m) for ii in range(m)] self.indices = np.sort(np.hstack([[0, len(x)-1], f(self._deg-1, len(x))])) else: self.indices = seeds self.errors...
Seed the greedy algorithm with (deg+1) evenly spaced indices
Seed the greedy algorithm with (deg+1) evenly spaced indices
[ "Seed", "the", "greedy", "algorithm", "with", "(", "deg", "+", "1", ")", "evenly", "spaced", "indices" ]
def seed(self, x, seeds=None): if seeds is None: f = lambda m, n: [ii*n//m + n//(2*m) for ii in range(m)] self.indices = np.sort(np.hstack([[0, len(x)-1], f(self._deg-1, len(x))])) else: self.indices = seeds self.errors = [] self.args = self.indices[:]
[ "def", "seed", "(", "self", ",", "x", ",", "seeds", "=", "None", ")", ":", "if", "seeds", "is", "None", ":", "f", "=", "lambda", "m", ",", "n", ":", "[", "ii", "*", "n", "//", "m", "+", "n", "//", "(", "2", "*", "m", ")", "for", "ii", "...
Seed the greedy algorithm with (deg+1) evenly spaced indices
[ "Seed", "the", "greedy", "algorithm", "with", "(", "deg", "+", "1", ")", "evenly", "spaced", "indices" ]
[ "\"\"\"Seed the greedy algorithm with (deg+1) evenly spaced indices\"\"\"", "# Keep track of unsorted indices selected by greedy algorithm" ]
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "seeds", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
greedy
null
def greedy(self, x, y, tol=1e-6, rel=False, deg=5, verbose=False, seeds=None): """ Greedy algorithm for finding optimal knots to build a reduced-order spline interpolant Input ----- x -- samples y -- data to be downsampled deg -- degree of interpolating polynomials ...
Greedy algorithm for finding optimal knots to build a reduced-order spline interpolant Input ----- x -- samples y -- data to be downsampled deg -- degree of interpolating polynomials (default 5) tol -- L-infinity error tolerance for reduced-orde...
Greedy algorithm for finding optimal knots to build a reduced-order spline interpolant Input Output attributes Comments If x is not given then interpolation is built using y array index labels as the samples.
[ "Greedy", "algorithm", "for", "finding", "optimal", "knots", "to", "build", "a", "reduced", "-", "order", "spline", "interpolant", "Input", "Output", "attributes", "Comments", "If", "x", "is", "not", "given", "then", "interpolation", "is", "built", "using", "y...
def greedy(self, x, y, tol=1e-6, rel=False, deg=5, verbose=False, seeds=None): self._deg = deg self._rel = rel if rel: ymax = np.max(np.abs(y)) assert ymax > 0., "All data samples are zero." else: ymax = 1. self._tol = tol if seeds is None: self._seed = _seed(x, deg=self....
[ "def", "greedy", "(", "self", ",", "x", ",", "y", ",", "tol", "=", "1e-6", ",", "rel", "=", "False", ",", "deg", "=", "5", ",", "verbose", "=", "False", ",", "seeds", "=", "None", ")", ":", "self", ".", "_deg", "=", "deg", "self", ".", "_rel"...
Greedy algorithm for finding optimal knots to build a reduced-order spline interpolant
[ "Greedy", "algorithm", "for", "finding", "optimal", "knots", "to", "build", "a", "reduced", "-", "order", "spline", "interpolant" ]
[ "\"\"\"\n Greedy algorithm for finding optimal knots to build a reduced-order \n spline interpolant\n \n Input\n -----\n x -- samples\n y -- data to be downsampled\n deg -- degree of interpolating polynomials \n (default 5)\n tol -- L-infinity error toler...
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "tol", "type": null }, { "param": "rel", "type": null }, { "param": "deg", "type": null }, { "param": "verbose", "type": null ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
eval
<not_specific>
def eval(self, x, dx=0): """Evaluate reduced-order spline or its dx derviatives at x Input ----- x -- samples dx -- number of derivatives of the spline evaluation to compute (default 0) Output ------ Array of reduced-order spline evaluations at the ...
Evaluate reduced-order spline or its dx derviatives at x Input ----- x -- samples dx -- number of derivatives of the spline evaluation to compute (default 0) Output ------ Array of reduced-order spline evaluations at the samples `x` and `dx` number...
Evaluate reduced-order spline or its dx derviatives at x Input x -- samples dx -- number of derivatives of the spline evaluation to compute (default 0) Output Array of reduced-order spline evaluations at the samples `x` and `dx` number of derivatives computed. Comments The max number of derivatives that can be co...
[ "Evaluate", "reduced", "-", "order", "spline", "or", "its", "dx", "derviatives", "at", "x", "Input", "x", "--", "samples", "dx", "--", "number", "of", "derivatives", "of", "the", "spline", "evaluation", "to", "compute", "(", "default", "0", ")", "Output", ...
def eval(self, x, dx=0): return self._spline(x, dx)
[ "def", "eval", "(", "self", ",", "x", ",", "dx", "=", "0", ")", ":", "return", "self", ".", "_spline", "(", "x", ",", "dx", ")" ]
Evaluate reduced-order spline or its dx derviatives at x Input
[ "Evaluate", "reduced", "-", "order", "spline", "or", "its", "dx", "derviatives", "at", "x", "Input" ]
[ "\"\"\"Evaluate reduced-order spline or its dx derviatives at x\n \n Input\n -----\n x -- samples\n dx -- number of derivatives of the spline evaluation\n to compute\n (default 0)\n \n Output\n ------\n Array of reduced-order spline evaluations at the samples `x...
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "dx", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
test
<not_specific>
def test(self, x, y, abs=True, dx=0, verbose=False): """Test (or verify) the reduced-order spline on some given data. If the data is the training set then this function verifies that the spline meets the requested tolerance. Input ----- x -- samples y -- data values at s...
Test (or verify) the reduced-order spline on some given data. If the data is the training set then this function verifies that the spline meets the requested tolerance. Input ----- x -- samples y -- data values at samples abs -- output absolute values of error? ...
Test (or verify) the reduced-order spline on some given data. If the data is the training set then this function verifies that the spline meets the requested tolerance. Input Output Absolute errors between the data values (y) and the reduced order spline interpolant's prediction. Comments The max number of deriv...
[ "Test", "(", "or", "verify", ")", "the", "reduced", "-", "order", "spline", "on", "some", "given", "data", ".", "If", "the", "data", "is", "the", "training", "set", "then", "this", "function", "verifies", "that", "the", "spline", "meets", "the", "request...
def test(self, x, y, abs=True, dx=0, verbose=False): if self._made: errors = y - self._spline(x, dx) if abs: errors = np.abs(errors) else: raise Exception("No spline interpolant to compare against. Run the greedy method.") if verbose: print("Requested tolerance of {} met: ".f...
[ "def", "test", "(", "self", ",", "x", ",", "y", ",", "abs", "=", "True", ",", "dx", "=", "0", ",", "verbose", "=", "False", ")", ":", "if", "self", ".", "_made", ":", "errors", "=", "y", "-", "self", ".", "_spline", "(", "x", ",", "dx", ")"...
Test (or verify) the reduced-order spline on some given data.
[ "Test", "(", "or", "verify", ")", "the", "reduced", "-", "order", "spline", "on", "some", "given", "data", "." ]
[ "\"\"\"Test (or verify) the reduced-order spline on some given data.\n If the data is the training set then this function verifies that\n the spline meets the requested tolerance.\n \n Input\n -----\n x -- samples\n y -- data values at samples\n abs -- output absolute v...
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "abs", "type": null }, { "param": "dx", "type": null }, { "param": "verbose", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
write
null
def write(self, file, slim=False): """ Write spline interpolant data in HDF5 or text format Input ===== file -- write data to this file slim -- export minimal data to this file (i.e., exclude writing errors array) (default False) Comments ======== Data written ...
Write spline interpolant data in HDF5 or text format Input ===== file -- write data to this file slim -- export minimal data to this file (i.e., exclude writing errors array) (default False) Comments ======== Data written to file includes: deg -- d...
Write spline interpolant data in HDF5 or text format Input - write data to this file slim -- export minimal data to this file (default False) Comments Data written to file includes. Input file can be an HDF5 file or group descriptor. Also, file can be a string and is expected to be in the form of Currently, HD...
[ "Write", "spline", "interpolant", "data", "in", "HDF5", "or", "text", "format", "Input", "-", "write", "data", "to", "this", "file", "slim", "--", "export", "minimal", "data", "to", "this", "file", "(", "default", "False", ")", "Comments", "Data", "written...
def write(self, file, slim=False): if file.__class__ in [h5py._hl.files.File, h5py._hl.group.Group]: self._write(file, slim=slim) elif isinstance(file, (str, Path)): file = Path(file) types = ['.txt', '.h5', '.hdf5'] file_extension = file.suffix assert file_extension in types, "Fil...
[ "def", "write", "(", "self", ",", "file", ",", "slim", "=", "False", ")", ":", "if", "file", ".", "__class__", "in", "[", "h5py", ".", "_hl", ".", "files", ".", "File", ",", "h5py", ".", "_hl", ".", "group", ".", "Group", "]", ":", "self", ".",...
Write spline interpolant data in HDF5 or text format Input
[ "Write", "spline", "interpolant", "data", "in", "HDF5", "or", "text", "format", "Input" ]
[ "\"\"\"\n Write spline interpolant data in HDF5 or text format\n \n Input\n =====\n file -- write data to this file \n slim -- export minimal data to this file (i.e., exclude writing errors array)\n (default False)\n \n Comments\n ========\n Data written to file includes:\n ...
[ { "param": "self", "type": null }, { "param": "file", "type": null }, { "param": "slim", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file", "type": null, "docstring": null, "docstring_tokens": [...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
_write
null
def _write(self, descriptor, slim=False): """Write reduced order spline data to HDF5 file given a file or group descriptor""" if descriptor.__class__ in [h5py._hl.files.File, h5py._hl.group.Group]: descriptor.create_dataset('deg', data=self._deg, dtype='int') descriptor.create_dataset('tol', data=se...
Write reduced order spline data to HDF5 file given a file or group descriptor
Write reduced order spline data to HDF5 file given a file or group descriptor
[ "Write", "reduced", "order", "spline", "data", "to", "HDF5", "file", "given", "a", "file", "or", "group", "descriptor" ]
def _write(self, descriptor, slim=False): if descriptor.__class__ in [h5py._hl.files.File, h5py._hl.group.Group]: descriptor.create_dataset('deg', data=self._deg, dtype='int') descriptor.create_dataset('tol', data=self.tol, dtype='double') descriptor.create_dataset('X', data=self.X, dtype='double'...
[ "def", "_write", "(", "self", ",", "descriptor", ",", "slim", "=", "False", ")", ":", "if", "descriptor", ".", "__class__", "in", "[", "h5py", ".", "_hl", ".", "files", ".", "File", ",", "h5py", ".", "_hl", ".", "group", ".", "Group", "]", ":", "...
Write reduced order spline data to HDF5 file given a file or group descriptor
[ "Write", "reduced", "order", "spline", "data", "to", "HDF5", "file", "given", "a", "file", "or", "group", "descriptor" ]
[ "\"\"\"Write reduced order spline data to HDF5 file given a file or group descriptor\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "descriptor", "type": null }, { "param": "slim", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "descriptor", "type": null, "docstring": null, "docstring_toke...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
read
null
def read(self, file, group=None): """ Load spline interpolant data from HDF5 or text format Input ===== file -- load data from this file assuming form of /my/directory/filename.extension Valid extensions are 'h5', 'hdf5', and 'txt'. """ ans = readSpline(file, group=grou...
Load spline interpolant data from HDF5 or text format Input ===== file -- load data from this file assuming form of /my/directory/filename.extension Valid extensions are 'h5', 'hdf5', and 'txt'.
Load spline interpolant data from HDF5 or text format Input - load data from this file assuming form of my/directory/filename.extension
[ "Load", "spline", "interpolant", "data", "from", "HDF5", "or", "text", "format", "Input", "-", "load", "data", "from", "this", "file", "assuming", "form", "of", "my", "/", "directory", "/", "filename", ".", "extension" ]
def read(self, file, group=None): ans = readSpline(file, group=group) self._spline = ans._spline self.X = ans.X self.Y = ans.Y self._deg = ans._deg self.errors = ans.errors self.tol = ans.tol self._made = True
[ "def", "read", "(", "self", ",", "file", ",", "group", "=", "None", ")", ":", "ans", "=", "readSpline", "(", "file", ",", "group", "=", "group", ")", "self", ".", "_spline", "=", "ans", ".", "_spline", "self", ".", "X", "=", "ans", ".", "X", "s...
Load spline interpolant data from HDF5 or text format Input
[ "Load", "spline", "interpolant", "data", "from", "HDF5", "or", "text", "format", "Input" ]
[ "\"\"\"\n Load spline interpolant data from HDF5 or text format\n\n Input\n =====\n file -- load data from this file assuming form of\n /my/directory/filename.extension\n \n Valid extensions are 'h5', 'hdf5', and 'txt'.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "file", "type": null }, { "param": "group", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file", "type": null, "docstring": null, "docstring_tokens": [...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
readSpline
<not_specific>
def readSpline(file, group=None): """ Load spline interpolant data from HDF5 or text format without having to create a ReducedOrderSpline object. Input ===== file -- load data from this file assuming form of /my/directory/filename.extension Output ====== spline -- object that has the ...
Load spline interpolant data from HDF5 or text format without having to create a ReducedOrderSpline object. Input ===== file -- load data from this file assuming form of /my/directory/filename.extension Output ====== spline -- object that has the attributes and methods of R...
Load spline interpolant data from HDF5 or text format without having to create a ReducedOrderSpline object. Input - load data from this file assuming form of my/directory/filename.extension Output - object that has the attributes and methods of ReducedOrderSpline class
[ "Load", "spline", "interpolant", "data", "from", "HDF5", "or", "text", "format", "without", "having", "to", "create", "a", "ReducedOrderSpline", "object", ".", "Input", "-", "load", "data", "from", "this", "file", "assuming", "form", "of", "my", "/", "direct...
def readSpline(file, group=None): types = ['.txt', '.h5', '.hdf5'] file = Path(file).resolve() file_extension = file.suffix assert file_extension in types, "File type must be have extension txt, h5, or hdf5." if file_extension in ['.h5', '.hdf5']: try: fp = h5py.File(file, 'r') isopen = True ...
[ "def", "readSpline", "(", "file", ",", "group", "=", "None", ")", ":", "types", "=", "[", "'.txt'", ",", "'.h5'", ",", "'.hdf5'", "]", "file", "=", "Path", "(", "file", ")", ".", "resolve", "(", ")", "file_extension", "=", "file", ".", "suffix", "a...
Load spline interpolant data from HDF5 or text format without having to create a ReducedOrderSpline object.
[ "Load", "spline", "interpolant", "data", "from", "HDF5", "or", "text", "format", "without", "having", "to", "create", "a", "ReducedOrderSpline", "object", "." ]
[ "\"\"\"\n Load spline interpolant data from HDF5 or text format \n without having to create a ReducedOrderSpline object.\n \n Input\n =====\n file -- load data from this file assuming form of\n /my/directory/filename.extension\n \n Output\n ======\n spline -- object that has the attributes and me...
[ { "param": "file", "type": null }, { "param": "group", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "group", "type": null, "docstring": null, "docstring_tokens": ...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
_seed
<not_specific>
def _seed(x, deg=5, seeds=None): """Seed the greedy algorithm with (deg+1) evenly spaced indices Input ----- x -- samples deg -- degree of spline polynomial (default 5) seeds -- list or array of indices of initial seed samples (default None) Comment ------- ...
Seed the greedy algorithm with (deg+1) evenly spaced indices Input ----- x -- samples deg -- degree of spline polynomial (default 5) seeds -- list or array of indices of initial seed samples (default None) Comment ------- If `seeds` is None then the code choos...
Seed the greedy algorithm with (deg+1) evenly spaced indices Input Comment If `seeds` is None then the code chooses the seed points to be the first and last indices and (deg-1) points in between that are as nearly equally spaced as possible. If a list or array of `seeds` are entered then these are used instead.
[ "Seed", "the", "greedy", "algorithm", "with", "(", "deg", "+", "1", ")", "evenly", "spaced", "indices", "Input", "Comment", "If", "`", "seeds", "`", "is", "None", "then", "the", "code", "chooses", "the", "seed", "points", "to", "be", "the", "first", "a...
def _seed(x, deg=5, seeds=None): if seeds is None: f = lambda m, n: [ii*n//m + n//(2*m) for ii in range(m)] indices = np.sort(np.hstack([[0, len(x)-1], f(deg-1, len(x))])) else: assert type(seeds) in [list, np.ndarray], "Expecting a list or numpy array." assert len(seeds) == len(np.unique(seeds)), "...
[ "def", "_seed", "(", "x", ",", "deg", "=", "5", ",", "seeds", "=", "None", ")", ":", "if", "seeds", "is", "None", ":", "f", "=", "lambda", "m", ",", "n", ":", "[", "ii", "*", "n", "//", "m", "+", "n", "//", "(", "2", "*", "m", ")", "for...
Seed the greedy algorithm with (deg+1) evenly spaced indices Input
[ "Seed", "the", "greedy", "algorithm", "with", "(", "deg", "+", "1", ")", "evenly", "spaced", "indices", "Input" ]
[ "\"\"\"Seed the greedy algorithm with (deg+1) evenly spaced indices\n \n Input\n -----\n x -- samples\n deg -- degree of spline polynomial\n (default 5)\n seeds -- list or array of indices of initial seed samples\n (default None)\n \n Comment\n -------\n If `seeds` is N...
[ { "param": "x", "type": null }, { "param": "deg", "type": null }, { "param": "seeds", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "deg", "type": null, "docstring": null, "docstring_tokens": [], ...
fdcaf4968337b1074339498019b7037781c7326e
crgalley/romspline
romspline/greedy.py
[ "MIT" ]
Python
_greedy
<not_specific>
def _greedy(x, y, tol=1e-6, rel=False, deg=5, verbose=False, seeds=None): """Greedy algorithm for building a reduced-order spline""" if verbose: print("\nSize", "\t", "Error") print("="*13) if rel: ymax = np.max(np.abs(y)) assert ymax > 0., "All data samples are zero." else: ymax = 1. _...
Greedy algorithm for building a reduced-order spline
Greedy algorithm for building a reduced-order spline
[ "Greedy", "algorithm", "for", "building", "a", "reduced", "-", "order", "spline" ]
def _greedy(x, y, tol=1e-6, rel=False, deg=5, verbose=False, seeds=None): if verbose: print("\nSize", "\t", "Error") print("="*13) if rel: ymax = np.max(np.abs(y)) assert ymax > 0., "All data samples are zero." else: ymax = 1. _tol = tol*ymax indices, errors = _seed(x, deg=deg, seeds=seeds...
[ "def", "_greedy", "(", "x", ",", "y", ",", "tol", "=", "1e-6", ",", "rel", "=", "False", ",", "deg", "=", "5", ",", "verbose", "=", "False", ",", "seeds", "=", "None", ")", ":", "if", "verbose", ":", "print", "(", "\"\\nSize\"", ",", "\"\\t\"", ...
Greedy algorithm for building a reduced-order spline
[ "Greedy", "algorithm", "for", "building", "a", "reduced", "-", "order", "spline" ]
[ "\"\"\"Greedy algorithm for building a reduced-order spline\"\"\"", "# Seed greedy algorithm", "# Keep track of unsorted indices", "# Greedy algorithm", "# Spline interpolant on current set of knots", "# L-infinity errors of current spline interpolant and data", "# Get the index of the largest interpola...
[ { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "tol", "type": null }, { "param": "rel", "type": null }, { "param": "deg", "type": null }, { "param": "verbose", "type": null }, { "param": "seeds", "type": null...
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "y", "type": null, "docstring": null, "docstring_tokens": [], ...
9e82f11624eecd79da122495843c05ae32520c20
catubc/widefieldPredict
predict_svm/PredictSVM.py
[ "MIT" ]
Python
predict2
null
def predict2(self): ''' Predict2 is an updated version which uses sklearn tools for svm instead of coding from scratch ''' # make SVM_Scores output for animal try: os.mkdir(os.path.join(self.root_dir, self.animal_id, "SVM_Scores")) except: pass ...
Predict2 is an updated version which uses sklearn tools for svm instead of coding from scratch
Predict2 is an updated version which uses sklearn tools for svm instead of coding from scratch
[ "Predict2", "is", "an", "updated", "version", "which", "uses", "sklearn", "tools", "for", "svm", "instead", "of", "coding", "from", "scratch" ]
def predict2(self): try: os.mkdir(os.path.join(self.root_dir, self.animal_id, "SVM_Scores")) except: pass self.get_sessions() prefix1 = '' if self.lockout: prefix1 = '_lockout_'+str(self.lockout_window)+"sec" prefix2 = '' if sel...
[ "def", "predict2", "(", "self", ")", ":", "try", ":", "os", ".", "mkdir", "(", "os", ".", "path", ".", "join", "(", "self", ".", "root_dir", ",", "self", ".", "animal_id", ",", "\"SVM_Scores\"", ")", ")", "except", ":", "pass", "self", ".", "get_se...
Predict2 is an updated version which uses sklearn tools for svm instead of coding from scratch
[ "Predict2", "is", "an", "updated", "version", "which", "uses", "sklearn", "tools", "for", "svm", "instead", "of", "coding", "from", "scratch" ]
[ "''' Predict2 is an updated version which uses sklearn tools for svm instead of\n coding from scratch\n\n '''", "# make SVM_Scores output for animal", "# find specific session if only 1 chosen", "#", "#", "#", "# grab trial and random data", "#", "# exclude small # of trial data", "#...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c379df44a6affdabcb5a5111e8169ddd9df3ade8
catubc/widefieldPredict
visualize/Visualize.py
[ "MIT" ]
Python
format_plot
null
def format_plot(self, ax): ''' Formats plots for decision choice with 50% and 0 lines ''' # meta data try: xlims = [self.xlim[0],self.xlim[1]] except: xlims = [-self.window+1,0] ylims = [0.4,1.0] ax.plot([0,0], [ylims[0],yl...
Formats plots for decision choice with 50% and 0 lines
Formats plots for decision choice with 50% and 0 lines
[ "Formats", "plots", "for", "decision", "choice", "with", "50%", "and", "0", "lines" ]
def format_plot(self, ax): try: xlims = [self.xlim[0],self.xlim[1]] except: xlims = [-self.window+1,0] ylims = [0.4,1.0] ax.plot([0,0], [ylims[0],ylims[1]], '--', linewidth=3, color='black', ...
[ "def", "format_plot", "(", "self", ",", "ax", ")", ":", "try", ":", "xlims", "=", "[", "self", ".", "xlim", "[", "0", "]", ",", "self", ".", "xlim", "[", "1", "]", "]", "except", ":", "xlims", "=", "[", "-", "self", ".", "window", "+", "1", ...
Formats plots for decision choice with 50% and 0 lines
[ "Formats", "plots", "for", "decision", "choice", "with", "50%", "and", "0", "lines" ]
[ "''' Formats plots for decision choice with 50% and 0 lines\n '''", "# meta data" ]
[ { "param": "self", "type": null }, { "param": "ax", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ax", "type": null, "docstring": null, "docstring_tokens": [],...
13db0b3c8bf85ae5163cee6dee0c58efe416e510
Iamthenoobcoder/Dababy-bot
bots_DaBaby/text_commands.py
[ "MIT" ]
Python
help_command
null
async def help_command(self, ctx): """Helps the person that runs this command.""" voice_commands = [] text_commands = [] hellp = discord.Embed(title="HELP!", color=discord.Colour.dark_gold()) usage = lambda cmd: f"{cmd.name} {command.signature}" for command in se...
Helps the person that runs this command.
Helps the person that runs this command.
[ "Helps", "the", "person", "that", "runs", "this", "command", "." ]
async def help_command(self, ctx): voice_commands = [] text_commands = [] hellp = discord.Embed(title="HELP!", color=discord.Colour.dark_gold()) usage = lambda cmd: f"{cmd.name} {command.signature}" for command in self.bot.commands: if command.cog.qualified_name == "v...
[ "async", "def", "help_command", "(", "self", ",", "ctx", ")", ":", "voice_commands", "=", "[", "]", "text_commands", "=", "[", "]", "hellp", "=", "discord", ".", "Embed", "(", "title", "=", "\"HELP!\"", ",", "color", "=", "discord", ".", "Colour", ".",...
Helps the person that runs this command.
[ "Helps", "the", "person", "that", "runs", "this", "command", "." ]
[ "\"\"\"Helps the person that runs this command.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "ctx", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
13db0b3c8bf85ae5163cee6dee0c58efe416e510
Iamthenoobcoder/Dababy-bot
bots_DaBaby/text_commands.py
[ "MIT" ]
Python
Dababied
null
async def Dababied(self, ctx, member:discord.Member): """Sends embeded da baby pictures unaware strangers""" dababied = discord.Embed(title="DaBaby-Baby", description=f'{member.name} just got dababied', color=discord.Colour.dark_red()) # use hex or use predefined color dababied.set_image...
Sends embeded da baby pictures unaware strangers
Sends embeded da baby pictures unaware strangers
[ "Sends", "embeded", "da", "baby", "pictures", "unaware", "strangers" ]
async def Dababied(self, ctx, member:discord.Member): dababied = discord.Embed(title="DaBaby-Baby", description=f'{member.name} just got dababied', color=discord.Colour.dark_red()) dababied.set_image(url="https://cdn.discordapp.com/attachments/828220439419158553/828298756754636840/Dababy_BabyOnBaby.png...
[ "async", "def", "Dababied", "(", "self", ",", "ctx", ",", "member", ":", "discord", ".", "Member", ")", ":", "dababied", "=", "discord", ".", "Embed", "(", "title", "=", "\"DaBaby-Baby\"", ",", "description", "=", "f'{member.name} just got dababied'", ",", "...
Sends embeded da baby pictures unaware strangers
[ "Sends", "embeded", "da", "baby", "pictures", "unaware", "strangers" ]
[ "\"\"\"Sends embeded da baby pictures\n unaware strangers\"\"\"", "# use hex or use predefined color", "# Images, footer, author and thumbnails are special elements", "# We manipulate them by using a method ", "# i.e. embed_name.set_thumbnail(url=url)", "# embed_name.set_image(url=url)", "# await...
[ { "param": "self", "type": null }, { "param": "ctx", "type": null }, { "param": "member", "type": "discord.Member" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
13db0b3c8bf85ae5163cee6dee0c58efe416e510
Iamthenoobcoder/Dababy-bot
bots_DaBaby/text_commands.py
[ "MIT" ]
Python
ride_Give
null
async def ride_Give(self, ctx, member:discord.Member): """Gives a person a ride in a convertible""" convertible = discord.Embed(title="Convertible-Baby", description=f'{member.name} just got a convertible :oncoming_taxi:', color=discord.Colour.dark_purple()) convertible.set_image(url="https://me...
Gives a person a ride in a convertible
Gives a person a ride in a convertible
[ "Gives", "a", "person", "a", "ride", "in", "a", "convertible" ]
async def ride_Give(self, ctx, member:discord.Member): convertible = discord.Embed(title="Convertible-Baby", description=f'{member.name} just got a convertible :oncoming_taxi:', color=discord.Colour.dark_purple()) convertible.set_image(url="https://media.tenor.co/videos/9ce5a623bfe0022acfc073e16cea3360/...
[ "async", "def", "ride_Give", "(", "self", ",", "ctx", ",", "member", ":", "discord", ".", "Member", ")", ":", "convertible", "=", "discord", ".", "Embed", "(", "title", "=", "\"Convertible-Baby\"", ",", "description", "=", "f'{member.name} just got a convertible...
Gives a person a ride in a convertible
[ "Gives", "a", "person", "a", "ride", "in", "a", "convertible" ]
[ "\"\"\"Gives a person a ride in a convertible\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "ctx", "type": null }, { "param": "member", "type": "discord.Member" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
13db0b3c8bf85ae5163cee6dee0c58efe416e510
Iamthenoobcoder/Dababy-bot
bots_DaBaby/text_commands.py
[ "MIT" ]
Python
skin_give
null
async def skin_give(self, ctx,member:discord.Member): """Gives an unwarned user a skin.""" skin = discord.Embed(title="Skin-YEE", description=f'{member.name} DaBaby has a skin less gooo, it is for free YEE :man_artist:!', color=discord.Colour.dark_magenta()) skin.set_image(url="https://cdn.disco...
Gives an unwarned user a skin.
Gives an unwarned user a skin.
[ "Gives", "an", "unwarned", "user", "a", "skin", "." ]
async def skin_give(self, ctx,member:discord.Member): skin = discord.Embed(title="Skin-YEE", description=f'{member.name} DaBaby has a skin less gooo, it is for free YEE :man_artist:!', color=discord.Colour.dark_magenta()) skin.set_image(url="https://cdn.discordapp.com/attachments/766128720381476875/8292...
[ "async", "def", "skin_give", "(", "self", ",", "ctx", ",", "member", ":", "discord", ".", "Member", ")", ":", "skin", "=", "discord", ".", "Embed", "(", "title", "=", "\"Skin-YEE\"", ",", "description", "=", "f'{member.name} DaBaby has a skin less gooo, it is fo...
Gives an unwarned user a skin.
[ "Gives", "an", "unwarned", "user", "a", "skin", "." ]
[ "\"\"\"Gives an unwarned user a skin.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "ctx", "type": null }, { "param": "member", "type": "discord.Member" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
e00f1358426b1f1dd3f0241d80872864aaca86e2
Iamthenoobcoder/Dababy-bot
bots_DaBaby/voice_commands.py
[ "MIT" ]
Python
yee
null
async def yee(self, ctx): """Comes into the voice chat the author is in and says YEE!""" if ctx.author.voice: await self.play_voice(ctx, self.bot.yeayea) else: await ctx.reply("YEYE are you an idiot, get in a voice channel. YEYE")
Comes into the voice chat the author is in and says YEE!
Comes into the voice chat the author is in and says YEE!
[ "Comes", "into", "the", "voice", "chat", "the", "author", "is", "in", "and", "says", "YEE!" ]
async def yee(self, ctx): if ctx.author.voice: await self.play_voice(ctx, self.bot.yeayea) else: await ctx.reply("YEYE are you an idiot, get in a voice channel. YEYE")
[ "async", "def", "yee", "(", "self", ",", "ctx", ")", ":", "if", "ctx", ".", "author", ".", "voice", ":", "await", "self", ".", "play_voice", "(", "ctx", ",", "self", ".", "bot", ".", "yeayea", ")", "else", ":", "await", "ctx", ".", "reply", "(", ...
Comes into the voice chat the author is in and says YEE!
[ "Comes", "into", "the", "voice", "chat", "the", "author", "is", "in", "and", "says", "YEE!" ]
[ "\"\"\"Comes into the voice chat the author is in and says YEE!\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "ctx", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
e00f1358426b1f1dd3f0241d80872864aaca86e2
Iamthenoobcoder/Dababy-bot
bots_DaBaby/voice_commands.py
[ "MIT" ]
Python
less_goo
null
async def less_goo(self, ctx): """Comes into the voice chat the author is in and says Less Goo!!""" if ctx.author.voice: await self.play_voice(ctx, self.bot.letsgoo) else: voice_client = discord.utils.get(self.bot.voice_clients, guild=ctx.guild) await ctx.repl...
Comes into the voice chat the author is in and says Less Goo!!
Comes into the voice chat the author is in and says Less Goo
[ "Comes", "into", "the", "voice", "chat", "the", "author", "is", "in", "and", "says", "Less", "Goo" ]
async def less_goo(self, ctx): if ctx.author.voice: await self.play_voice(ctx, self.bot.letsgoo) else: voice_client = discord.utils.get(self.bot.voice_clients, guild=ctx.guild) await ctx.reply("Less see who we have here? An idiot LESS GOO! We have someone who doesn't ...
[ "async", "def", "less_goo", "(", "self", ",", "ctx", ")", ":", "if", "ctx", ".", "author", ".", "voice", ":", "await", "self", ".", "play_voice", "(", "ctx", ",", "self", ".", "bot", ".", "letsgoo", ")", "else", ":", "voice_client", "=", "discord", ...
Comes into the voice chat the author is in and says Less Goo!
[ "Comes", "into", "the", "voice", "chat", "the", "author", "is", "in", "and", "says", "Less", "Goo!" ]
[ "\"\"\"Comes into the voice chat the author is in and says Less Goo!!\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "ctx", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
e00f1358426b1f1dd3f0241d80872864aaca86e2
Iamthenoobcoder/Dababy-bot
bots_DaBaby/voice_commands.py
[ "MIT" ]
Python
Music
null
async def Music(self, ctx): """Runs basically like a music bot but onyl runs DaBaby's songs.""" if ctx.author.voice: await self.play_voice(ctx, self.bot.dababymusic) else: voice_client = discord.utils.get(self.bot.voice_clients, guild=ctx.guild) await ctx.repl...
Runs basically like a music bot but onyl runs DaBaby's songs.
Runs basically like a music bot but onyl runs DaBaby's songs.
[ "Runs", "basically", "like", "a", "music", "bot", "but", "onyl", "runs", "DaBaby", "'", "s", "songs", "." ]
async def Music(self, ctx): if ctx.author.voice: await self.play_voice(ctx, self.bot.dababymusic) else: voice_client = discord.utils.get(self.bot.voice_clients, guild=ctx.guild) await ctx.reply("This moron wants to listen to my music without entering a voice chat.Ye y...
[ "async", "def", "Music", "(", "self", ",", "ctx", ")", ":", "if", "ctx", ".", "author", ".", "voice", ":", "await", "self", ".", "play_voice", "(", "ctx", ",", "self", ".", "bot", ".", "dababymusic", ")", "else", ":", "voice_client", "=", "discord", ...
Runs basically like a music bot but onyl runs DaBaby's songs.
[ "Runs", "basically", "like", "a", "music", "bot", "but", "onyl", "runs", "DaBaby", "'", "s", "songs", "." ]
[ "\"\"\"Runs basically like a music bot but onyl runs DaBaby's songs.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "ctx", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
ccb7399091cd38f93c3b4c16173309be3efad323
Iamthenoobcoder/Dababy-bot
__main__.py
[ "MIT" ]
Python
on_ready
null
async def on_ready(): """Tells the owner if the bot is running and ready to go.""" with YoutubeDL(ydl_preset) as ydl: lg = ydl.extract_info(f'ytsearch:dababy lets goo sound effect', download=False)['entries'][0] bot.letsgoo = lg['url'] with YoutubeDL(ydl_preset) as ydl: yae = ydl.ex...
Tells the owner if the bot is running and ready to go.
Tells the owner if the bot is running and ready to go.
[ "Tells", "the", "owner", "if", "the", "bot", "is", "running", "and", "ready", "to", "go", "." ]
async def on_ready(): with YoutubeDL(ydl_preset) as ydl: lg = ydl.extract_info(f'ytsearch:dababy lets goo sound effect', download=False)['entries'][0] bot.letsgoo = lg['url'] with YoutubeDL(ydl_preset) as ydl: yae = ydl.extract_info(f'ytsearch:dababy yea yea sound effect', download=False)['e...
[ "async", "def", "on_ready", "(", ")", ":", "with", "YoutubeDL", "(", "ydl_preset", ")", "as", "ydl", ":", "lg", "=", "ydl", ".", "extract_info", "(", "f'ytsearch:dababy lets goo sound effect'", ",", "download", "=", "False", ")", "[", "'entries'", "]", "[", ...
Tells the owner if the bot is running and ready to go.
[ "Tells", "the", "owner", "if", "the", "bot", "is", "running", "and", "ready", "to", "go", "." ]
[ "\"\"\"Tells the owner if the bot is running and ready to go.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
7346135025f0520bcff5ebdbae55ee6a5b4f14bc
shambo001/peat
pKaTool/pKa_system_wrapper.py
[ "MIT" ]
Python
do_search
<not_specific>
def do_search(self): """Searches the loaded titration curves to find optimal fit with pH-activity profile""" # two titration curves (+ one unconstrained) for i in range(len(self.residue_files.keys())): for j in range(i+1,len(self.residue_files.keys())): r1=se...
Searches the loaded titration curves to find optimal fit with pH-activity profile
Searches the loaded titration curves to find optimal fit with pH-activity profile
[ "Searches", "the", "loaded", "titration", "curves", "to", "find", "optimal", "fit", "with", "pH", "-", "activity", "profile" ]
def do_search(self): for i in range(len(self.residue_files.keys())): for j in range(i+1,len(self.residue_files.keys())): r1=self.residue_files.keys()[i] r2=self.residue_files.keys()[j] print r1,r2 self.run([r1,r2], ['a','a','1']) ...
[ "def", "do_search", "(", "self", ")", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "residue_files", ".", "keys", "(", ")", ")", ")", ":", "for", "j", "in", "range", "(", "i", "+", "1", ",", "len", "(", "self", ".", "residue_fil...
Searches the loaded titration curves to find optimal fit with pH-activity profile
[ "Searches", "the", "loaded", "titration", "curves", "to", "find", "optimal", "fit", "with", "pH", "-", "activity", "profile" ]
[ "\"\"\"Searches the loaded titration curves to find optimal fit\n with pH-activity profile\"\"\"", "# two titration curves (+ one unconstrained)" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7346135025f0520bcff5ebdbae55ee6a5b4f14bc
shambo001/peat
pKaTool/pKa_system_wrapper.py
[ "MIT" ]
Python
all_combos
<not_specific>
def all_combos(self): """Does fits to all combinations of acid/base assignment and number of deprotonated groups to less than five titration curves""" residues = self.residue_files.keys() # make combinations for one group self.generate_permutations(1,4,self.include_ph) ...
Does fits to all combinations of acid/base assignment and number of deprotonated groups to less than five titration curves
Does fits to all combinations of acid/base assignment and number of deprotonated groups to less than five titration curves
[ "Does", "fits", "to", "all", "combinations", "of", "acid", "/", "base", "assignment", "and", "number", "of", "deprotonated", "groups", "to", "less", "than", "five", "titration", "curves" ]
def all_combos(self): residues = self.residue_files.keys() self.generate_permutations(1,4,self.include_ph) for residue in residues: for p in self.permutations: self.run([residue],p) self.generate_permutations(2,4,self.include_ph) for i in range(len(res...
[ "def", "all_combos", "(", "self", ")", ":", "residues", "=", "self", ".", "residue_files", ".", "keys", "(", ")", "self", ".", "generate_permutations", "(", "1", ",", "4", ",", "self", ".", "include_ph", ")", "for", "residue", "in", "residues", ":", "f...
Does fits to all combinations of acid/base assignment and number of deprotonated groups to less than five titration curves
[ "Does", "fits", "to", "all", "combinations", "of", "acid", "/", "base", "assignment", "and", "number", "of", "deprotonated", "groups", "to", "less", "than", "five", "titration", "curves" ]
[ "\"\"\"Does fits to all combinations of acid/base assignment and number\n of deprotonated groups to less than five titration curves\"\"\"", "# make combinations for one group", "#print p", "# make combinations for two group", "#print p", "# make combinations for three group", "#print p" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7346135025f0520bcff5ebdbae55ee6a5b4f14bc
shambo001/peat
pKaTool/pKa_system_wrapper.py
[ "MIT" ]
Python
report_errors
<not_specific>
def report_errors(self,include_activity=0,no_deprotonated=None, no_groups=0, no_acids=None, no_bases=None): """Writes current errors to the report file""" # get errors of current fit errors = self.get_errors(include_activity=include_activity) # generate output line for report ...
Writes current errors to the report file
Writes current errors to the report file
[ "Writes", "current", "errors", "to", "the", "report", "file" ]
def report_errors(self,include_activity=0,no_deprotonated=None, no_groups=0, no_acids=None, no_bases=None): errors = self.get_errors(include_activity=include_activity) line = '' for i in range(len(self.all_residues)): line+= '%4s(%4s) '%(self.all_residues[i],self.all_a_bs[i]) ...
[ "def", "report_errors", "(", "self", ",", "include_activity", "=", "0", ",", "no_deprotonated", "=", "None", ",", "no_groups", "=", "0", ",", "no_acids", "=", "None", ",", "no_bases", "=", "None", ")", ":", "errors", "=", "self", ".", "get_errors", "(", ...
Writes current errors to the report file
[ "Writes", "current", "errors", "to", "the", "report", "file" ]
[ "\"\"\"Writes current errors to the report file\"\"\"", "# get errors of current fit", "# generate output line for report ", "# residues", "# number of groups", "# number of acids/bases", "# number of deprotonated groups", "# errors", "# write output line" ]
[ { "param": "self", "type": null }, { "param": "include_activity", "type": null }, { "param": "no_deprotonated", "type": null }, { "param": "no_groups", "type": null }, { "param": "no_acids", "type": null }, { "param": "no_bases", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "include_activity", "type": null, "docstring": null, "docstrin...
736df70c18e101f21701984b23ed1e21b0735b58
shambo001/peat
pKaTool/dist_geom.py
[ "MIT" ]
Python
average
<not_specific>
def average(l): """Calculate the average value of the elements of a list""" sum=0.0 for i in l: sum=sum+i return sum/float(len(l))
Calculate the average value of the elements of a list
Calculate the average value of the elements of a list
[ "Calculate", "the", "average", "value", "of", "the", "elements", "of", "a", "list" ]
def average(l): sum=0.0 for i in l: sum=sum+i return sum/float(len(l))
[ "def", "average", "(", "l", ")", ":", "sum", "=", "0.0", "for", "i", "in", "l", ":", "sum", "=", "sum", "+", "i", "return", "sum", "/", "float", "(", "len", "(", "l", ")", ")" ]
Calculate the average value of the elements of a list
[ "Calculate", "the", "average", "value", "of", "the", "elements", "of", "a", "list" ]
[ "\"\"\"Calculate the average value of the elements of a list\"\"\"" ]
[ { "param": "l", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "l", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
736df70c18e101f21701984b23ed1e21b0735b58
shambo001/peat
pKaTool/dist_geom.py
[ "MIT" ]
Python
find_match
<not_specific>
def find_match(self): """find match for the coordinates in teh PDB""" if not self.P: return # # Number of groups from distance geometry # groups=self.coords.keys() num_groups=len(groups) # # Get the titratable groups in the prot...
find match for the coordinates in teh PDB
find match for the coordinates in teh PDB
[ "find", "match", "for", "the", "coordinates", "in", "teh", "PDB" ]
def find_match(self): if not self.P: return Number of groups from distance geometry groups=self.coords.keys() num_groups=len(groups) Get the titratable groups in the protein self.P.get_titratable_groups() tit_grps=self.P.titratable_groups ...
[ "def", "find_match", "(", "self", ")", ":", "if", "not", "self", ".", "P", ":", "return", "groups", "=", "self", ".", "coords", ".", "keys", "(", ")", "num_groups", "=", "len", "(", "groups", ")", "self", ".", "P", ".", "get_titratable_groups", "(", ...
find match for the coordinates in teh PDB
[ "find", "match", "for", "the", "coordinates", "in", "teh", "PDB" ]
[ "\"\"\"find match for the coordinates in teh PDB\"\"\"", "#", "# Number of groups from distance geometry", "#", "#", "# Get the titratable groups in the protein", "#", "#", "#", "#", "#", "# Get avg coordinate", "#", "#", "# Construct group name", "#", "#", "# Construct all permuta...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
736df70c18e101f21701984b23ed1e21b0735b58
shambo001/peat
pKaTool/dist_geom.py
[ "MIT" ]
Python
find_matrix_match
<not_specific>
def find_matrix_match(self): """Find a match in the energies in pkamatrix""" # # Complete distances # distmat=self.distance_matrix.copy() for group in distmat.keys(): distmat[group][group]=0.0 # # Number of groups in distance matrix # ...
Find a match in the energies in pkamatrix
Find a match in the energies in pkamatrix
[ "Find", "a", "match", "in", "the", "energies", "in", "pkamatrix" ]
def find_matrix_match(self): Complete distances distmat=self.distance_matrix.copy() for group in distmat.keys(): distmat[group][group]=0.0 Number of groups in distance matrix groups=distmat.keys() num_groups=len(groups) Make it into a Numeric matrix...
[ "def", "find_matrix_match", "(", "self", ")", ":", "distmat", "=", "self", ".", "distance_matrix", ".", "copy", "(", ")", "for", "group", "in", "distmat", ".", "keys", "(", ")", ":", "distmat", "[", "group", "]", "[", "group", "]", "=", "0.0", "group...
Find a match in the energies in pkamatrix
[ "Find", "a", "match", "in", "the", "energies", "in", "pkamatrix" ]
[ "\"\"\"Find a match in the energies in pkamatrix\"\"\"", "#", "# Complete distances", "#", "#", "# Number of groups in distance matrix", "#", "#", "# Make it into a Numeric matrix with energies", "#", "#distance=243.3*math.log(10)/(eps*E)", "# not really necessary as EM is symmetric", "#", ...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
736df70c18e101f21701984b23ed1e21b0735b58
shambo001/peat
pKaTool/dist_geom.py
[ "MIT" ]
Python
construct_permutations
<not_specific>
def construct_permutations(self,permutation_size,choices): """Construct all permutations of a combination of <permutation_size> items of <choices>""" print 'Construct all permutations of a combination of %d items of %d' %(permutation_size,len(choices)) permutations={} x=[] count=...
Construct all permutations of a combination of <permutation_size> items of <choices>
Construct all permutations of a combination of items of
[ "Construct", "all", "permutations", "of", "a", "combination", "of", "items", "of" ]
def construct_permutations(self,permutation_size,choices): print 'Construct all permutations of a combination of %d items of %d' %(permutation_size,len(choices)) permutations={} x=[] count=[] for level in range(permutation_size): x.append(choices) count.ap...
[ "def", "construct_permutations", "(", "self", ",", "permutation_size", ",", "choices", ")", ":", "print", "'Construct all permutations of a combination of %d items of %d'", "%", "(", "permutation_size", ",", "len", "(", "choices", ")", ")", "permutations", "=", "{", "...
Construct all permutations of a combination of <permutation_size> items of <choices>
[ "Construct", "all", "permutations", "of", "a", "combination", "of", "<permutation_size", ">", "items", "of", "<choices", ">" ]
[ "\"\"\"Construct all permutations of a combination of <permutation_size> items of <choices>\"\"\"", "#", "# Construct this permutation", "#", "#", "# Is this a valid permutation?", "#", "#", "# Increment count", "#" ]
[ { "param": "self", "type": null }, { "param": "permutation_size", "type": null }, { "param": "choices", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "permutation_size", "type": null, "docstring": null, "docstrin...
736df70c18e101f21701984b23ed1e21b0735b58
shambo001/peat
pKaTool/dist_geom.py
[ "MIT" ]
Python
do_triangle_smoothing
<not_specific>
def do_triangle_smoothing(self): """Make sure that the distances are consistent""" anychange=1 count=1 while anychange: anychange=None for A in self.D_matrix.keys(): for B in self.D_matrix.keys(): if B==A: ...
Make sure that the distances are consistent
Make sure that the distances are consistent
[ "Make", "sure", "that", "the", "distances", "are", "consistent" ]
def do_triangle_smoothing(self): anychange=1 count=1 while anychange: anychange=None for A in self.D_matrix.keys(): for B in self.D_matrix.keys(): if B==A: continue for C in self.D_matrix.keys...
[ "def", "do_triangle_smoothing", "(", "self", ")", ":", "anychange", "=", "1", "count", "=", "1", "while", "anychange", ":", "anychange", "=", "None", "for", "A", "in", "self", ".", "D_matrix", ".", "keys", "(", ")", ":", "for", "B", "in", "self", "."...
Make sure that the distances are consistent
[ "Make", "sure", "that", "the", "distances", "are", "consistent" ]
[ "\"\"\"Make sure that the distances are consistent\"\"\"", "#", "# Flag for changes", "#", "#", "# Get the distances", "#", "#", "# AC cannot be bigger than AB+BC", "#", "#", "# AC dist must at least be AB-CB", "#", "#", "# Put vals back into the matrix", "#" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
737cd32dd7a6902054d8e0104d757194cf3d98ff
shambo001/peat
PEATSA/Core/Goodvibes/Main.py
[ "MIT" ]
Python
hessian_calculation
<not_specific>
def hessian_calculation(self, N, d_coordinates, chains, atoms_hessian, cutoff, d_secondary, matrix_distances, l_coordinates, l_rem = [], verbose = False): '''This function calculates the Hessian matrix. At least its supposed to...''' if verbose == True: print 'calculating the hessian/secon...
This function calculates the Hessian matrix. At least its supposed to...
This function calculates the Hessian matrix. At least its supposed to
[ "This", "function", "calculates", "the", "Hessian", "matrix", ".", "At", "least", "its", "supposed", "to" ]
def hessian_calculation(self, N, d_coordinates, chains, atoms_hessian, cutoff, d_secondary, matrix_distances, l_coordinates, l_rem = [], verbose = False): if verbose == True: print 'calculating the hessian/second-order derivate Kirchoff/Laplacian matrix' import math, Numeric cutoff_s...
[ "def", "hessian_calculation", "(", "self", ",", "N", ",", "d_coordinates", ",", "chains", ",", "atoms_hessian", ",", "cutoff", ",", "d_secondary", ",", "matrix_distances", ",", "l_coordinates", ",", "l_rem", "=", "[", "]", ",", "verbose", "=", "False", ")", ...
This function calculates the Hessian matrix.
[ "This", "function", "calculates", "the", "Hessian", "matrix", "." ]
[ "'''This function calculates the Hessian matrix. At least its supposed to...'''", "## if dist_sq <= cutoff_sq:", "#fill supersymmetrical elements when j>=i", "##upper super off-diagonal; xixj, xiyj, xizj, yiyj, yizj, zizj", "##lower super off-diagonal; xjxi, yjxi, zjxi, yjyi, zjyi, zjzi",...
[ { "param": "self", "type": null }, { "param": "N", "type": null }, { "param": "d_coordinates", "type": null }, { "param": "chains", "type": null }, { "param": "atoms_hessian", "type": null }, { "param": "cutoff", "type": null }, { "param": ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "N", "type": null, "docstring": null, "docstring_tokens": [], ...
7df2dfd8596d866a08120d0751ddc33a1fc2f392
shambo001/peat
Protool/hydrogens.py
[ "MIT" ]
Python
build_HA
<not_specific>
def build_HA(self,residue): """Build all or some hydrogens for this residue""" coords={'N':numpy.array([2.967,4.770,13.995]), 'CA':numpy.array([2.755,5.653,12.837]), 'C':numpy.array([3.345,7.017,13.183]), 'HA':numpy.array([3.210,5.226,12.056])} bui...
Build all or some hydrogens for this residue
Build all or some hydrogens for this residue
[ "Build", "all", "or", "some", "hydrogens", "for", "this", "residue" ]
def build_HA(self,residue): coords={'N':numpy.array([2.967,4.770,13.995]), 'CA':numpy.array([2.755,5.653,12.837]), 'C':numpy.array([3.345,7.017,13.183]), 'HA':numpy.array([3.210,5.226,12.056])} buildname='HA' return self.build_hydrogen(residue,buil...
[ "def", "build_HA", "(", "self", ",", "residue", ")", ":", "coords", "=", "{", "'N'", ":", "numpy", ".", "array", "(", "[", "2.967", ",", "4.770", ",", "13.995", "]", ")", ",", "'CA'", ":", "numpy", ".", "array", "(", "[", "2.755", ",", "5.653", ...
Build all or some hydrogens for this residue
[ "Build", "all", "or", "some", "hydrogens", "for", "this", "residue" ]
[ "\"\"\"Build all or some hydrogens for this residue\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "residue", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "residue", "type": null, "docstring": null, "docstring_tokens"...
7df2dfd8596d866a08120d0751ddc33a1fc2f392
shambo001/peat
Protool/hydrogens.py
[ "MIT" ]
Python
build_hydrogen
<not_specific>
def build_hydrogen(self,residue,buildH,coords): """Build a hydrogen in the structure when given coordinates, the Hname and the residue""" fit_coords=[] findatoms=sorted(coords.keys()) findatoms.remove(buildH) ref_coords=[] for atom in findatoms: fit_coords.app...
Build a hydrogen in the structure when given coordinates, the Hname and the residue
Build a hydrogen in the structure when given coordinates, the Hname and the residue
[ "Build", "a", "hydrogen", "in", "the", "structure", "when", "given", "coordinates", "the", "Hname", "and", "the", "residue" ]
def build_hydrogen(self,residue,buildH,coords): fit_coords=[] findatoms=sorted(coords.keys()) findatoms.remove(buildH) ref_coords=[] for atom in findatoms: fit_coords.append(coords[atom]) Now find the corresponding atom in the structure struct...
[ "def", "build_hydrogen", "(", "self", ",", "residue", ",", "buildH", ",", "coords", ")", ":", "fit_coords", "=", "[", "]", "findatoms", "=", "sorted", "(", "coords", ".", "keys", "(", ")", ")", "findatoms", ".", "remove", "(", "buildH", ")", "ref_coord...
Build a hydrogen in the structure when given coordinates, the Hname and the residue
[ "Build", "a", "hydrogen", "in", "the", "structure", "when", "given", "coordinates", "the", "Hname", "and", "the", "residue" ]
[ "\"\"\"Build a hydrogen in the structure when given coordinates, the Hname and the residue\"\"\"", "#", "# Now find the corresponding atom in the structure", "#", "#", "# Get rotation and translation for bb -> bb", "#", "#", "# Get the atoms that should be transformed", "#", "#", "# Apply rota...
[ { "param": "self", "type": null }, { "param": "residue", "type": null }, { "param": "buildH", "type": null }, { "param": "coords", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "residue", "type": null, "docstring": null, "docstring_tokens"...
9259cb1130103f2d7983f285a503ac0b0daa3df0
shambo001/peat
PEATSA/Tools/HIVTools/CombinationConverter.py
[ "MIT" ]
Python
codesToCombinations
<not_specific>
def codesToCombinations(mutationCodes): '''Converts a mutation code, which involves both chains, to a list of non-chain specific codes e.g. A84V+B84V+A32F+B32F => 84V, 32F''' holder = [] for code in mutationCodes: mutationSet = Core.Data.MutationSet(code) holder.append(list(set([code[1:] for code in mutatio...
Converts a mutation code, which involves both chains, to a list of non-chain specific codes e.g. A84V+B84V+A32F+B32F => 84V, 32F
Converts a mutation code, which involves both chains, to a list of non-chain specific codes e.g.
[ "Converts", "a", "mutation", "code", "which", "involves", "both", "chains", "to", "a", "list", "of", "non", "-", "chain", "specific", "codes", "e", ".", "g", "." ]
def codesToCombinations(mutationCodes): holder = [] for code in mutationCodes: mutationSet = Core.Data.MutationSet(code) holder.append(list(set([code[1:] for code in mutationSet.reducedMutationCodes()]))) return holder
[ "def", "codesToCombinations", "(", "mutationCodes", ")", ":", "holder", "=", "[", "]", "for", "code", "in", "mutationCodes", ":", "mutationSet", "=", "Core", ".", "Data", ".", "MutationSet", "(", "code", ")", "holder", ".", "append", "(", "list", "(", "s...
Converts a mutation code, which involves both chains, to a list of non-chain specific codes e.g.
[ "Converts", "a", "mutation", "code", "which", "involves", "both", "chains", "to", "a", "list", "of", "non", "-", "chain", "specific", "codes", "e", ".", "g", "." ]
[ "'''Converts a mutation code, which involves both chains, to a list of non-chain specific codes\n\t\n\te.g. A84V+B84V+A32F+B32F => 84V, 32F'''" ]
[ { "param": "mutationCodes", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "mutationCodes", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testSinglePointMutationFormatParse
null
def testSinglePointMutationFormatParse(self): '''Test that the results of parsing an SPM file are correct Also tests compare''' self.assertEqual(self.list.mutantList(), self.mutants)
Test that the results of parsing an SPM file are correct Also tests compare
Test that the results of parsing an SPM file are correct Also tests compare
[ "Test", "that", "the", "results", "of", "parsing", "an", "SPM", "file", "are", "correct", "Also", "tests", "compare" ]
def testSinglePointMutationFormatParse(self): self.assertEqual(self.list.mutantList(), self.mutants)
[ "def", "testSinglePointMutationFormatParse", "(", "self", ")", ":", "self", ".", "assertEqual", "(", "self", ".", "list", ".", "mutantList", "(", ")", ",", "self", ".", "mutants", ")" ]
Test that the results of parsing an SPM file are correct Also tests compare
[ "Test", "that", "the", "results", "of", "parsing", "an", "SPM", "file", "are", "correct", "Also", "tests", "compare" ]
[ "'''Test that the results of parsing an SPM file are correct\n\t\t\n\t\tAlso tests compare'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testFormatDetection
null
def testFormatDetection(self): '''Test that a single point mutation format is detected''' self.assertEqual(self.list.isSinglePointMutationFormat(), True)
Test that a single point mutation format is detected
Test that a single point mutation format is detected
[ "Test", "that", "a", "single", "point", "mutation", "format", "is", "detected" ]
def testFormatDetection(self): self.assertEqual(self.list.isSinglePointMutationFormat(), True)
[ "def", "testFormatDetection", "(", "self", ")", ":", "self", ".", "assertEqual", "(", "self", ".", "list", ".", "isSinglePointMutationFormat", "(", ")", ",", "True", ")" ]
Test that a single point mutation format is detected
[ "Test", "that", "a", "single", "point", "mutation", "format", "is", "detected" ]
[ "'''Test that a single point mutation format is detected'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testSinglePointMutationFormatWrite
null
def testSinglePointMutationFormatWrite(self): '''Test that we can write a single point mutation format''' self.list.writeToFile("testFile") newList = Data.MutationListFile("testFile") self.assertEqual(newList, self.list) os.remove("testFile")
Test that we can write a single point mutation format
Test that we can write a single point mutation format
[ "Test", "that", "we", "can", "write", "a", "single", "point", "mutation", "format" ]
def testSinglePointMutationFormatWrite(self): self.list.writeToFile("testFile") newList = Data.MutationListFile("testFile") self.assertEqual(newList, self.list) os.remove("testFile")
[ "def", "testSinglePointMutationFormatWrite", "(", "self", ")", ":", "self", ".", "list", ".", "writeToFile", "(", "\"testFile\"", ")", "newList", "=", "Data", ".", "MutationListFile", "(", "\"testFile\"", ")", "self", ".", "assertEqual", "(", "newList", ",", "...
Test that we can write a single point mutation format
[ "Test", "that", "we", "can", "write", "a", "single", "point", "mutation", "format" ]
[ "'''Test that we can write a single point mutation format'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testSinglePointMutationFormatMutationError
null
def testSinglePointMutationFormatMutationError(self): '''Test that the class responds correctly to an incorrect mutation format''' stream = open("SimpleMutationList", "w+") stream.write(invalidSimpleListOne) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "...
Test that the class responds correctly to an incorrect mutation format
Test that the class responds correctly to an incorrect mutation format
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrect", "mutation", "format" ]
def testSinglePointMutationFormatMutationError(self): stream = open("SimpleMutationList", "w+") stream.write(invalidSimpleListOne) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "SimpleMutationList")
[ "def", "testSinglePointMutationFormatMutationError", "(", "self", ")", ":", "stream", "=", "open", "(", "\"SimpleMutationList\"", ",", "\"w+\"", ")", "stream", ".", "write", "(", "invalidSimpleListOne", ")", "stream", ".", "close", "(", ")", "self", ".", "assert...
Test that the class responds correctly to an incorrect mutation format
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrect", "mutation", "format" ]
[ "'''Test that the class responds correctly to an incorrect mutation format'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testSinglePointMutationFormatResidueError
null
def testSinglePointMutationFormatResidueError(self): '''Test that the class responds correctly to an incorrect residue format''' stream = open("SimpleMutationList", "w+") stream.write(invalidSimpleListTwo) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "Si...
Test that the class responds correctly to an incorrect residue format
Test that the class responds correctly to an incorrect residue format
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrect", "residue", "format" ]
def testSinglePointMutationFormatResidueError(self): stream = open("SimpleMutationList", "w+") stream.write(invalidSimpleListTwo) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "SimpleMutationList")
[ "def", "testSinglePointMutationFormatResidueError", "(", "self", ")", ":", "stream", "=", "open", "(", "\"SimpleMutationList\"", ",", "\"w+\"", ")", "stream", ".", "write", "(", "invalidSimpleListTwo", ")", "stream", ".", "close", "(", ")", "self", ".", "assertR...
Test that the class responds correctly to an incorrect residue format
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrect", "residue", "format" ]
[ "'''Test that the class responds correctly to an incorrect residue format'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testSinglePointMutationLineError
null
def testSinglePointMutationLineError(self): '''Test that the class responds correctly to an incorrectly formatted line''' stream = open("SimpleMutationList", "w+") stream.write(invalidSimpleListThree) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "SimpleM...
Test that the class responds correctly to an incorrectly formatted line
Test that the class responds correctly to an incorrectly formatted line
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrectly", "formatted", "line" ]
def testSinglePointMutationLineError(self): stream = open("SimpleMutationList", "w+") stream.write(invalidSimpleListThree) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "SimpleMutationList")
[ "def", "testSinglePointMutationLineError", "(", "self", ")", ":", "stream", "=", "open", "(", "\"SimpleMutationList\"", ",", "\"w+\"", ")", "stream", ".", "write", "(", "invalidSimpleListThree", ")", "stream", ".", "close", "(", ")", "self", ".", "assertRaises",...
Test that the class responds correctly to an incorrectly formatted line
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrectly", "formatted", "line" ]
[ "'''Test that the class responds correctly to an incorrectly formatted line'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testInitialisationWithNonExistantFile
null
def testInitialisationWithNonExistantFile(self): '''Test that the class raises the correct error when initialised with a non-existant file''' self.assertRaises(Exceptions.MutationListError, Data.MutationListFile, "NonexistantFile")
Test that the class raises the correct error when initialised with a non-existant file
Test that the class raises the correct error when initialised with a non-existant file
[ "Test", "that", "the", "class", "raises", "the", "correct", "error", "when", "initialised", "with", "a", "non", "-", "existant", "file" ]
def testInitialisationWithNonExistantFile(self): self.assertRaises(Exceptions.MutationListError, Data.MutationListFile, "NonexistantFile")
[ "def", "testInitialisationWithNonExistantFile", "(", "self", ")", ":", "self", ".", "assertRaises", "(", "Exceptions", ".", "MutationListError", ",", "Data", ".", "MutationListFile", ",", "\"NonexistantFile\"", ")" ]
Test that the class raises the correct error when initialised with a non-existant file
[ "Test", "that", "the", "class", "raises", "the", "correct", "error", "when", "initialised", "with", "a", "non", "-", "existant", "file" ]
[ "'''Test that the class raises the correct error when initialised with a non-existant file'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testStandardParse
null
def testStandardParse(self): '''Test that the results of parsing a standard file are correct''' self.assertEqual(self.list.mutantList(), self.mutants)
Test that the results of parsing a standard file are correct
Test that the results of parsing a standard file are correct
[ "Test", "that", "the", "results", "of", "parsing", "a", "standard", "file", "are", "correct" ]
def testStandardParse(self): self.assertEqual(self.list.mutantList(), self.mutants)
[ "def", "testStandardParse", "(", "self", ")", ":", "self", ".", "assertEqual", "(", "self", ".", "list", ".", "mutantList", "(", ")", ",", "self", ".", "mutants", ")" ]
Test that the results of parsing a standard file are correct
[ "Test", "that", "the", "results", "of", "parsing", "a", "standard", "file", "are", "correct" ]
[ "'''Test that the results of parsing a standard file are correct'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testFormatDetection
null
def testFormatDetection(self): '''Test that standard format is detected''' self.assertEqual(self.list.isStandardMutationFormat(), True)
Test that standard format is detected
Test that standard format is detected
[ "Test", "that", "standard", "format", "is", "detected" ]
def testFormatDetection(self): self.assertEqual(self.list.isStandardMutationFormat(), True)
[ "def", "testFormatDetection", "(", "self", ")", ":", "self", ".", "assertEqual", "(", "self", ".", "list", ".", "isStandardMutationFormat", "(", ")", ",", "True", ")" ]
Test that standard format is detected
[ "Test", "that", "standard", "format", "is", "detected" ]
[ "'''Test that standard format is detected'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testStandardFormatWrite
null
def testStandardFormatWrite(self): '''Test that we can write a standard format file''' self.list.writeToFile("testFile") newList = Data.MutationListFile("testFile") self.assertEqual(newList, self.list)
Test that we can write a standard format file
Test that we can write a standard format file
[ "Test", "that", "we", "can", "write", "a", "standard", "format", "file" ]
def testStandardFormatWrite(self): self.list.writeToFile("testFile") newList = Data.MutationListFile("testFile") self.assertEqual(newList, self.list)
[ "def", "testStandardFormatWrite", "(", "self", ")", ":", "self", ".", "list", ".", "writeToFile", "(", "\"testFile\"", ")", "newList", "=", "Data", ".", "MutationListFile", "(", "\"testFile\"", ")", "self", ".", "assertEqual", "(", "newList", ",", "self", "....
Test that we can write a standard format file
[ "Test", "that", "we", "can", "write", "a", "standard", "format", "file" ]
[ "'''Test that we can write a standard format file'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testStandardFormatMutationError
null
def testStandardFormatMutationError(self): '''Test that the class responds correctly to an incorrect mutation format''' stream = open("StandardMutationList", "w+") stream.write(invalidStandardListOne) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "Standar...
Test that the class responds correctly to an incorrect mutation format
Test that the class responds correctly to an incorrect mutation format
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrect", "mutation", "format" ]
def testStandardFormatMutationError(self): stream = open("StandardMutationList", "w+") stream.write(invalidStandardListOne) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "StandardMutationList")
[ "def", "testStandardFormatMutationError", "(", "self", ")", ":", "stream", "=", "open", "(", "\"StandardMutationList\"", ",", "\"w+\"", ")", "stream", ".", "write", "(", "invalidStandardListOne", ")", "stream", ".", "close", "(", ")", "self", ".", "assertRaises"...
Test that the class responds correctly to an incorrect mutation format
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrect", "mutation", "format" ]
[ "'''Test that the class responds correctly to an incorrect mutation format'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testStandardFormatResidueError
null
def testStandardFormatResidueError(self): '''Test that the class responds correctly to an incorrect residue format''' stream = open("StandardMutationList", "w+") stream.write(invalidStandardListTwo) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "StandardM...
Test that the class responds correctly to an incorrect residue format
Test that the class responds correctly to an incorrect residue format
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrect", "residue", "format" ]
def testStandardFormatResidueError(self): stream = open("StandardMutationList", "w+") stream.write(invalidStandardListTwo) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "StandardMutationList")
[ "def", "testStandardFormatResidueError", "(", "self", ")", ":", "stream", "=", "open", "(", "\"StandardMutationList\"", ",", "\"w+\"", ")", "stream", ".", "write", "(", "invalidStandardListTwo", ")", "stream", ".", "close", "(", ")", "self", ".", "assertRaises",...
Test that the class responds correctly to an incorrect residue format
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrect", "residue", "format" ]
[ "'''Test that the class responds correctly to an incorrect residue format'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testStandardFormatLineError
null
def testStandardFormatLineError(self): '''Test that the class responds correctly to an incorrectly formatted line''' stream = open("StandardMutationList", "w+") stream.write(invalidStandardListThree) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "Standard...
Test that the class responds correctly to an incorrectly formatted line
Test that the class responds correctly to an incorrectly formatted line
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrectly", "formatted", "line" ]
def testStandardFormatLineError(self): stream = open("StandardMutationList", "w+") stream.write(invalidStandardListThree) stream.close() self.assertRaises(Exceptions.MutationListFileFormatError, Data.MutationListFile, "StandardMutationList")
[ "def", "testStandardFormatLineError", "(", "self", ")", ":", "stream", "=", "open", "(", "\"StandardMutationList\"", ",", "\"w+\"", ")", "stream", ".", "write", "(", "invalidStandardListThree", ")", "stream", ".", "close", "(", ")", "self", ".", "assertRaises", ...
Test that the class responds correctly to an incorrectly formatted line
[ "Test", "that", "the", "class", "responds", "correctly", "to", "an", "incorrectly", "formatted", "line" ]
[ "'''Test that the class responds correctly to an incorrectly formatted line'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testAddSinglePointMutant
null
def testAddSinglePointMutant(self): '''Test that we can add a mutant and write the resulting file. We add a SPM to an list of SPM's. The next test tests more complex possibilities.''' set = Data.MutationSet() set.addMutation(chain="B", residueIndex=120, mutation='CYS') self.list.addMutant(set) ...
Test that we can add a mutant and write the resulting file. We add a SPM to an list of SPM's. The next test tests more complex possibilities.
Test that we can add a mutant and write the resulting file. We add a SPM to an list of SPM's. The next test tests more complex possibilities.
[ "Test", "that", "we", "can", "add", "a", "mutant", "and", "write", "the", "resulting", "file", ".", "We", "add", "a", "SPM", "to", "an", "list", "of", "SPM", "'", "s", ".", "The", "next", "test", "tests", "more", "complex", "possibilities", "." ]
def testAddSinglePointMutant(self): set = Data.MutationSet() set.addMutation(chain="B", residueIndex=120, mutation='CYS') self.list.addMutant(set) self.assertEqual(self.list.mutants.count(set), 1) newList = Data.MutationListFile("SimpleMutationList") self.assertEqual(newList, self.list)
[ "def", "testAddSinglePointMutant", "(", "self", ")", ":", "set", "=", "Data", ".", "MutationSet", "(", ")", "set", ".", "addMutation", "(", "chain", "=", "\"B\"", ",", "residueIndex", "=", "120", ",", "mutation", "=", "'CYS'", ")", "self", ".", "list", ...
Test that we can add a mutant and write the resulting file.
[ "Test", "that", "we", "can", "add", "a", "mutant", "and", "write", "the", "resulting", "file", "." ]
[ "'''Test that we can add a mutant and write the resulting file.\n\t\t\n\t\tWe add a SPM to an list of SPM's. The next test tests more complex possibilities.'''", "#Check the mutant is added", "#Create a new list from the simple format file" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testAddComplexMutant
null
def testAddComplexMutant(self): '''Test can a change of format (Single to Standard) can be detected and dealt with''' set = Data.MutationSet() set.addMutation(chain="B", residueIndex=120, mutation='CYS') set.addMutation(chain="A", residueIndex=42, mutation='ALA') self.list.addMutant(set) #Test the ...
Test can a change of format (Single to Standard) can be detected and dealt with
Test can a change of format (Single to Standard) can be detected and dealt with
[ "Test", "can", "a", "change", "of", "format", "(", "Single", "to", "Standard", ")", "can", "be", "detected", "and", "dealt", "with" ]
def testAddComplexMutant(self): set = Data.MutationSet() set.addMutation(chain="B", residueIndex=120, mutation='CYS') set.addMutation(chain="A", residueIndex=42, mutation='ALA') self.list.addMutant(set) self.assertEqual(self.list.isStandardMutationFormat(), True) newList = Data.MutationListFile("SimpleMuta...
[ "def", "testAddComplexMutant", "(", "self", ")", ":", "set", "=", "Data", ".", "MutationSet", "(", ")", "set", ".", "addMutation", "(", "chain", "=", "\"B\"", ",", "residueIndex", "=", "120", ",", "mutation", "=", "'CYS'", ")", "set", ".", "addMutation",...
Test can a change of format (Single to Standard) can be detected and dealt with
[ "Test", "can", "a", "change", "of", "format", "(", "Single", "to", "Standard", ")", "can", "be", "detected", "and", "dealt", "with" ]
[ "'''Test can a change of format (Single to Standard) can be detected and dealt with'''", "#Test the format change is detected", "#Test that the file has been updated to the new format", "#Test that the two list are the same" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
25176634148c8c71a7aeba2a05c73a3c68b8d791
shambo001/peat
PEATSA/Core/Tests/UnitTests/TestMutants.py
[ "MIT" ]
Python
testRemoveMutant
null
def testRemoveMutant(self): '''Test we can remove an entry from the list''' mutationSet = self.list.mutantList()[0] self.list.removeMutant(mutationSet) #See if its removed self.assertEqual(self.list.mutantList().count(mutationSet), 0) #Check the file is updated properly newList = Data.MutationL...
Test we can remove an entry from the list
Test we can remove an entry from the list
[ "Test", "we", "can", "remove", "an", "entry", "from", "the", "list" ]
def testRemoveMutant(self): mutationSet = self.list.mutantList()[0] self.list.removeMutant(mutationSet) self.assertEqual(self.list.mutantList().count(mutationSet), 0) newList = Data.MutationListFile("SimpleMutationList") self.assertEqual(newList, self.list)
[ "def", "testRemoveMutant", "(", "self", ")", ":", "mutationSet", "=", "self", ".", "list", ".", "mutantList", "(", ")", "[", "0", "]", "self", ".", "list", ".", "removeMutant", "(", "mutationSet", ")", "self", ".", "assertEqual", "(", "self", ".", "lis...
Test we can remove an entry from the list
[ "Test", "we", "can", "remove", "an", "entry", "from", "the", "list" ]
[ "'''Test we can remove an entry from the list'''", "#See if its removed", "#Check the file is updated properly" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
442afe31e1e0361ff163da3585a4cf6d6a7b1677
shambo001/peat
PEATDB/TablePlot.py
[ "MIT" ]
Python
plotXY
<not_specific>
def plotXY(cls, x, y, title='',xlabel=None,ylabel=None): """Do xy plot of 2 lists and show correlation""" if cls.xscale == 1: if cls.yscale == 1: plotfig = pylab.loglog(x, y, cls.shape) else: plotfig = pylab.semilogx(x, y, cls.shape) ...
Do xy plot of 2 lists and show correlation
Do xy plot of 2 lists and show correlation
[ "Do", "xy", "plot", "of", "2", "lists", "and", "show", "correlation" ]
def plotXY(cls, x, y, title='',xlabel=None,ylabel=None): if cls.xscale == 1: if cls.yscale == 1: plotfig = pylab.loglog(x, y, cls.shape) else: plotfig = pylab.semilogx(x, y, cls.shape) elif cls.yscale == 1: plotfig = pylab.semil...
[ "def", "plotXY", "(", "cls", ",", "x", ",", "y", ",", "title", "=", "''", ",", "xlabel", "=", "None", ",", "ylabel", "=", "None", ")", ":", "if", "cls", ".", "xscale", "==", "1", ":", "if", "cls", ".", "yscale", "==", "1", ":", "plotfig", "="...
Do xy plot of 2 lists and show correlation
[ "Do", "xy", "plot", "of", "2", "lists", "and", "show", "correlation" ]
[ "\"\"\"Do xy plot of 2 lists and show correlation\"\"\"", "#legend" ]
[ { "param": "cls", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "title", "type": null }, { "param": "xlabel", "type": null }, { "param": "ylabel", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
442afe31e1e0361ff163da3585a4cf6d6a7b1677
shambo001/peat
PEATDB/TablePlot.py
[ "MIT" ]
Python
doHistogram
<not_specific>
def doHistogram(cls, recs, bins=10, title='', xlabel=None, ylabel=None): """Do a pylab histogram of a dict with 1 or more lists""" dim=int(ceil(len(recs)/2.0)) i=1 for r in recs: if len(recs[r])==0: continue pylab.subplot(2,dim,i) i=i+1...
Do a pylab histogram of a dict with 1 or more lists
Do a pylab histogram of a dict with 1 or more lists
[ "Do", "a", "pylab", "histogram", "of", "a", "dict", "with", "1", "or", "more", "lists" ]
def doHistogram(cls, recs, bins=10, title='', xlabel=None, ylabel=None): dim=int(ceil(len(recs)/2.0)) i=1 for r in recs: if len(recs[r])==0: continue pylab.subplot(2,dim,i) i=i+1 histogram = pylab.hist(recs[r],bins=bins) ...
[ "def", "doHistogram", "(", "cls", ",", "recs", ",", "bins", "=", "10", ",", "title", "=", "''", ",", "xlabel", "=", "None", ",", "ylabel", "=", "None", ")", ":", "dim", "=", "int", "(", "ceil", "(", "len", "(", "recs", ")", "/", "2.0", ")", "...
Do a pylab histogram of a dict with 1 or more lists
[ "Do", "a", "pylab", "histogram", "of", "a", "dict", "with", "1", "or", "more", "lists" ]
[ "\"\"\"Do a pylab histogram of a dict with 1 or more lists\"\"\"" ]
[ { "param": "cls", "type": null }, { "param": "recs", "type": null }, { "param": "bins", "type": null }, { "param": "title", "type": null }, { "param": "xlabel", "type": null }, { "param": "ylabel", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "recs", "type": null, "docstring": null, "docstring_tokens": []...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
updateCurrentMenu
<not_specific>
def updateCurrentMenu(self): """Update currently opened DBs menu from current proj dict""" menu = self.curr_menu['var'] menu.delete(0, menu.index(END)) menu.add_command(label='Close All',command=self.closeAll) menu.add_separator() for name in self.currentDBs: ...
Update currently opened DBs menu from current proj dict
Update currently opened DBs menu from current proj dict
[ "Update", "currently", "opened", "DBs", "menu", "from", "current", "proj", "dict" ]
def updateCurrentMenu(self): menu = self.curr_menu['var'] menu.delete(0, menu.index(END)) menu.add_command(label='Close All',command=self.closeAll) menu.add_separator() for name in self.currentDBs: data = self.currentDBs[name] def func(data): ...
[ "def", "updateCurrentMenu", "(", "self", ")", ":", "menu", "=", "self", ".", "curr_menu", "[", "'var'", "]", "menu", ".", "delete", "(", "0", ",", "menu", ".", "index", "(", "END", ")", ")", "menu", ".", "add_command", "(", "label", "=", "'Close All'...
Update currently opened DBs menu from current proj dict
[ "Update", "currently", "opened", "DBs", "menu", "from", "current", "proj", "dict" ]
[ "\"\"\"Update currently opened DBs menu from current proj dict\"\"\"", "#hide current" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
createStatusPane
<not_specific>
def createStatusPane(self): """Small status pane for db specific info""" statusframe = Frame(self.main) statusframe.grid(row=0,column=1,columnspan=1,rowspan=1, sticky='news', padx=2) self.sizevar=StringVar() self.numrecsvar=StringVar() self.s...
Small status pane for db specific info
Small status pane for db specific info
[ "Small", "status", "pane", "for", "db", "specific", "info" ]
def createStatusPane(self): statusframe = Frame(self.main) statusframe.grid(row=0,column=1,columnspan=1,rowspan=1, sticky='news', padx=2) self.sizevar=StringVar() self.numrecsvar=StringVar() self.storagetypevar=StringVar() self.updateStatusPa...
[ "def", "createStatusPane", "(", "self", ")", ":", "statusframe", "=", "Frame", "(", "self", ".", "main", ")", "statusframe", ".", "grid", "(", "row", "=", "0", ",", "column", "=", "1", ",", "columnspan", "=", "1", ",", "rowspan", "=", "1", ",", "st...
Small status pane for db specific info
[ "Small", "status", "pane", "for", "db", "specific", "info" ]
[ "\"\"\"Small status pane for db specific info\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
createInfoPane
<not_specific>
def createInfoPane(self): """Make info panel for logging etc""" self.eventlog = Pmw.ScrolledText(self.main, labelpos = 'nw', label_text='Messages', usehullsize = 1, ...
Make info panel for logging etc
Make info panel for logging etc
[ "Make", "info", "panel", "for", "logging", "etc" ]
def createInfoPane(self): self.eventlog = Pmw.ScrolledText(self.main, labelpos = 'nw', label_text='Messages', usehullsize = 1, hull_width=self.M...
[ "def", "createInfoPane", "(", "self", ")", ":", "self", ".", "eventlog", "=", "Pmw", ".", "ScrolledText", "(", "self", ".", "main", ",", "labelpos", "=", "'nw'", ",", "label_text", "=", "'Messages'", ",", "usehullsize", "=", "1", ",", "hull_width", "=", ...
Make info panel for logging etc
[ "Make", "info", "panel", "for", "logging", "etc" ]
[ "\"\"\"Make info panel for logging etc\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
createChildFrame
<not_specific>
def createChildFrame(self, width=400, title=''): """Create a child frame in sidepane or as toplevel""" if self.showDialogsinSidePane == True: self.resetSidePane(width=width) #cframe = Frame(master=self.sidepane) #cframe.pack(fill=BOTH,expand=1) cframe = se...
Create a child frame in sidepane or as toplevel
Create a child frame in sidepane or as toplevel
[ "Create", "a", "child", "frame", "in", "sidepane", "or", "as", "toplevel" ]
def createChildFrame(self, width=400, title=''): if self.showDialogsinSidePane == True: self.resetSidePane(width=width) cframe = self.sidepane else: cframe = Toplevel() cframe.geometry('+100+450') cframe.title(title) return cframe
[ "def", "createChildFrame", "(", "self", ",", "width", "=", "400", ",", "title", "=", "''", ")", ":", "if", "self", ".", "showDialogsinSidePane", "==", "True", ":", "self", ".", "resetSidePane", "(", "width", "=", "width", ")", "cframe", "=", "self", "....
Create a child frame in sidepane or as toplevel
[ "Create", "a", "child", "frame", "in", "sidepane", "or", "as", "toplevel" ]
[ "\"\"\"Create a child frame in sidepane or as toplevel\"\"\"", "#cframe = Frame(master=self.sidepane)", "#cframe.pack(fill=BOTH,expand=1)" ]
[ { "param": "self", "type": null }, { "param": "width", "type": null }, { "param": "title", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "width", "type": null, "docstring": null, "docstring_tokens": ...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
createMenuBar
<not_specific>
def createMenuBar(self): """Create the menu bar for the application. """ self.menu=Menu(self.main) self.file_menu={ '01Remote Project':{'cmd':self.connectDialog}, '02User Setup':{'cmd':self.loginSetup}, '03Open local Project':{'cmd':self.openLoca...
Create the menu bar for the application.
Create the menu bar for the application.
[ "Create", "the", "menu", "bar", "for", "the", "application", "." ]
def createMenuBar(self): self.menu=Menu(self.main) self.file_menu={ '01Remote Project':{'cmd':self.connectDialog}, '02User Setup':{'cmd':self.loginSetup}, '03Open local Project':{'cmd':self.openLocal}, '04New Project':{'cmd':self...
[ "def", "createMenuBar", "(", "self", ")", ":", "self", ".", "menu", "=", "Menu", "(", "self", ".", "main", ")", "self", ".", "file_menu", "=", "{", "'01Remote Project'", ":", "{", "'cmd'", ":", "self", ".", "connectDialog", "}", ",", "'02User Setup'", ...
Create the menu bar for the application.
[ "Create", "the", "menu", "bar", "for", "the", "application", "." ]
[ "\"\"\"Create the menu bar for the application. \"\"\"", "#'02Import Mutants':{'cmd':self.importMutants},", "#'02Export to csv file':{'cmd':self.exportCSV}," ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
updateMenus
<not_specific>
def updateMenus(self, load=False, close=False): """Do whatever changes to menus required wehen we load and close""" if load==True: self.updateLabbooksMenu() self.updateCurrentMenu() return
Do whatever changes to menus required wehen we load and close
Do whatever changes to menus required wehen we load and close
[ "Do", "whatever", "changes", "to", "menus", "required", "wehen", "we", "load", "and", "close" ]
def updateMenus(self, load=False, close=False): if load==True: self.updateLabbooksMenu() self.updateCurrentMenu() return
[ "def", "updateMenus", "(", "self", ",", "load", "=", "False", ",", "close", "=", "False", ")", ":", "if", "load", "==", "True", ":", "self", ".", "updateLabbooksMenu", "(", ")", "self", ".", "updateCurrentMenu", "(", ")", "return" ]
Do whatever changes to menus required wehen we load and close
[ "Do", "whatever", "changes", "to", "menus", "required", "wehen", "we", "load", "and", "close" ]
[ "\"\"\"Do whatever changes to menus required wehen we load and close\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "load", "type": null }, { "param": "close", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "load", "type": null, "docstring": null, "docstring_tokens": [...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
toggleMenus
<not_specific>
def toggleMenus(self, state='normal'): """Enable or disable main menus when DB is loaded""" items = [2,3,4,6,7,8] if 'Darwin' in platform.platform(): items = [] for i in items: self.menu.entryconfig(i, state=state) return
Enable or disable main menus when DB is loaded
Enable or disable main menus when DB is loaded
[ "Enable", "or", "disable", "main", "menus", "when", "DB", "is", "loaded" ]
def toggleMenus(self, state='normal'): items = [2,3,4,6,7,8] if 'Darwin' in platform.platform(): items = [] for i in items: self.menu.entryconfig(i, state=state) return
[ "def", "toggleMenus", "(", "self", ",", "state", "=", "'normal'", ")", ":", "items", "=", "[", "2", ",", "3", ",", "4", ",", "6", ",", "7", ",", "8", "]", "if", "'Darwin'", "in", "platform", ".", "platform", "(", ")", ":", "items", "=", "[", ...
Enable or disable main menus when DB is loaded
[ "Enable", "or", "disable", "main", "menus", "when", "DB", "is", "loaded" ]
[ "\"\"\"Enable or disable main menus when DB is loaded\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "state", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "state", "type": null, "docstring": null, "docstring_tokens": ...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
addPrevProjects
<not_specific>
def addPrevProjects(self, parentmenu): """Add previous projects from prefs file to the DB menu""" import string, types self.recentmenu = submenu = Menu(parentmenu, tearoff=1) for s in self.preferences.get('recent'): if s and type(s) is types.TupleType: server,...
Add previous projects from prefs file to the DB menu
Add previous projects from prefs file to the DB menu
[ "Add", "previous", "projects", "from", "prefs", "file", "to", "the", "DB", "menu" ]
def addPrevProjects(self, parentmenu): import string, types self.recentmenu = submenu = Menu(parentmenu, tearoff=1) for s in self.preferences.get('recent'): if s and type(s) is types.TupleType: server,port,project,backend=s text=server+':'+str(port)+':...
[ "def", "addPrevProjects", "(", "self", ",", "parentmenu", ")", ":", "import", "string", ",", "types", "self", ".", "recentmenu", "=", "submenu", "=", "Menu", "(", "parentmenu", ",", "tearoff", "=", "1", ")", "for", "s", "in", "self", ".", "preferences", ...
Add previous projects from prefs file to the DB menu
[ "Add", "previous", "projects", "from", "prefs", "file", "to", "the", "DB", "menu" ]
[ "\"\"\"Add previous projects from prefs file to the DB menu\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "parentmenu", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "parentmenu", "type": null, "docstring": null, "docstring_toke...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
connectDialog
<not_specific>
def connectDialog(self, event=None): """Get a server/port, storage and open DB""" backends = PDatabase.backends mpDlg = MultipleValDialog(title='Connect to DB', initialvalues=(self.username, self.password, self.server, ...
Get a server/port, storage and open DB
Get a server/port, storage and open DB
[ "Get", "a", "server", "/", "port", "storage", "and", "open", "DB" ]
def connectDialog(self, event=None): backends = PDatabase.backends mpDlg = MultipleValDialog(title='Connect to DB', initialvalues=(self.username, self.password, self.server, self.port, self.project, ...
[ "def", "connectDialog", "(", "self", ",", "event", "=", "None", ")", ":", "backends", "=", "PDatabase", ".", "backends", "mpDlg", "=", "MultipleValDialog", "(", "title", "=", "'Connect to DB'", ",", "initialvalues", "=", "(", "self", ".", "username", ",", ...
Get a server/port, storage and open DB
[ "Get", "a", "server", "/", "port", "storage", "and", "open", "DB" ]
[ "\"\"\"Get a server/port, storage and open DB\"\"\"", "#We can try to close current db now", "'''answer = self.closeDB()\n if answer == 'cancel':\n return'''" ]
[ { "param": "self", "type": null }, { "param": "event", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": ...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
addtoRecent
<not_specific>
def addtoRecent(self, value): """"Store loaded project info in prefs""" prev = self.preferences.get('recent') if not value in prev: prev.append(value) self.preferences.set('recent', prev) return
Store loaded project info in prefs
Store loaded project info in prefs
[ "Store", "loaded", "project", "info", "in", "prefs" ]
def addtoRecent(self, value): prev = self.preferences.get('recent') if not value in prev: prev.append(value) self.preferences.set('recent', prev) return
[ "def", "addtoRecent", "(", "self", ",", "value", ")", ":", "prev", "=", "self", ".", "preferences", ".", "get", "(", "'recent'", ")", "if", "not", "value", "in", "prev", ":", "prev", ".", "append", "(", "value", ")", "self", ".", "preferences", ".", ...
Store loaded project info in prefs
[ "Store", "loaded", "project", "info", "in", "prefs" ]
[ "\"\"\"\"Store loaded project info in prefs\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "value", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "value", "type": null, "docstring": null, "docstring_tokens": ...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
loadDB
<not_specific>
def loadDB(self, DB): """Load peat db and display it in a table""" #createtableframe should be optimised for reading large dbs self.DB = DB self.removeBlankCanvas() self.createSidePane() self.tablemodel = PEATTableModel(DB) self.tableframe = Frame(self.masterframe...
Load peat db and display it in a table
Load peat db and display it in a table
[ "Load", "peat", "db", "and", "display", "it", "in", "a", "table" ]
def loadDB(self, DB): self.DB = DB self.removeBlankCanvas() self.createSidePane() self.tablemodel = PEATTableModel(DB) self.tableframe = Frame(self.masterframe, bd=1,relief=RAISED) self.table = PEATTable(self.tableframe, self.tablemodel, parentapp=self) self.table...
[ "def", "loadDB", "(", "self", ",", "DB", ")", ":", "self", ".", "DB", "=", "DB", "self", ".", "removeBlankCanvas", "(", ")", "self", ".", "createSidePane", "(", ")", "self", ".", "tablemodel", "=", "PEATTableModel", "(", "DB", ")", "self", ".", "tabl...
Load peat db and display it in a table
[ "Load", "peat", "db", "and", "display", "it", "in", "a", "table" ]
[ "\"\"\"Load peat db and display it in a table\"\"\"", "#createtableframe should be optimised for reading large dbs", "#we are using a panedwindow", "#print self.project" ]
[ { "param": "self", "type": null }, { "param": "DB", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "DB", "type": null, "docstring": null, "docstring_tokens": [],...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
addDB
<not_specific>
def addDB(self, name, DB): """Add DB to current dbs dict""" d = {'db':DB} if DB.storagetype == 'local': d['filename'] = self.filename else: d['filename'] = None d['project'] = self.project self.currentDBs[name] = d return
Add DB to current dbs dict
Add DB to current dbs dict
[ "Add", "DB", "to", "current", "dbs", "dict" ]
def addDB(self, name, DB): d = {'db':DB} if DB.storagetype == 'local': d['filename'] = self.filename else: d['filename'] = None d['project'] = self.project self.currentDBs[name] = d return
[ "def", "addDB", "(", "self", ",", "name", ",", "DB", ")", ":", "d", "=", "{", "'db'", ":", "DB", "}", "if", "DB", ".", "storagetype", "==", "'local'", ":", "d", "[", "'filename'", "]", "=", "self", ".", "filename", "else", ":", "d", "[", "'file...
Add DB to current dbs dict
[ "Add", "DB", "to", "current", "dbs", "dict" ]
[ "\"\"\"Add DB to current dbs dict\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "DB", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
saveDB
<not_specific>
def saveDB(self, event=None): """Save current changes, conflicts are handled here""" if self.DB.isChanged() == False: return #cache changed objects in case of conflict? import copy if self.username == '': tkMessageBox.showwarning("Set a user name", ...
Save current changes, conflicts are handled here
Save current changes, conflicts are handled here
[ "Save", "current", "changes", "conflicts", "are", "handled", "here" ]
def saveDB(self, event=None): if self.DB.isChanged() == False: return import copy if self.username == '': tkMessageBox.showwarning("Set a user name", 'You need to set a user name before saving.\n' '...
[ "def", "saveDB", "(", "self", ",", "event", "=", "None", ")", ":", "if", "self", ".", "DB", ".", "isChanged", "(", ")", "==", "False", ":", "return", "import", "copy", "if", "self", ".", "username", "==", "''", ":", "tkMessageBox", ".", "showwarning"...
Save current changes, conflicts are handled here
[ "Save", "current", "changes", "conflicts", "are", "handled", "here" ]
[ "\"\"\"Save current changes, conflicts are handled here\"\"\"", "#cache changed objects in case of conflict?", "'''handle this inside db class??'''", "#self.DB.connection.sync()", "#first cache changed objects, abort", "#and update then we try to apply users changes", "#self.DB.connection.sync()", "#r...
[ { "param": "self", "type": null }, { "param": "event", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": ...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
saveAs
<not_specific>
def saveAs(self): """Save a local copy of the DB, if the DB is remote, this acts as a local backup, but may take some time to get the data from the server, need to warn user before we start""" if self.DB == None: return size = round(self.DB.getSize()/1024,1) ...
Save a local copy of the DB, if the DB is remote, this acts as a local backup, but may take some time to get the data from the server, need to warn user before we start
Save a local copy of the DB, if the DB is remote, this acts as a local backup, but may take some time to get the data from the server, need to warn user before we start
[ "Save", "a", "local", "copy", "of", "the", "DB", "if", "the", "DB", "is", "remote", "this", "acts", "as", "a", "local", "backup", "but", "may", "take", "some", "time", "to", "get", "the", "data", "from", "the", "server", "need", "to", "warn", "user",...
def saveAs(self): if self.DB == None: return size = round(self.DB.getSize()/1024,1) if size > 30: answer = tkMessageBox.askyesno("DB Save Warning", 'This Database is %s MB in size.\n' 'Are you s...
[ "def", "saveAs", "(", "self", ")", ":", "if", "self", ".", "DB", "==", "None", ":", "return", "size", "=", "round", "(", "self", ".", "DB", ".", "getSize", "(", ")", "/", "1024", ",", "1", ")", "if", "size", ">", "30", ":", "answer", "=", "tk...
Save a local copy of the DB, if the DB is remote, this acts as a local backup, but may take some time to get the data from the server, need to warn user before we start
[ "Save", "a", "local", "copy", "of", "the", "DB", "if", "the", "DB", "is", "remote", "this", "acts", "as", "a", "local", "backup", "but", "may", "take", "some", "time", "to", "get", "the", "data", "from", "the", "server", "need", "to", "warn", "user",...
[ "\"\"\"Save a local copy of the DB, if the DB is remote, this acts as a local\n backup, but may take some time to get the data from the server, need to\n warn user before we start\"\"\"", "#show progress dialog", "#newDB.cellcache = copy.deepcopy(self.DB.cellcache)" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
closeAll
<not_specific>
def closeAll(self): """close all currently opened DBs except current viewed""" names = self.currentDBs.keys() if self.DB != None: currproj = self.DB.meta.info['project'] else: currproj = '' for name in names: if name == currproj: ...
close all currently opened DBs except current viewed
close all currently opened DBs except current viewed
[ "close", "all", "currently", "opened", "DBs", "except", "current", "viewed" ]
def closeAll(self): names = self.currentDBs.keys() if self.DB != None: currproj = self.DB.meta.info['project'] else: currproj = '' for name in names: if name == currproj: self.closeDB() else: db = self.curren...
[ "def", "closeAll", "(", "self", ")", ":", "names", "=", "self", ".", "currentDBs", ".", "keys", "(", ")", "if", "self", ".", "DB", "!=", "None", ":", "currproj", "=", "self", ".", "DB", ".", "meta", ".", "info", "[", "'project'", "]", "else", ":"...
close all currently opened DBs except current viewed
[ "close", "all", "currently", "opened", "DBs", "except", "current", "viewed" ]
[ "\"\"\"close all currently opened DBs except current viewed\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
openProjectfromTable
<not_specific>
def openProjectfromTable(self, protein=None, field_name=None): """Open remote project from table cell""" if self.DB == None: return D = self.DB.data if not D[protein].has_key(field_name): return settings = D[protein][field_name] #print settings ...
Open remote project from table cell
Open remote project from table cell
[ "Open", "remote", "project", "from", "table", "cell" ]
def openProjectfromTable(self, protein=None, field_name=None): if self.DB == None: return D = self.DB.data if not D[protein].has_key(field_name): return settings = D[protein][field_name] self.connect(**settings) return
[ "def", "openProjectfromTable", "(", "self", ",", "protein", "=", "None", ",", "field_name", "=", "None", ")", ":", "if", "self", ".", "DB", "==", "None", ":", "return", "D", "=", "self", ".", "DB", ".", "data", "if", "not", "D", "[", "protein", "]"...
Open remote project from table cell
[ "Open", "remote", "project", "from", "table", "cell" ]
[ "\"\"\"Open remote project from table cell\"\"\"", "#print settings" ]
[ { "param": "self", "type": null }, { "param": "protein", "type": null }, { "param": "field_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein", "type": null, "docstring": null, "docstring_tokens"...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
addRecordDialog
<not_specific>
def addRecordDialog(self, event=None): """Add a new protein to our database""" if self.DB == None: return self.added=False def closewin(event=None): enterwin.destroy() return def add(): self.added = self.addRecord(new_name.get()) ...
Add a new protein to our database
Add a new protein to our database
[ "Add", "a", "new", "protein", "to", "our", "database" ]
def addRecordDialog(self, event=None): if self.DB == None: return self.added=False def closewin(event=None): enterwin.destroy() return def add(): self.added = self.addRecord(new_name.get()) if self.added == False: ...
[ "def", "addRecordDialog", "(", "self", ",", "event", "=", "None", ")", ":", "if", "self", ".", "DB", "==", "None", ":", "return", "self", ".", "added", "=", "False", "def", "closewin", "(", "event", "=", "None", ")", ":", "enterwin", ".", "destroy", ...
Add a new protein to our database
[ "Add", "a", "new", "protein", "to", "our", "database" ]
[ "\"\"\"Add a new protein to our database\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "event", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": ...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
addRecordAction
<not_specific>
def addRecordAction(self, name, action=None): """Additional actions when adding a new rec""" if action == None: return if action == 'DNA': tkMessageBox.showinfo("Add DNA sequence", 'I will now start DNAtool. ' ...
Additional actions when adding a new rec
Additional actions when adding a new rec
[ "Additional", "actions", "when", "adding", "a", "new", "rec" ]
def addRecordAction(self, name, action=None): if action == None: return if action == 'DNA': tkMessageBox.showinfo("Add DNA sequence", 'I will now start DNAtool. ' 'Load your DNA sequence, select the open ' ...
[ "def", "addRecordAction", "(", "self", ",", "name", ",", "action", "=", "None", ")", ":", "if", "action", "==", "None", ":", "return", "if", "action", "==", "'DNA'", ":", "tkMessageBox", ".", "showinfo", "(", "\"Add DNA sequence\"", ",", "'I will now start D...
Additional actions when adding a new rec
[ "Additional", "actions", "when", "adding", "a", "new", "rec" ]
[ "\"\"\"Additional actions when adding a new rec\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "action", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
addColumnDialog
<not_specific>
def addColumnDialog(self): """Get a description of the field and add it""" if self.DB == None: return def close(event=None): dataf_spec.destroy() return def add(): self.DB.addField(name=name_var.var.get(), fieldtype=type_var.var.get()) ...
Get a description of the field and add it
Get a description of the field and add it
[ "Get", "a", "description", "of", "the", "field", "and", "add", "it" ]
def addColumnDialog(self): if self.DB == None: return def close(event=None): dataf_spec.destroy() return def add(): self.DB.addField(name=name_var.var.get(), fieldtype=type_var.var.get()) dataf_spec.destroy() self.updateTabl...
[ "def", "addColumnDialog", "(", "self", ")", ":", "if", "self", ".", "DB", "==", "None", ":", "return", "def", "close", "(", "event", "=", "None", ")", ":", "dataf_spec", ".", "destroy", "(", ")", "return", "def", "add", "(", ")", ":", "self", ".", ...
Get a description of the field and add it
[ "Get", "a", "description", "of", "the", "field", "and", "add", "it" ]
[ "\"\"\"Get a description of the field and add it\"\"\"", "# Grab all input", "# Get the name" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
undo
<not_specific>
def undo(self): """Undo all changes since last commit to DB""" if self.DB == None or self.DB.isChanged() == False: return self.DB.abort() self.updateTable() return
Undo all changes since last commit to DB
Undo all changes since last commit to DB
[ "Undo", "all", "changes", "since", "last", "commit", "to", "DB" ]
def undo(self): if self.DB == None or self.DB.isChanged() == False: return self.DB.abort() self.updateTable() return
[ "def", "undo", "(", "self", ")", ":", "if", "self", ".", "DB", "==", "None", "or", "self", ".", "DB", ".", "isChanged", "(", ")", "==", "False", ":", "return", "self", ".", "DB", ".", "abort", "(", ")", "self", ".", "updateTable", "(", ")", "re...
Undo all changes since last commit to DB
[ "Undo", "all", "changes", "since", "last", "commit", "to", "DB" ]
[ "\"\"\"Undo all changes since last commit to DB\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
updateView
<not_specific>
def updateView(self): """Update the table if no changes pending""" if self.DB==None: return if self.DB.isChanged() == True: tkMessageBox.showinfo('Pending changes', 'You have pending changes and should save these first.', ...
Update the table if no changes pending
Update the table if no changes pending
[ "Update", "the", "table", "if", "no", "changes", "pending" ]
def updateView(self): if self.DB==None: return if self.DB.isChanged() == True: tkMessageBox.showinfo('Pending changes', 'You have pending changes and should save these first.', parent=self.master) r...
[ "def", "updateView", "(", "self", ")", ":", "if", "self", ".", "DB", "==", "None", ":", "return", "if", "self", ".", "DB", ".", "isChanged", "(", ")", "==", "True", ":", "tkMessageBox", ".", "showinfo", "(", "'Pending changes'", ",", "'You have pending c...
Update the table if no changes pending
[ "Update", "the", "table", "if", "no", "changes", "pending" ]
[ "\"\"\"Update the table if no changes pending\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
updateTable
<not_specific>
def updateTable(self, protein=None, field_name=None): """To be called whenever a change to DB needs to be reflected in table. """ if self.DB == None: return DB=self.DB if hasattr(self, 'table') and self.table != None: #Update the table model to reflec...
To be called whenever a change to DB needs to be reflected in table.
To be called whenever a change to DB needs to be reflected in table.
[ "To", "be", "called", "whenever", "a", "change", "to", "DB", "needs", "to", "be", "reflected", "in", "table", "." ]
def updateTable(self, protein=None, field_name=None): if self.DB == None: return DB=self.DB if hasattr(self, 'table') and self.table != None: model = self.tablemodel if self.table.rows < 10000: sortcol = self.table.sortcol else: ...
[ "def", "updateTable", "(", "self", ",", "protein", "=", "None", ",", "field_name", "=", "None", ")", ":", "if", "self", ".", "DB", "==", "None", ":", "return", "DB", "=", "self", ".", "DB", "if", "hasattr", "(", "self", ",", "'table'", ")", "and", ...
To be called whenever a change to DB needs to be reflected in table.
[ "To", "be", "called", "whenever", "a", "change", "to", "DB", "needs", "to", "be", "reflected", "in", "table", "." ]
[ "\"\"\"To be called whenever a change to DB needs to be reflected in\n table. \"\"\"", "#Update the table model to reflect changes in DB and redraw the table" ]
[ { "param": "self", "type": null }, { "param": "protein", "type": null }, { "param": "field_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein", "type": null, "docstring": null, "docstring_tokens"...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
showBlankCanvas
<not_specific>
def showBlankCanvas(self, frame, row): """Create a blank canvas for introduction""" width=900 height=750 cv=Canvas(frame, width=self.canvas_x_size-self.canvas_border_x, height=self.canvas_y-self.canvas_border_y, scrollr...
Create a blank canvas for introduction
Create a blank canvas for introduction
[ "Create", "a", "blank", "canvas", "for", "introduction" ]
def showBlankCanvas(self, frame, row): width=900 height=750 cv=Canvas(frame, width=self.canvas_x_size-self.canvas_border_x, height=self.canvas_y-self.canvas_border_y, scrollregion=(0,0,self.canvas_x_size,self.canvas_y), ...
[ "def", "showBlankCanvas", "(", "self", ",", "frame", ",", "row", ")", ":", "width", "=", "900", "height", "=", "750", "cv", "=", "Canvas", "(", "frame", ",", "width", "=", "self", ".", "canvas_x_size", "-", "self", ".", "canvas_border_x", ",", "height"...
Create a blank canvas for introduction
[ "Create", "a", "blank", "canvas", "for", "introduction" ]
[ "\"\"\"Create a blank canvas for introduction\"\"\"", "#frame.add(cv)" ]
[ { "param": "self", "type": null }, { "param": "frame", "type": null }, { "param": "row", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "frame", "type": null, "docstring": null, "docstring_tokens": ...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
welcomeLogo
<not_specific>
def welcomeLogo(self): """Show the welcome logo and text""" self.removeLogo() self.logo=None import tkFont try: logo = PEAT_images.logo_large_mono() self.cv.create_image(self.canvas_x_size/2,self.canvas_y_size/2,image=logo) self.cv.image=logo ...
Show the welcome logo and text
Show the welcome logo and text
[ "Show", "the", "welcome", "logo", "and", "text" ]
def welcomeLogo(self): self.removeLogo() self.logo=None import tkFont try: logo = PEAT_images.logo_large_mono() self.cv.create_image(self.canvas_x_size/2,self.canvas_y_size/2,image=logo) self.cv.image=logo except: import tkFont ...
[ "def", "welcomeLogo", "(", "self", ")", ":", "self", ".", "removeLogo", "(", ")", "self", ".", "logo", "=", "None", "import", "tkFont", "try", ":", "logo", "=", "PEAT_images", ".", "logo_large_mono", "(", ")", "self", ".", "cv", ".", "create_image", "(...
Show the welcome logo and text
[ "Show", "the", "welcome", "logo", "and", "text" ]
[ "\"\"\"Show the welcome logo and text\"\"\"", "# Remove the logo after some time", "#self.wait=self.after(4000, self.show_startinstructions)" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
removeLogo
<not_specific>
def removeLogo(self,event=None): """Remove the logo and welcome message.""" if self.cv == None: return self.cv.delete('logo') self.cv.image=None self.master.unbind('<KeyPress>') self.master.unbind('<Button-1>') try: self.after_cancel(self.w...
Remove the logo and welcome message.
Remove the logo and welcome message.
[ "Remove", "the", "logo", "and", "welcome", "message", "." ]
def removeLogo(self,event=None): if self.cv == None: return self.cv.delete('logo') self.cv.image=None self.master.unbind('<KeyPress>') self.master.unbind('<Button-1>') try: self.after_cancel(self.wait) except: pass retur...
[ "def", "removeLogo", "(", "self", ",", "event", "=", "None", ")", ":", "if", "self", ".", "cv", "==", "None", ":", "return", "self", ".", "cv", ".", "delete", "(", "'logo'", ")", "self", ".", "cv", ".", "image", "=", "None", "self", ".", "master"...
Remove the logo and welcome message.
[ "Remove", "the", "logo", "and", "welcome", "message", "." ]
[ "\"\"\"Remove the logo and welcome message.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "event", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": ...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
recordEvent
<not_specific>
def recordEvent(self,message='Timestamp'): """Display a message in the eventlog""" import time tid=time.strftime('%H:%M:%S %d/%m',time.localtime(time.time())) self.eventlog.insert('0.0','%s: %s\n' %(tid,message)) self.master.update_idletasks() return
Display a message in the eventlog
Display a message in the eventlog
[ "Display", "a", "message", "in", "the", "eventlog" ]
def recordEvent(self,message='Timestamp'): import time tid=time.strftime('%H:%M:%S %d/%m',time.localtime(time.time())) self.eventlog.insert('0.0','%s: %s\n' %(tid,message)) self.master.update_idletasks() return
[ "def", "recordEvent", "(", "self", ",", "message", "=", "'Timestamp'", ")", ":", "import", "time", "tid", "=", "time", ".", "strftime", "(", "'%H:%M:%S %d/%m'", ",", "time", ".", "localtime", "(", "time", ".", "time", "(", ")", ")", ")", "self", ".", ...
Display a message in the eventlog
[ "Display", "a", "message", "in", "the", "eventlog" ]
[ "\"\"\"Display a message in the eventlog\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "message", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "message", "type": null, "docstring": null, "docstring_tokens"...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
dofindText
<not_specific>
def dofindText(self, event=None): """Find the text in the table""" if not hasattr(self,'currenttable'): return import string if string.strip(self.findtext.get())=='': return searchstring=self.findtext.get() if self.currenttable!=None: s...
Find the text in the table
Find the text in the table
[ "Find", "the", "text", "in", "the", "table" ]
def dofindText(self, event=None): if not hasattr(self,'currenttable'): return import string if string.strip(self.findtext.get())=='': return searchstring=self.findtext.get() if self.currenttable!=None: self.currenttable.findValue(searchstring) ...
[ "def", "dofindText", "(", "self", ",", "event", "=", "None", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'currenttable'", ")", ":", "return", "import", "string", "if", "string", ".", "strip", "(", "self", ".", "findtext", ".", "get", "(", ")...
Find the text in the table
[ "Find", "the", "text", "in", "the", "table" ]
[ "\"\"\"Find the text in the table\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "event", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": ...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
loginSetup
<not_specific>
def loginSetup(self): """Login setttings for authentication to ZEO""" mpDlg = MultipleValDialog(title='Login settings', initialvalues=(self.username, self.password), labels=('user ...
Login setttings for authentication to ZEO
Login setttings for authentication to ZEO
[ "Login", "setttings", "for", "authentication", "to", "ZEO" ]
def loginSetup(self): mpDlg = MultipleValDialog(title='Login settings', initialvalues=(self.username, self.password), labels=('user name','password'), ty...
[ "def", "loginSetup", "(", "self", ")", ":", "mpDlg", "=", "MultipleValDialog", "(", "title", "=", "'Login settings'", ",", "initialvalues", "=", "(", "self", ".", "username", ",", "self", ".", "password", ")", ",", "labels", "=", "(", "'user name'", ",", ...
Login setttings for authentication to ZEO
[ "Login", "setttings", "for", "authentication", "to", "ZEO" ]
[ "\"\"\"Login setttings for authentication to ZEO\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
importMutants
<not_specific>
def importMutants(self): """Specialised import method for adding mutant data from a csv file. Requires a wt structure to create mutant AA sequences""" def getpdb(): return def doimport(): #self.DB.importDict(importdata=IM.data, namefield='name') #use ...
Specialised import method for adding mutant data from a csv file. Requires a wt structure to create mutant AA sequences
Specialised import method for adding mutant data from a csv file. Requires a wt structure to create mutant AA sequences
[ "Specialised", "import", "method", "for", "adding", "mutant", "data", "from", "a", "csv", "file", ".", "Requires", "a", "wt", "structure", "to", "create", "mutant", "AA", "sequences" ]
def importMutants(self): def getpdb(): return def doimport(): return fr=Frame() win=Toplevel() Label(win, text='This dialog allows you to import a set of mutant data\n' 'along with some associated experimental values. You will\n' ...
[ "def", "importMutants", "(", "self", ")", ":", "def", "getpdb", "(", ")", ":", "return", "def", "doimport", "(", ")", ":", "return", "fr", "=", "Frame", "(", ")", "win", "=", "Toplevel", "(", ")", "Label", "(", "win", ",", "text", "=", "'This dialo...
Specialised import method for adding mutant data from a csv file.
[ "Specialised", "import", "method", "for", "adding", "mutant", "data", "from", "a", "csv", "file", "." ]
[ "\"\"\"Specialised import method for adding mutant data from a csv\n file. Requires a wt structure to create mutant AA sequences\"\"\"", "#self.DB.importDict(importdata=IM.data, namefield='name')", "#use mutations field to derive aa seq.." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
importFileset
<not_specific>
def importFileset(self): """Use filehandler class to import a set of external files""" if self.DB == None: return fh = FileHandler(parent=self) if self.showDialogsinSidePane == True and self.DB!=None: self.resetSidePane(width=300) f=self.sidepane ...
Use filehandler class to import a set of external files
Use filehandler class to import a set of external files
[ "Use", "filehandler", "class", "to", "import", "a", "set", "of", "external", "files" ]
def importFileset(self): if self.DB == None: return fh = FileHandler(parent=self) if self.showDialogsinSidePane == True and self.DB!=None: self.resetSidePane(width=300) f=self.sidepane else: f=None fh.importFileset(DB=self.DB, paren...
[ "def", "importFileset", "(", "self", ")", ":", "if", "self", ".", "DB", "==", "None", ":", "return", "fh", "=", "FileHandler", "(", "parent", "=", "self", ")", "if", "self", ".", "showDialogsinSidePane", "==", "True", "and", "self", ".", "DB", "!=", ...
Use filehandler class to import a set of external files
[ "Use", "filehandler", "class", "to", "import", "a", "set", "of", "external", "files" ]
[ "\"\"\"Use filehandler class to import a set of external files\"\"\"", "#self.updateTable()" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
exportExtFiles
<not_specific>
def exportExtFiles(self): """Get all stored ext files in DB and save to folder""" fh = FileHandler(parent=self) fh.exportExtFiles(DB=self.DB) return
Get all stored ext files in DB and save to folder
Get all stored ext files in DB and save to folder
[ "Get", "all", "stored", "ext", "files", "in", "DB", "and", "save", "to", "folder" ]
def exportExtFiles(self): fh = FileHandler(parent=self) fh.exportExtFiles(DB=self.DB) return
[ "def", "exportExtFiles", "(", "self", ")", ":", "fh", "=", "FileHandler", "(", "parent", "=", "self", ")", "fh", ".", "exportExtFiles", "(", "DB", "=", "self", ".", "DB", ")", "return" ]
Get all stored ext files in DB and save to folder
[ "Get", "all", "stored", "ext", "files", "in", "DB", "and", "save", "to", "folder" ]
[ "\"\"\"Get all stored ext files in DB and save to folder\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
showExtFiles
<not_specific>
def showExtFiles(self): """Display all stored ext files in DB""" fh = FileHandler(parent=self) fh.displayExtFiles(DB=self.DB) return
Display all stored ext files in DB
Display all stored ext files in DB
[ "Display", "all", "stored", "ext", "files", "in", "DB" ]
def showExtFiles(self): fh = FileHandler(parent=self) fh.displayExtFiles(DB=self.DB) return
[ "def", "showExtFiles", "(", "self", ")", ":", "fh", "=", "FileHandler", "(", "parent", "=", "self", ")", "fh", ".", "displayExtFiles", "(", "DB", "=", "self", ".", "DB", ")", "return" ]
Display all stored ext files in DB
[ "Display", "all", "stored", "ext", "files", "in", "DB" ]
[ "\"\"\"Display all stored ext files in DB\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
inspectDBMeta
<not_specific>
def inspectDBMeta(self): """View DB meta like userfields, mainly for debugging""" if self.DB == None: return #We reuse the ekin meta data class here.. should make a base class #and inherit ekin and this one from it.. from Meta import PEATMetaData self.PM = PEA...
View DB meta like userfields, mainly for debugging
View DB meta like userfields, mainly for debugging
[ "View", "DB", "meta", "like", "userfields", "mainly", "for", "debugging" ]
def inspectDBMeta(self): if self.DB == None: return from Meta import PEATMetaData self.PM = PEATMetaData(data=self.DB.meta) self.mwin = self.PM.createDialog(parent=self.main) self.main.wait_window(self.mwin) return
[ "def", "inspectDBMeta", "(", "self", ")", ":", "if", "self", ".", "DB", "==", "None", ":", "return", "from", "Meta", "import", "PEATMetaData", "self", ".", "PM", "=", "PEATMetaData", "(", "data", "=", "self", ".", "DB", ".", "meta", ")", "self", ".",...
View DB meta like userfields, mainly for debugging
[ "View", "DB", "meta", "like", "userfields", "mainly", "for", "debugging" ]
[ "\"\"\"View DB meta like userfields, mainly for debugging\"\"\"", "#We reuse the ekin meta data class here.. should make a base class", "#and inherit ekin and this one from it.." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
editDBInfo
<not_specific>
def editDBInfo(self): """Edit info field of Meta for DB""" if self.DB == None: return from Meta import PEATMetaData self.PM = PEATMetaData(data=self.DB.meta.info) self.mwin = self.PM.createDialog(parent=self.main, label='DB Specific Info') self.main.wait_wind...
Edit info field of Meta for DB
Edit info field of Meta for DB
[ "Edit", "info", "field", "of", "Meta", "for", "DB" ]
def editDBInfo(self): if self.DB == None: return from Meta import PEATMetaData self.PM = PEATMetaData(data=self.DB.meta.info) self.mwin = self.PM.createDialog(parent=self.main, label='DB Specific Info') self.main.wait_window(self.mwin) return
[ "def", "editDBInfo", "(", "self", ")", ":", "if", "self", ".", "DB", "==", "None", ":", "return", "from", "Meta", "import", "PEATMetaData", "self", ".", "PM", "=", "PEATMetaData", "(", "data", "=", "self", ".", "DB", ".", "meta", ".", "info", ")", ...
Edit info field of Meta for DB
[ "Edit", "info", "field", "of", "Meta", "for", "DB" ]
[ "\"\"\"Edit info field of Meta for DB\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
editDictField
<not_specific>
def editDictField(self, protein, field_name, default={}): """Edit a field that's a dict structure""" D = self.DB.data if D[protein].has_key(field_name): data=D[protein][field_name] else: data=default import types if not type(data) is types.DictType...
Edit a field that's a dict structure
Edit a field that's a dict structure
[ "Edit", "a", "field", "that", "'", "s", "a", "dict", "structure" ]
def editDictField(self, protein, field_name, default={}): D = self.DB.data if D[protein].has_key(field_name): data=D[protein][field_name] else: data=default import types if not type(data) is types.DictType: return vals = data.values() ...
[ "def", "editDictField", "(", "self", ",", "protein", ",", "field_name", ",", "default", "=", "{", "}", ")", ":", "D", "=", "self", ".", "DB", ".", "data", "if", "D", "[", "protein", "]", ".", "has_key", "(", "field_name", ")", ":", "data", "=", "...
Edit a field that's a dict structure
[ "Edit", "a", "field", "that", "'", "s", "a", "dict", "structure" ]
[ "\"\"\"Edit a field that's a dict structure\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "protein", "type": null }, { "param": "field_name", "type": null }, { "param": "default", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein", "type": null, "docstring": null, "docstring_tokens"...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
edit_notes
<not_specific>
def edit_notes(self, protein, field_name): """edit notes in a text frame""" D = self.DB.data if D[protein].has_key(field_name): data=D[protein][field_name] else: data=None info={} info['record']=protein info['column']=field_name im...
edit notes in a text frame
edit notes in a text frame
[ "edit", "notes", "in", "a", "text", "frame" ]
def edit_notes(self, protein, field_name): D = self.DB.data if D[protein].has_key(field_name): data=D[protein][field_name] else: data=None info={} info['record']=protein info['column']=field_name import textFrame self.notesframe=tex...
[ "def", "edit_notes", "(", "self", ",", "protein", ",", "field_name", ")", ":", "D", "=", "self", ".", "DB", ".", "data", "if", "D", "[", "protein", "]", ".", "has_key", "(", "field_name", ")", ":", "data", "=", "D", "[", "protein", "]", "[", "fie...
edit notes in a text frame
[ "edit", "notes", "in", "a", "text", "frame" ]
[ "\"\"\"edit notes in a text frame\"\"\"", "# did we get any data back?", "# Got the record and column - add the data" ]
[ { "param": "self", "type": null }, { "param": "protein", "type": null }, { "param": "field_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein", "type": null, "docstring": null, "docstring_tokens"...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
display_file
<not_specific>
def display_file(self, protein, field_name): """Uses a new method of file storage with blobs We just get the blob from the filerecord object""" D = self.DB.data if D[protein].has_key(field_name): filerec=D[protein][field_name] else: return fh = ...
Uses a new method of file storage with blobs We just get the blob from the filerecord object
Uses a new method of file storage with blobs We just get the blob from the filerecord object
[ "Uses", "a", "new", "method", "of", "file", "storage", "with", "blobs", "We", "just", "get", "the", "blob", "from", "the", "filerecord", "object" ]
def display_file(self, protein, field_name): D = self.DB.data if D[protein].has_key(field_name): filerec=D[protein][field_name] else: return fh = FileHandler(self) fh.displayFile(filerec) return
[ "def", "display_file", "(", "self", ",", "protein", ",", "field_name", ")", ":", "D", "=", "self", ".", "DB", ".", "data", "if", "D", "[", "protein", "]", ".", "has_key", "(", "field_name", ")", ":", "filerec", "=", "D", "[", "protein", "]", "[", ...
Uses a new method of file storage with blobs We just get the blob from the filerecord object
[ "Uses", "a", "new", "method", "of", "file", "storage", "with", "blobs", "We", "just", "get", "the", "blob", "from", "the", "filerecord", "object" ]
[ "\"\"\"Uses a new method of file storage with blobs\n We just get the blob from the filerecord object\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "protein", "type": null }, { "param": "field_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein", "type": null, "docstring": null, "docstring_tokens"...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
add_file
<not_specific>
def add_file(self,protein,field_name): """Uses a new method of file storage with blobs We just get the blob from the filerecord object""" D = self.DB.data if D[protein].has_key(field_name): filerec=D[protein][field_name] else: filerec=None fh = ...
Uses a new method of file storage with blobs We just get the blob from the filerecord object
Uses a new method of file storage with blobs We just get the blob from the filerecord object
[ "Uses", "a", "new", "method", "of", "file", "storage", "with", "blobs", "We", "just", "get", "the", "blob", "from", "the", "filerecord", "object" ]
def add_file(self,protein,field_name): D = self.DB.data if D[protein].has_key(field_name): filerec=D[protein][field_name] else: filerec=None fh = FileHandler(self) newfile = fh.addFileDialog(filerec) if newfile: self.DB.addBlob(protein,...
[ "def", "add_file", "(", "self", ",", "protein", ",", "field_name", ")", ":", "D", "=", "self", ".", "DB", ".", "data", "if", "D", "[", "protein", "]", ".", "has_key", "(", "field_name", ")", ":", "filerec", "=", "D", "[", "protein", "]", "[", "fi...
Uses a new method of file storage with blobs We just get the blob from the filerecord object
[ "Uses", "a", "new", "method", "of", "file", "storage", "with", "blobs", "We", "just", "get", "the", "blob", "from", "the", "filerecord", "object" ]
[ "\"\"\"Uses a new method of file storage with blobs\n We just get the blob from the filerecord object\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "protein", "type": null }, { "param": "field_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein", "type": null, "docstring": null, "docstring_tokens"...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
save_structure
<not_specific>
def save_structure(self,protein,field_name,filename=None): """Save a PDB file from a Structure cell""" pdblines,X=self.DB.getStructure(protein,field_name) if not pdblines: return if filename==None: import tkFileDialog, os savedir=self.preferences.get('...
Save a PDB file from a Structure cell
Save a PDB file from a Structure cell
[ "Save", "a", "PDB", "file", "from", "a", "Structure", "cell" ]
def save_structure(self,protein,field_name,filename=None): pdblines,X=self.DB.getStructure(protein,field_name) if not pdblines: return if filename==None: import tkFileDialog, os savedir=self.preferences.get('datadir') filename=tkFileDialog.asksavea...
[ "def", "save_structure", "(", "self", ",", "protein", ",", "field_name", ",", "filename", "=", "None", ")", ":", "pdblines", ",", "X", "=", "self", ".", "DB", ".", "getStructure", "(", "protein", ",", "field_name", ")", "if", "not", "pdblines", ":", "r...
Save a PDB file from a Structure cell
[ "Save", "a", "PDB", "file", "from", "a", "Structure", "cell" ]
[ "\"\"\"Save a PDB file from a Structure cell\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "protein", "type": null }, { "param": "field_name", "type": null }, { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein", "type": null, "docstring": null, "docstring_tokens"...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
format_protein_sequence
<not_specific>
def format_protein_sequence(self,sequence): """ Returns a string containing the one-letter sequence""" if not sequence: return '' seq='' self.aa={'ALA':'A','CYS':'C','ASP':'D','GLU':'E','PHE':'F','GLY':'G','HIS':'H', 'ILE':'I','LYS':'K','LEU':'L','MET':'M','AS...
Returns a string containing the one-letter sequence
Returns a string containing the one-letter sequence
[ "Returns", "a", "string", "containing", "the", "one", "-", "letter", "sequence" ]
def format_protein_sequence(self,sequence): if not sequence: return '' seq='' self.aa={'ALA':'A','CYS':'C','ASP':'D','GLU':'E','PHE':'F','GLY':'G','HIS':'H', 'ILE':'I','LYS':'K','LEU':'L','MET':'M','ASN':'N','PRO':'P','GLN':'Q', 'ARG':'R','SER':'S','TH...
[ "def", "format_protein_sequence", "(", "self", ",", "sequence", ")", ":", "if", "not", "sequence", ":", "return", "''", "seq", "=", "''", "self", ".", "aa", "=", "{", "'ALA'", ":", "'A'", ",", "'CYS'", ":", "'C'", ",", "'ASP'", ":", "'D'", ",", "'G...
Returns a string containing the one-letter sequence
[ "Returns", "a", "string", "containing", "the", "one", "-", "letter", "sequence" ]
[ "\"\"\" Returns a string containing the one-letter sequence\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "sequence", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sequence", "type": null, "docstring": null, "docstring_tokens...
d71e084ddc7784f35b79a8714d486016cc84b74a
shambo001/peat
PEATDB/PEATApp.py
[ "MIT" ]
Python
display_sequence
<not_specific>
def display_sequence(self,protein,field_name): """Display the sequence of the current protein regardless of which column is chosen""" D = self.DB.data if D.has_key(protein): sequence=self.get_protein_sequence(protein) sequence=self.format_protein_sequence(sequence) ...
Display the sequence of the current protein regardless of which column is chosen
Display the sequence of the current protein regardless of which column is chosen
[ "Display", "the", "sequence", "of", "the", "current", "protein", "regardless", "of", "which", "column", "is", "chosen" ]
def display_sequence(self,protein,field_name): D = self.DB.data if D.has_key(protein): sequence=self.get_protein_sequence(protein) sequence=self.format_protein_sequence(sequence) import tkFont font=tkFont.Font(family='Courier',size=14,weight='bold') ...
[ "def", "display_sequence", "(", "self", ",", "protein", ",", "field_name", ")", ":", "D", "=", "self", ".", "DB", ".", "data", "if", "D", ".", "has_key", "(", "protein", ")", ":", "sequence", "=", "self", ".", "get_protein_sequence", "(", "protein", ")...
Display the sequence of the current protein regardless of which column is chosen
[ "Display", "the", "sequence", "of", "the", "current", "protein", "regardless", "of", "which", "column", "is", "chosen" ]
[ "\"\"\"Display the sequence of the current protein regardless of which column is chosen\"\"\"", "\"\"\"\"Get font\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "protein", "type": null }, { "param": "field_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein", "type": null, "docstring": null, "docstring_tokens"...