repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
Spinmob/spinmob | _data.py | databox.get_data_point | def get_data_point(self, n):
"""
Returns the n'th data point (starting at 0) from all columns.
Parameters
----------
n
Index of data point to return.
"""
# loop over the columns and pop the data
point = []
for k in self.ckeys: p... | python | def get_data_point(self, n):
"""
Returns the n'th data point (starting at 0) from all columns.
Parameters
----------
n
Index of data point to return.
"""
# loop over the columns and pop the data
point = []
for k in self.ckeys: p... | [
"def",
"get_data_point",
"(",
"self",
",",
"n",
")",
":",
"# loop over the columns and pop the data",
"point",
"=",
"[",
"]",
"for",
"k",
"in",
"self",
".",
"ckeys",
":",
"point",
".",
"append",
"(",
"self",
"[",
"k",
"]",
"[",
"n",
"]",
")",
"return",... | Returns the n'th data point (starting at 0) from all columns.
Parameters
----------
n
Index of data point to return. | [
"Returns",
"the",
"n",
"th",
"data",
"point",
"(",
"starting",
"at",
"0",
")",
"from",
"all",
"columns",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L614-L626 |
Spinmob/spinmob | _data.py | databox.pop_data_point | def pop_data_point(self, n):
"""
This will remove and return the n'th data point (starting at 0) from
all columns.
Parameters
----------
n
Index of data point to pop.
"""
# loop over the columns and pop the data
popped = []
... | python | def pop_data_point(self, n):
"""
This will remove and return the n'th data point (starting at 0) from
all columns.
Parameters
----------
n
Index of data point to pop.
"""
# loop over the columns and pop the data
popped = []
... | [
"def",
"pop_data_point",
"(",
"self",
",",
"n",
")",
":",
"# loop over the columns and pop the data",
"popped",
"=",
"[",
"]",
"for",
"k",
"in",
"self",
".",
"ckeys",
":",
"# first convert to a list",
"data",
"=",
"list",
"(",
"self",
".",
"c",
"(",
"k",
"... | This will remove and return the n'th data point (starting at 0) from
all columns.
Parameters
----------
n
Index of data point to pop. | [
"This",
"will",
"remove",
"and",
"return",
"the",
"n",
"th",
"data",
"point",
"(",
"starting",
"at",
"0",
")",
"from",
"all",
"columns",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L629-L653 |
Spinmob/spinmob | _data.py | databox.insert_data_point | def insert_data_point(self, new_data, index=None):
"""
Inserts a data point at index n.
Parameters
----------
new_data
A list or array of new data points, one for each column.
index
Where to insert the point(s) in each column. N... | python | def insert_data_point(self, new_data, index=None):
"""
Inserts a data point at index n.
Parameters
----------
new_data
A list or array of new data points, one for each column.
index
Where to insert the point(s) in each column. N... | [
"def",
"insert_data_point",
"(",
"self",
",",
"new_data",
",",
"index",
"=",
"None",
")",
":",
"if",
"not",
"len",
"(",
"new_data",
")",
"==",
"len",
"(",
"self",
".",
"columns",
")",
"and",
"not",
"len",
"(",
"self",
".",
"columns",
")",
"==",
"0"... | Inserts a data point at index n.
Parameters
----------
new_data
A list or array of new data points, one for each column.
index
Where to insert the point(s) in each column. None => append. | [
"Inserts",
"a",
"data",
"point",
"at",
"index",
"n",
".",
"Parameters",
"----------",
"new_data",
"A",
"list",
"or",
"array",
"of",
"new",
"data",
"points",
"one",
"for",
"each",
"column",
".",
"index",
"Where",
"to",
"insert",
"the",
"point",
"(",
"s",
... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L655-L689 |
Spinmob/spinmob | _data.py | databox.execute_script | def execute_script(self, script, g=None):
"""
Runs a script, returning the result.
Parameters
----------
script
String script to be evaluated (see below).
g=None
Optional dictionary of additional globals for the script evaluation.
Thes... | python | def execute_script(self, script, g=None):
"""
Runs a script, returning the result.
Parameters
----------
script
String script to be evaluated (see below).
g=None
Optional dictionary of additional globals for the script evaluation.
Thes... | [
"def",
"execute_script",
"(",
"self",
",",
"script",
",",
"g",
"=",
"None",
")",
":",
"# add any extra user-supplied global variables for the eventual eval() call.",
"if",
"not",
"g",
"==",
"None",
":",
"self",
".",
"extra_globals",
".",
"update",
"(",
"g",
")",
... | Runs a script, returning the result.
Parameters
----------
script
String script to be evaluated (see below).
g=None
Optional dictionary of additional globals for the script evaluation.
These will automatically be inserted into self.extra_globals.
... | [
"Runs",
"a",
"script",
"returning",
"the",
"result",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L702-L772 |
Spinmob/spinmob | _data.py | databox._parse_script | def _parse_script(self, script, n=0):
"""
This takes a script such as "a/b where a=c('current'), b=3.3" and returns
["a/b", {"a":self.columns["current"], "b":3.3}]
You can also just use an integer for script to reference columns by number
or use the column label as the script.
... | python | def _parse_script(self, script, n=0):
"""
This takes a script such as "a/b where a=c('current'), b=3.3" and returns
["a/b", {"a":self.columns["current"], "b":3.3}]
You can also just use an integer for script to reference columns by number
or use the column label as the script.
... | [
"def",
"_parse_script",
"(",
"self",
",",
"script",
",",
"n",
"=",
"0",
")",
":",
"if",
"n",
">",
"1000",
":",
"print",
"(",
"\"This script ran recursively 1000 times!\"",
")",
"a",
"=",
"input",
"(",
"\"<enter> or (q)uit: \"",
")",
"if",
"a",
".",
"strip"... | This takes a script such as "a/b where a=c('current'), b=3.3" and returns
["a/b", {"a":self.columns["current"], "b":3.3}]
You can also just use an integer for script to reference columns by number
or use the column label as the script.
n is for internal use. Don't use it. In fact, don'... | [
"This",
"takes",
"a",
"script",
"such",
"as",
"a",
"/",
"b",
"where",
"a",
"=",
"c",
"(",
"current",
")",
"b",
"=",
"3",
".",
"3",
"and",
"returns",
"[",
"a",
"/",
"b",
"{",
"a",
":",
"self",
".",
"columns",
"[",
"current",
"]",
"b",
":",
"... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L777-L876 |
Spinmob/spinmob | _data.py | databox.copy_headers | def copy_headers(self, source_databox):
"""
Loops over the hkeys of the source_databox, updating this databoxes' header.
"""
for k in source_databox.hkeys: self.insert_header(k, source_databox.h(k))
return self | python | def copy_headers(self, source_databox):
"""
Loops over the hkeys of the source_databox, updating this databoxes' header.
"""
for k in source_databox.hkeys: self.insert_header(k, source_databox.h(k))
return self | [
"def",
"copy_headers",
"(",
"self",
",",
"source_databox",
")",
":",
"for",
"k",
"in",
"source_databox",
".",
"hkeys",
":",
"self",
".",
"insert_header",
"(",
"k",
",",
"source_databox",
".",
"h",
"(",
"k",
")",
")",
"return",
"self"
] | Loops over the hkeys of the source_databox, updating this databoxes' header. | [
"Loops",
"over",
"the",
"hkeys",
"of",
"the",
"source_databox",
"updating",
"this",
"databoxes",
"header",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L880-L886 |
Spinmob/spinmob | _data.py | databox.copy_columns | def copy_columns(self, source_databox):
"""
Loops over the ckeys of the source_databox, updating this databoxes' columns.
"""
for k in source_databox.ckeys: self.insert_column(source_databox[k], k)
return self | python | def copy_columns(self, source_databox):
"""
Loops over the ckeys of the source_databox, updating this databoxes' columns.
"""
for k in source_databox.ckeys: self.insert_column(source_databox[k], k)
return self | [
"def",
"copy_columns",
"(",
"self",
",",
"source_databox",
")",
":",
"for",
"k",
"in",
"source_databox",
".",
"ckeys",
":",
"self",
".",
"insert_column",
"(",
"source_databox",
"[",
"k",
"]",
",",
"k",
")",
"return",
"self"
] | Loops over the ckeys of the source_databox, updating this databoxes' columns. | [
"Loops",
"over",
"the",
"ckeys",
"of",
"the",
"source_databox",
"updating",
"this",
"databoxes",
"columns",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L888-L894 |
Spinmob/spinmob | _data.py | databox.copy_all | def copy_all(self, source_databox):
"""
Copies the header and columns from source_databox to this databox.
"""
self.copy_headers(source_databox)
self.copy_columns(source_databox)
return self | python | def copy_all(self, source_databox):
"""
Copies the header and columns from source_databox to this databox.
"""
self.copy_headers(source_databox)
self.copy_columns(source_databox)
return self | [
"def",
"copy_all",
"(",
"self",
",",
"source_databox",
")",
":",
"self",
".",
"copy_headers",
"(",
"source_databox",
")",
"self",
".",
"copy_columns",
"(",
"source_databox",
")",
"return",
"self"
] | Copies the header and columns from source_databox to this databox. | [
"Copies",
"the",
"header",
"and",
"columns",
"from",
"source_databox",
"to",
"this",
"databox",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L896-L902 |
Spinmob/spinmob | _data.py | databox.insert_globals | def insert_globals(self, *args, **kwargs):
"""
Appends or overwrites the supplied object in the self.extra_globals.
Use this to expose execute_script() or _parse_script() etc... to external
objects and functions.
Regular arguments are assumed to have a __name__ attribute (as is... | python | def insert_globals(self, *args, **kwargs):
"""
Appends or overwrites the supplied object in the self.extra_globals.
Use this to expose execute_script() or _parse_script() etc... to external
objects and functions.
Regular arguments are assumed to have a __name__ attribute (as is... | [
"def",
"insert_globals",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"a",
"in",
"args",
":",
"kwargs",
"[",
"a",
".",
"__name__",
"]",
"=",
"a",
"self",
".",
"extra_globals",
".",
"update",
"(",
"kwargs",
")"
] | Appends or overwrites the supplied object in the self.extra_globals.
Use this to expose execute_script() or _parse_script() etc... to external
objects and functions.
Regular arguments are assumed to have a __name__ attribute (as is the
case for functions) to use as the key, and keyword... | [
"Appends",
"or",
"overwrites",
"the",
"supplied",
"object",
"in",
"the",
"self",
".",
"extra_globals",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L904-L916 |
Spinmob/spinmob | _data.py | databox.insert_header | def insert_header(self, hkey, value, index=None):
"""
This will insert/overwrite a value to the header and hkeys.
Parameters
----------
hkey
Header key. Will be appended to self.hkeys if non existent, or
inserted at the specified index.
If h... | python | def insert_header(self, hkey, value, index=None):
"""
This will insert/overwrite a value to the header and hkeys.
Parameters
----------
hkey
Header key. Will be appended to self.hkeys if non existent, or
inserted at the specified index.
If h... | [
"def",
"insert_header",
"(",
"self",
",",
"hkey",
",",
"value",
",",
"index",
"=",
"None",
")",
":",
"#if hkey is '': return",
"# if it's an integer, use the hkey from the list",
"if",
"type",
"(",
"hkey",
")",
"in",
"[",
"int",
",",
"int",
"]",
":",
"hkey",
... | This will insert/overwrite a value to the header and hkeys.
Parameters
----------
hkey
Header key. Will be appended to self.hkeys if non existent, or
inserted at the specified index.
If hkey is an integer, uses self.hkeys[hkey].
value
Va... | [
"This",
"will",
"insert",
"/",
"overwrite",
"a",
"value",
"to",
"the",
"header",
"and",
"hkeys",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L918-L945 |
Spinmob/spinmob | _data.py | databox.is_same_as | def is_same_as(self, other_databox, headers=True, columns=True, header_order=True, column_order=True, ckeys=True):
"""
Tests that the important (i.e. savable) information in this databox
is the same as that of the other_databox.
Parameters
----------
other_databo... | python | def is_same_as(self, other_databox, headers=True, columns=True, header_order=True, column_order=True, ckeys=True):
"""
Tests that the important (i.e. savable) information in this databox
is the same as that of the other_databox.
Parameters
----------
other_databo... | [
"def",
"is_same_as",
"(",
"self",
",",
"other_databox",
",",
"headers",
"=",
"True",
",",
"columns",
"=",
"True",
",",
"header_order",
"=",
"True",
",",
"column_order",
"=",
"True",
",",
"ckeys",
"=",
"True",
")",
":",
"d",
"=",
"other_databox",
"if",
... | Tests that the important (i.e. savable) information in this databox
is the same as that of the other_databox.
Parameters
----------
other_databox
Databox with which to compare.
headers=True
Make sure all header elements match.
columns=True... | [
"Tests",
"that",
"the",
"important",
"(",
"i",
".",
"e",
".",
"savable",
")",
"information",
"in",
"this",
"databox",
"is",
"the",
"same",
"as",
"that",
"of",
"the",
"other_databox",
".",
"Parameters",
"----------",
"other_databox",
"Databox",
"with",
"which... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L948-L1018 |
Spinmob/spinmob | _data.py | databox.pop_header | def pop_header(self, hkey, ignore_error=False):
"""
This will remove and return the specified header value.
Parameters
----------
hkey
Header key you wish to pop.
You can specify either a key string or an index.
ignore_error=False
Whe... | python | def pop_header(self, hkey, ignore_error=False):
"""
This will remove and return the specified header value.
Parameters
----------
hkey
Header key you wish to pop.
You can specify either a key string or an index.
ignore_error=False
Whe... | [
"def",
"pop_header",
"(",
"self",
",",
"hkey",
",",
"ignore_error",
"=",
"False",
")",
":",
"# try the integer approach first to allow negative values",
"if",
"type",
"(",
"hkey",
")",
"is",
"not",
"str",
":",
"try",
":",
"return",
"self",
".",
"headers",
".",... | This will remove and return the specified header value.
Parameters
----------
hkey
Header key you wish to pop.
You can specify either a key string or an index.
ignore_error=False
Whether to quietly ignore any errors (i.e., hkey not found). | [
"This",
"will",
"remove",
"and",
"return",
"the",
"specified",
"header",
"value",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1022-L1055 |
Spinmob/spinmob | _data.py | databox.pop_column | def pop_column(self, ckey):
"""
This will remove and return the data in the specified column.
You can specify either a key string or an index.
"""
# try the integer approach first to allow negative values
if type(ckey) is not str:
return self.columns.pop(sel... | python | def pop_column(self, ckey):
"""
This will remove and return the data in the specified column.
You can specify either a key string or an index.
"""
# try the integer approach first to allow negative values
if type(ckey) is not str:
return self.columns.pop(sel... | [
"def",
"pop_column",
"(",
"self",
",",
"ckey",
")",
":",
"# try the integer approach first to allow negative values",
"if",
"type",
"(",
"ckey",
")",
"is",
"not",
"str",
":",
"return",
"self",
".",
"columns",
".",
"pop",
"(",
"self",
".",
"ckeys",
".",
"pop"... | This will remove and return the data in the specified column.
You can specify either a key string or an index. | [
"This",
"will",
"remove",
"and",
"return",
"the",
"data",
"in",
"the",
"specified",
"column",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1059-L1079 |
Spinmob/spinmob | _data.py | databox.insert_column | def insert_column(self, data_array, ckey='temp', index=None):
"""
This will insert/overwrite a new column and fill it with the data from the
the supplied array.
Parameters
----------
data_array
Data; can be a list, but will be converted to numpy arr... | python | def insert_column(self, data_array, ckey='temp', index=None):
"""
This will insert/overwrite a new column and fill it with the data from the
the supplied array.
Parameters
----------
data_array
Data; can be a list, but will be converted to numpy arr... | [
"def",
"insert_column",
"(",
"self",
",",
"data_array",
",",
"ckey",
"=",
"'temp'",
",",
"index",
"=",
"None",
")",
":",
"# if it's an integer, use the ckey from the list",
"if",
"type",
"(",
"ckey",
")",
"in",
"[",
"int",
",",
"int",
"]",
":",
"ckey",
"="... | This will insert/overwrite a new column and fill it with the data from the
the supplied array.
Parameters
----------
data_array
Data; can be a list, but will be converted to numpy array
ckey
Name of the column; if an integer is supplied,... | [
"This",
"will",
"insert",
"/",
"overwrite",
"a",
"new",
"column",
"and",
"fill",
"it",
"with",
"the",
"data",
"from",
"the",
"the",
"supplied",
"array",
".",
"Parameters",
"----------",
"data_array",
"Data",
";",
"can",
"be",
"a",
"list",
"but",
"will",
... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1081-L1105 |
Spinmob/spinmob | _data.py | databox.append_column | def append_column(self, data_array, ckey='temp'):
"""
This will append a new column and fill it with the data from the
the supplied array.
Parameters
----------
data_array
Data; can be a list, but will be converted to numpy array
ckey ... | python | def append_column(self, data_array, ckey='temp'):
"""
This will append a new column and fill it with the data from the
the supplied array.
Parameters
----------
data_array
Data; can be a list, but will be converted to numpy array
ckey ... | [
"def",
"append_column",
"(",
"self",
",",
"data_array",
",",
"ckey",
"=",
"'temp'",
")",
":",
"if",
"not",
"type",
"(",
"ckey",
")",
"is",
"str",
":",
"print",
"(",
"\"ERROR: ckey should be a string!\"",
")",
"return",
"if",
"ckey",
"in",
"self",
".",
"c... | This will append a new column and fill it with the data from the
the supplied array.
Parameters
----------
data_array
Data; can be a list, but will be converted to numpy array
ckey
Name of the column. | [
"This",
"will",
"append",
"a",
"new",
"column",
"and",
"fill",
"it",
"with",
"the",
"data",
"from",
"the",
"the",
"supplied",
"array",
".",
"Parameters",
"----------",
"data_array",
"Data",
";",
"can",
"be",
"a",
"list",
"but",
"will",
"be",
"converted",
... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1107-L1127 |
Spinmob/spinmob | _data.py | databox.rename_header | def rename_header(self, old_name, new_name):
"""
This will rename the header. The supplied names need to be strings.
"""
self.hkeys[self.hkeys.index(old_name)] = new_name
self.headers[new_name] = self.headers.pop(old_name)
return self | python | def rename_header(self, old_name, new_name):
"""
This will rename the header. The supplied names need to be strings.
"""
self.hkeys[self.hkeys.index(old_name)] = new_name
self.headers[new_name] = self.headers.pop(old_name)
return self | [
"def",
"rename_header",
"(",
"self",
",",
"old_name",
",",
"new_name",
")",
":",
"self",
".",
"hkeys",
"[",
"self",
".",
"hkeys",
".",
"index",
"(",
"old_name",
")",
"]",
"=",
"new_name",
"self",
".",
"headers",
"[",
"new_name",
"]",
"=",
"self",
"."... | This will rename the header. The supplied names need to be strings. | [
"This",
"will",
"rename",
"the",
"header",
".",
"The",
"supplied",
"names",
"need",
"to",
"be",
"strings",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1153-L1159 |
Spinmob/spinmob | _data.py | databox.rename_column | def rename_column(self, column, new_name):
"""
This will rename the column.
The supplied column can be an integer or the old column name.
"""
if type(column) is not str: column = self.ckeys[column]
self.ckeys[self.ckeys.index(column)] = new_name
self.columns[new_n... | python | def rename_column(self, column, new_name):
"""
This will rename the column.
The supplied column can be an integer or the old column name.
"""
if type(column) is not str: column = self.ckeys[column]
self.ckeys[self.ckeys.index(column)] = new_name
self.columns[new_n... | [
"def",
"rename_column",
"(",
"self",
",",
"column",
",",
"new_name",
")",
":",
"if",
"type",
"(",
"column",
")",
"is",
"not",
"str",
":",
"column",
"=",
"self",
".",
"ckeys",
"[",
"column",
"]",
"self",
".",
"ckeys",
"[",
"self",
".",
"ckeys",
".",... | This will rename the column.
The supplied column can be an integer or the old column name. | [
"This",
"will",
"rename",
"the",
"column",
".",
"The",
"supplied",
"column",
"can",
"be",
"an",
"integer",
"or",
"the",
"old",
"column",
"name",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1161-L1169 |
Spinmob/spinmob | _data.py | databox.trim | def trim(self, *conditions):
"""
Removes data points not satisfying the supplied conditions. Conditions
can be truth arrays (having the same length as the columns!)
or scripted strings.
Example Workflow
----------------
d1 = spinmob.data.load()
d2 = d1.tr... | python | def trim(self, *conditions):
"""
Removes data points not satisfying the supplied conditions. Conditions
can be truth arrays (having the same length as the columns!)
or scripted strings.
Example Workflow
----------------
d1 = spinmob.data.load()
d2 = d1.tr... | [
"def",
"trim",
"(",
"self",
",",
"*",
"conditions",
")",
":",
"conditions",
"=",
"list",
"(",
"conditions",
")",
"# if necessary, evaluate string scripts",
"for",
"n",
"in",
"range",
"(",
"len",
"(",
"conditions",
")",
")",
":",
"if",
"type",
"(",
"conditi... | Removes data points not satisfying the supplied conditions. Conditions
can be truth arrays (having the same length as the columns!)
or scripted strings.
Example Workflow
----------------
d1 = spinmob.data.load()
d2 = d1.trim( (2<d1[0]) & (d1[0]<10) | (d1[3]==22), 'sin(d[... | [
"Removes",
"data",
"points",
"not",
"satisfying",
"the",
"supplied",
"conditions",
".",
"Conditions",
"can",
"be",
"truth",
"arrays",
"(",
"having",
"the",
"same",
"length",
"as",
"the",
"columns!",
")",
"or",
"scripted",
"strings",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1171-L1200 |
Spinmob/spinmob | _data.py | databox.transpose | def transpose(self):
"""
Returns a copy of this databox with the columns as rows.
Currently requires that the databox has equal-length columns.
"""
# Create an empty databox with the same headers and delimiter.
d = databox(delimter=self.delimiter)
self.co... | python | def transpose(self):
"""
Returns a copy of this databox with the columns as rows.
Currently requires that the databox has equal-length columns.
"""
# Create an empty databox with the same headers and delimiter.
d = databox(delimter=self.delimiter)
self.co... | [
"def",
"transpose",
"(",
"self",
")",
":",
"# Create an empty databox with the same headers and delimiter.",
"d",
"=",
"databox",
"(",
"delimter",
"=",
"self",
".",
"delimiter",
")",
"self",
".",
"copy_headers",
"(",
"d",
")",
"# Get the transpose",
"z",
"=",
"_n"... | Returns a copy of this databox with the columns as rows.
Currently requires that the databox has equal-length columns. | [
"Returns",
"a",
"copy",
"of",
"this",
"databox",
"with",
"the",
"columns",
"as",
"rows",
".",
"Currently",
"requires",
"that",
"the",
"databox",
"has",
"equal",
"-",
"length",
"columns",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1202-L1218 |
Spinmob/spinmob | _data.py | databox.update_headers | def update_headers(self, dictionary, keys=None):
"""
Updates the header with the supplied dictionary. If keys=None, it
will be unsorted. Otherwise it will loop over the supplied keys
(a list) in order.
"""
if keys is None: keys = list(dictionary.keys())
for k in k... | python | def update_headers(self, dictionary, keys=None):
"""
Updates the header with the supplied dictionary. If keys=None, it
will be unsorted. Otherwise it will loop over the supplied keys
(a list) in order.
"""
if keys is None: keys = list(dictionary.keys())
for k in k... | [
"def",
"update_headers",
"(",
"self",
",",
"dictionary",
",",
"keys",
"=",
"None",
")",
":",
"if",
"keys",
"is",
"None",
":",
"keys",
"=",
"list",
"(",
"dictionary",
".",
"keys",
"(",
")",
")",
"for",
"k",
"in",
"keys",
":",
"self",
".",
"insert_he... | Updates the header with the supplied dictionary. If keys=None, it
will be unsorted. Otherwise it will loop over the supplied keys
(a list) in order. | [
"Updates",
"the",
"header",
"with",
"the",
"supplied",
"dictionary",
".",
"If",
"keys",
"=",
"None",
"it",
"will",
"be",
"unsorted",
".",
"Otherwise",
"it",
"will",
"loop",
"over",
"the",
"supplied",
"keys",
"(",
"a",
"list",
")",
"in",
"order",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1221-L1229 |
Spinmob/spinmob | _data.py | databox.c | def c(self, *args, **kwargs):
"""
Takes a single argument or keyword argument, and returns the specified
column. If the argument (or keyword argument) is an integer, return the
n'th column, otherwise return the column based on key.
If no arguments are supplied, simply ... | python | def c(self, *args, **kwargs):
"""
Takes a single argument or keyword argument, and returns the specified
column. If the argument (or keyword argument) is an integer, return the
n'th column, otherwise return the column based on key.
If no arguments are supplied, simply ... | [
"def",
"c",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# If not arguments, print everything",
"if",
"len",
"(",
"args",
")",
"+",
"len",
"(",
"kwargs",
")",
"==",
"0",
":",
"print",
"(",
"\"Columns\"",
")",
"if",
"len",
"(",
... | Takes a single argument or keyword argument, and returns the specified
column. If the argument (or keyword argument) is an integer, return the
n'th column, otherwise return the column based on key.
If no arguments are supplied, simply print the column information. | [
"Takes",
"a",
"single",
"argument",
"or",
"keyword",
"argument",
"and",
"returns",
"the",
"specified",
"column",
".",
"If",
"the",
"argument",
"(",
"or",
"keyword",
"argument",
")",
"is",
"an",
"integer",
"return",
"the",
"n",
"th",
"column",
"otherwise",
... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1234-L1285 |
Spinmob/spinmob | _data.py | databox.h | def h(self, *args, **kwargs):
"""
This function searches through hkeys for one *containing* a key string
supplied by args[0] and returns that header value.
Also can take integers, returning the key'th header value.
kwargs can be specified to set header elements.
... | python | def h(self, *args, **kwargs):
"""
This function searches through hkeys for one *containing* a key string
supplied by args[0] and returns that header value.
Also can take integers, returning the key'th header value.
kwargs can be specified to set header elements.
... | [
"def",
"h",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# If not arguments, print everything",
"if",
"len",
"(",
"args",
")",
"+",
"len",
"(",
"kwargs",
")",
"==",
"0",
":",
"print",
"(",
"\"Headers\"",
")",
"for",
"n",
"in",
... | This function searches through hkeys for one *containing* a key string
supplied by args[0] and returns that header value.
Also can take integers, returning the key'th header value.
kwargs can be specified to set header elements.
Finally, if called with no arguments or keyword ... | [
"This",
"function",
"searches",
"through",
"hkeys",
"for",
"one",
"*",
"containing",
"*",
"a",
"key",
"string",
"supplied",
"by",
"args",
"[",
"0",
"]",
"and",
"returns",
"that",
"header",
"value",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1289-L1333 |
Spinmob/spinmob | _data.py | fitter.set | def set(self, **kwargs):
"""
Changes a setting or multiple settings. Can also call self() or
change individual parameters with self['parameter'] = value
"""
if len(kwargs)==0: return self
# Set settings
for k in list(kwargs.keys()): self[k] = kwargs[k]
... | python | def set(self, **kwargs):
"""
Changes a setting or multiple settings. Can also call self() or
change individual parameters with self['parameter'] = value
"""
if len(kwargs)==0: return self
# Set settings
for k in list(kwargs.keys()): self[k] = kwargs[k]
... | [
"def",
"set",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"kwargs",
")",
"==",
"0",
":",
"return",
"self",
"# Set settings",
"for",
"k",
"in",
"list",
"(",
"kwargs",
".",
"keys",
"(",
")",
")",
":",
"self",
"[",
"k",
"]",
... | Changes a setting or multiple settings. Can also call self() or
change individual parameters with self['parameter'] = value | [
"Changes",
"a",
"setting",
"or",
"multiple",
"settings",
".",
"Can",
"also",
"call",
"self",
"()",
"or",
"change",
"individual",
"parameters",
"with",
"self",
"[",
"parameter",
"]",
"=",
"value"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1542-L1555 |
Spinmob/spinmob | _data.py | fitter.print_fit_parameters | def print_fit_parameters(self):
"""
Just prints them out in a way that's easy to copy / paste into python.
"""
s = ''
if self.results and self.results[1] is not None:
s = s + "\n# FIT RESULTS (reduced chi squared = {:s})\n".format(str(self.reduced_chi_squareds()))
... | python | def print_fit_parameters(self):
"""
Just prints them out in a way that's easy to copy / paste into python.
"""
s = ''
if self.results and self.results[1] is not None:
s = s + "\n# FIT RESULTS (reduced chi squared = {:s})\n".format(str(self.reduced_chi_squareds()))
... | [
"def",
"print_fit_parameters",
"(",
"self",
")",
":",
"s",
"=",
"''",
"if",
"self",
".",
"results",
"and",
"self",
".",
"results",
"[",
"1",
"]",
"is",
"not",
"None",
":",
"s",
"=",
"s",
"+",
"\"\\n# FIT RESULTS (reduced chi squared = {:s})\\n\"",
".",
"fo... | Just prints them out in a way that's easy to copy / paste into python. | [
"Just",
"prints",
"them",
"out",
"in",
"a",
"way",
"that",
"s",
"easy",
"to",
"copy",
"/",
"paste",
"into",
"python",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1669-L1686 |
Spinmob/spinmob | _data.py | fitter.set_functions | def set_functions(self, f='a*x*cos(b*x)+c', p='a=-0.2, b, c=3', c=None, bg=None, **kwargs):
"""
Sets the function(s) used to describe the data.
Parameters
----------
f=['a*x*cos(b*x)+c', 'a*x+c']
This can be a string function, a defined function
my_fun... | python | def set_functions(self, f='a*x*cos(b*x)+c', p='a=-0.2, b, c=3', c=None, bg=None, **kwargs):
"""
Sets the function(s) used to describe the data.
Parameters
----------
f=['a*x*cos(b*x)+c', 'a*x+c']
This can be a string function, a defined function
my_fun... | [
"def",
"set_functions",
"(",
"self",
",",
"f",
"=",
"'a*x*cos(b*x)+c'",
",",
"p",
"=",
"'a=-0.2, b, c=3'",
",",
"c",
"=",
"None",
",",
"bg",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# initialize everything",
"self",
".",
"_pnames",
"=",
"[",
"]... | Sets the function(s) used to describe the data.
Parameters
----------
f=['a*x*cos(b*x)+c', 'a*x+c']
This can be a string function, a defined function
my_function(x,a,b), or a list of some combination
of these two types of objects. The length of such
... | [
"Sets",
"the",
"function",
"(",
"s",
")",
"used",
"to",
"describe",
"the",
"data",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1696-L1773 |
Spinmob/spinmob | _data.py | fitter._update_functions | def _update_functions(self):
"""
Uses internal settings to update the functions.
"""
self.f = []
self.bg = []
self._fnames = []
self._bgnames = []
self._odr_models = [] # Like f, but different parameters, for use in ODR... | python | def _update_functions(self):
"""
Uses internal settings to update the functions.
"""
self.f = []
self.bg = []
self._fnames = []
self._bgnames = []
self._odr_models = [] # Like f, but different parameters, for use in ODR... | [
"def",
"_update_functions",
"(",
"self",
")",
":",
"self",
".",
"f",
"=",
"[",
"]",
"self",
".",
"bg",
"=",
"[",
"]",
"self",
".",
"_fnames",
"=",
"[",
"]",
"self",
".",
"_bgnames",
"=",
"[",
"]",
"self",
".",
"_odr_models",
"=",
"[",
"]",
"# L... | Uses internal settings to update the functions. | [
"Uses",
"internal",
"settings",
"to",
"update",
"the",
"functions",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1776-L1839 |
Spinmob/spinmob | _data.py | fitter.set_data | def set_data(self, xdata=[1,2,3,4,5], ydata=[1.7,2,3,4,3], eydata=None, **kwargs):
"""
This will handle the different types of supplied data and put everything
in a standard format for processing.
Parameters
----------
xdata, ydata
These can be a single a... | python | def set_data(self, xdata=[1,2,3,4,5], ydata=[1.7,2,3,4,3], eydata=None, **kwargs):
"""
This will handle the different types of supplied data and put everything
in a standard format for processing.
Parameters
----------
xdata, ydata
These can be a single a... | [
"def",
"set_data",
"(",
"self",
",",
"xdata",
"=",
"[",
"1",
",",
"2",
",",
"3",
",",
"4",
",",
"5",
"]",
",",
"ydata",
"=",
"[",
"1.7",
",",
"2",
",",
"3",
",",
"4",
",",
"3",
"]",
",",
"eydata",
"=",
"None",
",",
"*",
"*",
"kwargs",
"... | This will handle the different types of supplied data and put everything
in a standard format for processing.
Parameters
----------
xdata, ydata
These can be a single array of data or a list of data arrays.
eydata=None
Error bars for ydata. Thes... | [
"This",
"will",
"handle",
"the",
"different",
"types",
"of",
"supplied",
"data",
"and",
"put",
"everything",
"in",
"a",
"standard",
"format",
"for",
"processing",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1842-L1961 |
Spinmob/spinmob | _data.py | fitter.evaluate_script | def evaluate_script(self, script, **kwargs):
"""
Evaluates the supplied script (python-executable string).
Useful for testing your scripts!
globals already include all of numpy objects plus
self = self
f = self.f
bg = self.bg
and all the current gu... | python | def evaluate_script(self, script, **kwargs):
"""
Evaluates the supplied script (python-executable string).
Useful for testing your scripts!
globals already include all of numpy objects plus
self = self
f = self.f
bg = self.bg
and all the current gu... | [
"def",
"evaluate_script",
"(",
"self",
",",
"script",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_set_data_globals",
".",
"update",
"(",
"kwargs",
")",
"return",
"eval",
"(",
"script",
",",
"self",
".",
"_set_data_globals",
")"
] | Evaluates the supplied script (python-executable string).
Useful for testing your scripts!
globals already include all of numpy objects plus
self = self
f = self.f
bg = self.bg
and all the current guess parameters and constants
kwargs are added to globals... | [
"Evaluates",
"the",
"supplied",
"script",
"(",
"python",
"-",
"executable",
"string",
")",
".",
"Useful",
"for",
"testing",
"your",
"scripts!"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1963-L1979 |
Spinmob/spinmob | _data.py | fitter.get_data | def get_data(self):
"""
Returns current xdata, ydata, eydata, after set_data()
has been run.
"""
# make sure we've done a "set data" call
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return [[],[],[]]
# update the globals with the current fit parameter... | python | def get_data(self):
"""
Returns current xdata, ydata, eydata, after set_data()
has been run.
"""
# make sure we've done a "set data" call
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return [[],[],[]]
# update the globals with the current fit parameter... | [
"def",
"get_data",
"(",
"self",
")",
":",
"# make sure we've done a \"set data\" call",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"return",
"[",
"[",
"]",
",",
"[",
"]... | Returns current xdata, ydata, eydata, after set_data()
has been run. | [
"Returns",
"current",
"xdata",
"ydata",
"eydata",
"after",
"set_data",
"()",
"has",
"been",
"run",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L1981-L2066 |
Spinmob/spinmob | _data.py | fitter.set_guess_to_fit_result | def set_guess_to_fit_result(self):
"""
If you have a fit result, set the guess parameters to the
fit parameters.
"""
if self.results is None:
print("No fit results to use! Run fit() first.")
return
# loop over the results and set the guess values
... | python | def set_guess_to_fit_result(self):
"""
If you have a fit result, set the guess parameters to the
fit parameters.
"""
if self.results is None:
print("No fit results to use! Run fit() first.")
return
# loop over the results and set the guess values
... | [
"def",
"set_guess_to_fit_result",
"(",
"self",
")",
":",
"if",
"self",
".",
"results",
"is",
"None",
":",
"print",
"(",
"\"No fit results to use! Run fit() first.\"",
")",
"return",
"# loop over the results and set the guess values",
"for",
"n",
"in",
"range",
"(",
"l... | If you have a fit result, set the guess parameters to the
fit parameters. | [
"If",
"you",
"have",
"a",
"fit",
"result",
"set",
"the",
"guess",
"parameters",
"to",
"the",
"fit",
"parameters",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2080-L2094 |
Spinmob/spinmob | _data.py | fitter.get_processed_data | def get_processed_data(self, do_coarsen=True, do_trim=True):
"""
This will coarsen and then trim the data sets according to settings.
Returns processed xdata, ydata, eydata.
Parameters
----------
do_coarsen=True
Whether we should coarsen the ... | python | def get_processed_data(self, do_coarsen=True, do_trim=True):
"""
This will coarsen and then trim the data sets according to settings.
Returns processed xdata, ydata, eydata.
Parameters
----------
do_coarsen=True
Whether we should coarsen the ... | [
"def",
"get_processed_data",
"(",
"self",
",",
"do_coarsen",
"=",
"True",
",",
"do_trim",
"=",
"True",
")",
":",
"# get the data",
"xdatas",
",",
"ydatas",
",",
"eydatas",
"=",
"self",
".",
"get_data",
"(",
")",
"# get the trim limits (trimits)",
"xmins",
"=",... | This will coarsen and then trim the data sets according to settings.
Returns processed xdata, ydata, eydata.
Parameters
----------
do_coarsen=True
Whether we should coarsen the data
do_trim=True
Whether we should trim the data
... | [
"This",
"will",
"coarsen",
"and",
"then",
"trim",
"the",
"data",
"sets",
"according",
"to",
"settings",
".",
"Returns",
"processed",
"xdata",
"ydata",
"eydata",
".",
"Parameters",
"----------",
"do_coarsen",
"=",
"True",
"Whether",
"we",
"should",
"coarsen",
"... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2096-L2188 |
Spinmob/spinmob | _data.py | fitter._massage_data | def _massage_data(self):
"""
Processes the data and stores it.
"""
self._xdata_massaged, self._ydata_massaged, self._eydata_massaged = self.get_processed_data()
# # Create the odr data.
# self._odr_datas = []
# for n in range(len(self._xdata_massaged)):
# ... | python | def _massage_data(self):
"""
Processes the data and stores it.
"""
self._xdata_massaged, self._ydata_massaged, self._eydata_massaged = self.get_processed_data()
# # Create the odr data.
# self._odr_datas = []
# for n in range(len(self._xdata_massaged)):
# ... | [
"def",
"_massage_data",
"(",
"self",
")",
":",
"self",
".",
"_xdata_massaged",
",",
"self",
".",
"_ydata_massaged",
",",
"self",
".",
"_eydata_massaged",
"=",
"self",
".",
"get_processed_data",
"(",
")",
"# # Create the odr data.",
"# self._odr_datas = [... | Processes the data and stores it. | [
"Processes",
"the",
"data",
"and",
"stores",
"it",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2190-L2206 |
Spinmob/spinmob | _data.py | fitter.fit | def fit(self, **kwargs):
"""
This will try to determine fit parameters using scipy.optimize.leastsq
algorithm. This function relies on a previous call of set_data() and
set_functions().
Notes
-----
results of the fit algorithm are stored in self.results.
... | python | def fit(self, **kwargs):
"""
This will try to determine fit parameters using scipy.optimize.leastsq
algorithm. This function relies on a previous call of set_data() and
set_functions().
Notes
-----
results of the fit algorithm are stored in self.results.
... | [
"def",
"fit",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"return",
"self",
".",
"_error",
"(",
"\"No data. Please us... | This will try to determine fit parameters using scipy.optimize.leastsq
algorithm. This function relies on a previous call of set_data() and
set_functions().
Notes
-----
results of the fit algorithm are stored in self.results.
See scipy.optimize.leastsq for more informa... | [
"This",
"will",
"try",
"to",
"determine",
"fit",
"parameters",
"using",
"scipy",
".",
"optimize",
".",
"leastsq",
"algorithm",
".",
"This",
"function",
"relies",
"on",
"a",
"previous",
"call",
"of",
"set_data",
"()",
"and",
"set_functions",
"()",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2208-L2239 |
Spinmob/spinmob | _data.py | fitter.fix | def fix(self, *args, **kwargs):
"""
Turns parameters to constants. As arguments, parameters must be strings.
As keyword arguments, they can be set at the same time.
Note this will NOT work when specifying a non-string fit function,
because there is no flexibility in the... | python | def fix(self, *args, **kwargs):
"""
Turns parameters to constants. As arguments, parameters must be strings.
As keyword arguments, they can be set at the same time.
Note this will NOT work when specifying a non-string fit function,
because there is no flexibility in the... | [
"def",
"fix",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# first set all the keyword argument values",
"self",
".",
"set",
"(",
"*",
"*",
"kwargs",
")",
"# get everything into one big list",
"pnames",
"=",
"list",
"(",
"args",
")",
"+... | Turns parameters to constants. As arguments, parameters must be strings.
As keyword arguments, they can be set at the same time.
Note this will NOT work when specifying a non-string fit function,
because there is no flexibility in the number of arguments. To get
around this, su... | [
"Turns",
"parameters",
"to",
"constants",
".",
"As",
"arguments",
"parameters",
"must",
"be",
"strings",
".",
"As",
"keyword",
"arguments",
"they",
"can",
"be",
"set",
"at",
"the",
"same",
"time",
".",
"Note",
"this",
"will",
"NOT",
"work",
"when",
"specif... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2241-L2288 |
Spinmob/spinmob | _data.py | fitter.free | def free(self, *args, **kwargs):
"""
Turns a constant into a parameter. As arguments, parameters must be strings.
As keyword arguments, they can be set at the same time.
"""
# first set all the keyword argument values
self.set(**kwargs)
# get everything into one ... | python | def free(self, *args, **kwargs):
"""
Turns a constant into a parameter. As arguments, parameters must be strings.
As keyword arguments, they can be set at the same time.
"""
# first set all the keyword argument values
self.set(**kwargs)
# get everything into one ... | [
"def",
"free",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# first set all the keyword argument values",
"self",
".",
"set",
"(",
"*",
"*",
"kwargs",
")",
"# get everything into one big list",
"cnames",
"=",
"list",
"(",
"args",
")",
"... | Turns a constant into a parameter. As arguments, parameters must be strings.
As keyword arguments, they can be set at the same time. | [
"Turns",
"a",
"constant",
"into",
"a",
"parameter",
".",
"As",
"arguments",
"parameters",
"must",
"be",
"strings",
".",
"As",
"keyword",
"arguments",
"they",
"can",
"be",
"set",
"at",
"the",
"same",
"time",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2290-L2321 |
Spinmob/spinmob | _data.py | fitter._evaluate_all_functions | def _evaluate_all_functions(self, xdata, p=None):
"""
This returns a list of function outputs given the stored data sets.
This function relies on a previous call of set_data().
p=None means use the fit results
"""
if p is None: p = self.results[0]
output = []
... | python | def _evaluate_all_functions(self, xdata, p=None):
"""
This returns a list of function outputs given the stored data sets.
This function relies on a previous call of set_data().
p=None means use the fit results
"""
if p is None: p = self.results[0]
output = []
... | [
"def",
"_evaluate_all_functions",
"(",
"self",
",",
"xdata",
",",
"p",
"=",
"None",
")",
":",
"if",
"p",
"is",
"None",
":",
"p",
"=",
"self",
".",
"results",
"[",
"0",
"]",
"output",
"=",
"[",
"]",
"for",
"n",
"in",
"range",
"(",
"len",
"(",
"s... | This returns a list of function outputs given the stored data sets.
This function relies on a previous call of set_data().
p=None means use the fit results | [
"This",
"returns",
"a",
"list",
"of",
"function",
"outputs",
"given",
"the",
"stored",
"data",
"sets",
".",
"This",
"function",
"relies",
"on",
"a",
"previous",
"call",
"of",
"set_data",
"()",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2330-L2343 |
Spinmob/spinmob | _data.py | fitter._evaluate_f | def _evaluate_f(self, n, xdata, p=None):
"""
Evaluates a single function n for arbitrary xdata and p tuple.
p=None means use the fit results
"""
# by default, use the fit values, otherwise, use the guess values.
if p is None and self.results is not None: p = self.resul... | python | def _evaluate_f(self, n, xdata, p=None):
"""
Evaluates a single function n for arbitrary xdata and p tuple.
p=None means use the fit results
"""
# by default, use the fit values, otherwise, use the guess values.
if p is None and self.results is not None: p = self.resul... | [
"def",
"_evaluate_f",
"(",
"self",
",",
"n",
",",
"xdata",
",",
"p",
"=",
"None",
")",
":",
"# by default, use the fit values, otherwise, use the guess values.",
"if",
"p",
"is",
"None",
"and",
"self",
".",
"results",
"is",
"not",
"None",
":",
"p",
"=",
"sel... | Evaluates a single function n for arbitrary xdata and p tuple.
p=None means use the fit results | [
"Evaluates",
"a",
"single",
"function",
"n",
"for",
"arbitrary",
"xdata",
"and",
"p",
"tuple",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2345-L2359 |
Spinmob/spinmob | _data.py | fitter._evaluate_bg | def _evaluate_bg(self, n, xdata, p=None):
"""
Evaluates a single background function n for arbitrary xdata and p tuple.
p=None means use the fit results
"""
# by default, use the fit values, otherwise, use the guess values.
if p is None and self.results is not None: p ... | python | def _evaluate_bg(self, n, xdata, p=None):
"""
Evaluates a single background function n for arbitrary xdata and p tuple.
p=None means use the fit results
"""
# by default, use the fit values, otherwise, use the guess values.
if p is None and self.results is not None: p ... | [
"def",
"_evaluate_bg",
"(",
"self",
",",
"n",
",",
"xdata",
",",
"p",
"=",
"None",
")",
":",
"# by default, use the fit values, otherwise, use the guess values.",
"if",
"p",
"is",
"None",
"and",
"self",
".",
"results",
"is",
"not",
"None",
":",
"p",
"=",
"se... | Evaluates a single background function n for arbitrary xdata and p tuple.
p=None means use the fit results | [
"Evaluates",
"a",
"single",
"background",
"function",
"n",
"for",
"arbitrary",
"xdata",
"and",
"p",
"tuple",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2361-L2378 |
Spinmob/spinmob | _data.py | fitter._format_value_error | def _format_value_error(self, v, e, pm=" +/- "):
"""
Returns a string v +/- e with the right number of sig figs.
"""
# If we have weird stuff
if not _s.fun.is_a_number(v) or not _s.fun.is_a_number(e) \
or v in [_n.inf, _n.nan, _n.NAN] or e in [_n.inf, _n.nan, _n.NAN]:... | python | def _format_value_error(self, v, e, pm=" +/- "):
"""
Returns a string v +/- e with the right number of sig figs.
"""
# If we have weird stuff
if not _s.fun.is_a_number(v) or not _s.fun.is_a_number(e) \
or v in [_n.inf, _n.nan, _n.NAN] or e in [_n.inf, _n.nan, _n.NAN]:... | [
"def",
"_format_value_error",
"(",
"self",
",",
"v",
",",
"e",
",",
"pm",
"=",
"\" +/- \"",
")",
":",
"# If we have weird stuff",
"if",
"not",
"_s",
".",
"fun",
".",
"is_a_number",
"(",
"v",
")",
"or",
"not",
"_s",
".",
"fun",
".",
"is_a_number",
"(",
... | Returns a string v +/- e with the right number of sig figs. | [
"Returns",
"a",
"string",
"v",
"+",
"/",
"-",
"e",
"with",
"the",
"right",
"number",
"of",
"sig",
"figs",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2380-L2395 |
Spinmob/spinmob | _data.py | fitter._studentized_residuals_fast | def _studentized_residuals_fast(self, p=None):
"""
Returns a list of studentized residuals, (ydata - model)/error
This function relies on a previous call to set_data(), and assumes
self._massage_data() has been called (to increase speed).
Parameters
----------
... | python | def _studentized_residuals_fast(self, p=None):
"""
Returns a list of studentized residuals, (ydata - model)/error
This function relies on a previous call to set_data(), and assumes
self._massage_data() has been called (to increase speed).
Parameters
----------
... | [
"def",
"_studentized_residuals_fast",
"(",
"self",
",",
"p",
"=",
"None",
")",
":",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"return",
"if",
"p",
"is",
"None",
":... | Returns a list of studentized residuals, (ydata - model)/error
This function relies on a previous call to set_data(), and assumes
self._massage_data() has been called (to increase speed).
Parameters
----------
p=None
Function parameters to use. None means u... | [
"Returns",
"a",
"list",
"of",
"studentized",
"residuals",
"(",
"ydata",
"-",
"model",
")",
"/",
"error"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2397-L2424 |
Spinmob/spinmob | _data.py | fitter.chi_squareds | def chi_squareds(self, p=None):
"""
Returns a list of chi squared for each data set. Also uses ydata_massaged.
p=None means use the fit results
"""
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
if p is None: p = self.results[0]
# ge... | python | def chi_squareds(self, p=None):
"""
Returns a list of chi squared for each data set. Also uses ydata_massaged.
p=None means use the fit results
"""
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
if p is None: p = self.results[0]
# ge... | [
"def",
"chi_squareds",
"(",
"self",
",",
"p",
"=",
"None",
")",
":",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"return",
"None",
"if",
"p",
"is",
"None",
":",
... | Returns a list of chi squared for each data set. Also uses ydata_massaged.
p=None means use the fit results | [
"Returns",
"a",
"list",
"of",
"chi",
"squared",
"for",
"each",
"data",
"set",
".",
"Also",
"uses",
"ydata_massaged",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2449-L2468 |
Spinmob/spinmob | _data.py | fitter.chi_squared | def chi_squared(self, p=None):
"""
Returns the total chi squared (summed over all massaged data sets).
p=None means use the fit results.
"""
chi2s = self.chi_squareds(p)
if chi2s == None: return None
return sum(self.chi_squareds(p)) | python | def chi_squared(self, p=None):
"""
Returns the total chi squared (summed over all massaged data sets).
p=None means use the fit results.
"""
chi2s = self.chi_squareds(p)
if chi2s == None: return None
return sum(self.chi_squareds(p)) | [
"def",
"chi_squared",
"(",
"self",
",",
"p",
"=",
"None",
")",
":",
"chi2s",
"=",
"self",
".",
"chi_squareds",
"(",
"p",
")",
"if",
"chi2s",
"==",
"None",
":",
"return",
"None",
"return",
"sum",
"(",
"self",
".",
"chi_squareds",
"(",
"p",
")",
")"
... | Returns the total chi squared (summed over all massaged data sets).
p=None means use the fit results. | [
"Returns",
"the",
"total",
"chi",
"squared",
"(",
"summed",
"over",
"all",
"massaged",
"data",
"sets",
")",
".",
"p",
"=",
"None",
"means",
"use",
"the",
"fit",
"results",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2470-L2479 |
Spinmob/spinmob | _data.py | fitter.degrees_of_freedom | def degrees_of_freedom(self):
"""
Returns the number of degrees of freedom.
"""
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
# Temporary hack: get the studentized residuals, which uses the massaged data
# This should later be changed to get_... | python | def degrees_of_freedom(self):
"""
Returns the number of degrees of freedom.
"""
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
# Temporary hack: get the studentized residuals, which uses the massaged data
# This should later be changed to get_... | [
"def",
"degrees_of_freedom",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"return",
"None",
"# Temporary hack: get the studentized residuals, which uses the ... | Returns the number of degrees of freedom. | [
"Returns",
"the",
"number",
"of",
"degrees",
"of",
"freedom",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2481-L2498 |
Spinmob/spinmob | _data.py | fitter.reduced_chi_squareds | def reduced_chi_squareds(self, p=None):
"""
Returns the reduced chi squared for each massaged data set.
p=None means use the fit results.
"""
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
if p is None: p = self.results[0]
r = self.studentiz... | python | def reduced_chi_squareds(self, p=None):
"""
Returns the reduced chi squared for each massaged data set.
p=None means use the fit results.
"""
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
if p is None: p = self.results[0]
r = self.studentiz... | [
"def",
"reduced_chi_squareds",
"(",
"self",
",",
"p",
"=",
"None",
")",
":",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"return",
"None",
"if",
"p",
"is",
"None",
... | Returns the reduced chi squared for each massaged data set.
p=None means use the fit results. | [
"Returns",
"the",
"reduced",
"chi",
"squared",
"for",
"each",
"massaged",
"data",
"set",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2502-L2526 |
Spinmob/spinmob | _data.py | fitter.reduced_chi_squared | def reduced_chi_squared(self, p=None):
"""
Returns the reduced chi squared for all massaged data sets.
p=None means use the fit results.
"""
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
if p is None: p = self.results[0]
ch... | python | def reduced_chi_squared(self, p=None):
"""
Returns the reduced chi squared for all massaged data sets.
p=None means use the fit results.
"""
if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
if p is None: p = self.results[0]
ch... | [
"def",
"reduced_chi_squared",
"(",
"self",
",",
"p",
"=",
"None",
")",
":",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"return",
"None",
"if",
"p",
"is",
"None",
... | Returns the reduced chi squared for all massaged data sets.
p=None means use the fit results. | [
"Returns",
"the",
"reduced",
"chi",
"squared",
"for",
"all",
"massaged",
"data",
"sets",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2528-L2543 |
Spinmob/spinmob | _data.py | fitter.autoscale_eydata | def autoscale_eydata(self):
"""
Rescales the error so the next fit will give reduced chi squareds of 1.
Each data set will be scaled independently, and you may wish to run
this a few times until it converges.
"""
if not self.results:
self._error("You must com... | python | def autoscale_eydata(self):
"""
Rescales the error so the next fit will give reduced chi squareds of 1.
Each data set will be scaled independently, and you may wish to run
this a few times until it converges.
"""
if not self.results:
self._error("You must com... | [
"def",
"autoscale_eydata",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"results",
":",
"self",
".",
"_error",
"(",
"\"You must complete a fit first.\"",
")",
"return",
"r",
"=",
"self",
".",
"reduced_chi_squareds",
"(",
")",
"# loop over the eydata and rescal... | Rescales the error so the next fit will give reduced chi squareds of 1.
Each data set will be scaled independently, and you may wish to run
this a few times until it converges. | [
"Rescales",
"the",
"error",
"so",
"the",
"next",
"fit",
"will",
"give",
"reduced",
"chi",
"squareds",
"of",
"1",
".",
"Each",
"data",
"set",
"will",
"be",
"scaled",
"independently",
"and",
"you",
"may",
"wish",
"to",
"run",
"this",
"a",
"few",
"times",
... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2545-L2566 |
Spinmob/spinmob | _data.py | fitter.plot | def plot(self, **kwargs):
"""
This will plot the data (with error) for inspection.
Setting self.figures to a figure instance or list of figure instances
will override the creation of new figures. If you specify
a list, its length had better be at least as large as the
... | python | def plot(self, **kwargs):
"""
This will plot the data (with error) for inspection.
Setting self.figures to a figure instance or list of figure instances
will override the creation of new figures. If you specify
a list, its length had better be at least as large as the
... | [
"def",
"plot",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# Make sure there is data to plot.",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"return",
"self",
"# Mak... | This will plot the data (with error) for inspection.
Setting self.figures to a figure instance or list of figure instances
will override the creation of new figures. If you specify
a list, its length had better be at least as large as the
number of data sets.
kwargs will up... | [
"This",
"will",
"plot",
"the",
"data",
"(",
"with",
"error",
")",
"for",
"inspection",
".",
"Setting",
"self",
".",
"figures",
"to",
"a",
"figure",
"instance",
"or",
"list",
"of",
"figure",
"instances",
"will",
"override",
"the",
"creation",
"of",
"new",
... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2570-L2840 |
Spinmob/spinmob | _data.py | fitter._get_xdata_for_function | def _get_xdata_for_function(self, n, xdata):
"""
Generates the x-data for plotting the function.
Parameters
----------
n
Which data set we're using
xdata
Data set upon which to base this
Returns
-------
float
... | python | def _get_xdata_for_function(self, n, xdata):
"""
Generates the x-data for plotting the function.
Parameters
----------
n
Which data set we're using
xdata
Data set upon which to base this
Returns
-------
float
... | [
"def",
"_get_xdata_for_function",
"(",
"self",
",",
"n",
",",
"xdata",
")",
":",
"# Use the xdata itself for the function",
"if",
"self",
"[",
"'fpoints'",
"]",
"[",
"n",
"]",
"in",
"[",
"None",
",",
"0",
"]",
":",
"return",
"_n",
".",
"array",
"(",
"xda... | Generates the x-data for plotting the function.
Parameters
----------
n
Which data set we're using
xdata
Data set upon which to base this
Returns
-------
float | [
"Generates",
"the",
"x",
"-",
"data",
"for",
"plotting",
"the",
"function",
".",
"Parameters",
"----------",
"n",
"Which",
"data",
"set",
"we",
"re",
"using",
"xdata",
"Data",
"set",
"upon",
"which",
"to",
"base",
"this"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2842-L2870 |
Spinmob/spinmob | _data.py | fitter.trim | def trim(self, n='all', x=True, y=True):
"""
This will set xmin and xmax based on the current zoom-level of the
figures.
n='all' Which figure to use for setting xmin and xmax.
'all' means all figures. You may also specify a list.
x=True Trim the x-ra... | python | def trim(self, n='all', x=True, y=True):
"""
This will set xmin and xmax based on the current zoom-level of the
figures.
n='all' Which figure to use for setting xmin and xmax.
'all' means all figures. You may also specify a list.
x=True Trim the x-ra... | [
"def",
"trim",
"(",
"self",
",",
"n",
"=",
"'all'",
",",
"x",
"=",
"True",
",",
"y",
"=",
"True",
")",
":",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"self",... | This will set xmin and xmax based on the current zoom-level of the
figures.
n='all' Which figure to use for setting xmin and xmax.
'all' means all figures. You may also specify a list.
x=True Trim the x-range
y=True Trim the y-range | [
"This",
"will",
"set",
"xmin",
"and",
"xmax",
"based",
"on",
"the",
"current",
"zoom",
"-",
"level",
"of",
"the",
"figures",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2872-L2909 |
Spinmob/spinmob | _data.py | fitter.untrim | def untrim(self, n='all'):
"""
Removes xmin, xmax, ymin, and ymax.
Parameters
----------
n='all'
Which data set to perform this action upon. 'all' means all data
sets, or you can specify a list.
"""
if len(self._set_xdata)==0 or l... | python | def untrim(self, n='all'):
"""
Removes xmin, xmax, ymin, and ymax.
Parameters
----------
n='all'
Which data set to perform this action upon. 'all' means all data
sets, or you can specify a list.
"""
if len(self._set_xdata)==0 or l... | [
"def",
"untrim",
"(",
"self",
",",
"n",
"=",
"'all'",
")",
":",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",
"self",
".",
"_error",
"(",
"\"No data. Please use set_data... | Removes xmin, xmax, ymin, and ymax.
Parameters
----------
n='all'
Which data set to perform this action upon. 'all' means all data
sets, or you can specify a list. | [
"Removes",
"xmin",
"xmax",
"ymin",
"and",
"ymax",
".",
"Parameters",
"----------",
"n",
"=",
"all",
"Which",
"data",
"set",
"to",
"perform",
"this",
"action",
"upon",
".",
"all",
"means",
"all",
"data",
"sets",
"or",
"you",
"can",
"specify",
"a",
"list",... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2911-L2938 |
Spinmob/spinmob | _data.py | fitter.zoom | def zoom(self, n='all', xfactor=2.0, yfactor=2.0):
"""
This will scale the chosen data set's plot range by the
specified xfactor and yfactor, respectively, and set the trim limits
xmin, xmax, ymin, ymax accordingly
Parameters
----------
n='all'
W... | python | def zoom(self, n='all', xfactor=2.0, yfactor=2.0):
"""
This will scale the chosen data set's plot range by the
specified xfactor and yfactor, respectively, and set the trim limits
xmin, xmax, ymin, ymax accordingly
Parameters
----------
n='all'
W... | [
"def",
"zoom",
"(",
"self",
",",
"n",
"=",
"'all'",
",",
"xfactor",
"=",
"2.0",
",",
"yfactor",
"=",
"2.0",
")",
":",
"if",
"len",
"(",
"self",
".",
"_set_xdata",
")",
"==",
"0",
"or",
"len",
"(",
"self",
".",
"_set_ydata",
")",
"==",
"0",
":",... | This will scale the chosen data set's plot range by the
specified xfactor and yfactor, respectively, and set the trim limits
xmin, xmax, ymin, ymax accordingly
Parameters
----------
n='all'
Which data set to perform this action upon. 'all' means all data
... | [
"This",
"will",
"scale",
"the",
"chosen",
"data",
"set",
"s",
"plot",
"range",
"by",
"the",
"specified",
"xfactor",
"and",
"yfactor",
"respectively",
"and",
"set",
"the",
"trim",
"limits",
"xmin",
"xmax",
"ymin",
"ymax",
"accordingly"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2940-L2988 |
Spinmob/spinmob | _data.py | fitter.ginput | def ginput(self, data_set=0, **kwargs):
"""
Pops up the figure for the specified data set.
Returns value from pylab.ginput().
kwargs are sent to pylab.ginput()
"""
# this will temporarily fix the deprecation warning
import warnings
import matplotlib.cboo... | python | def ginput(self, data_set=0, **kwargs):
"""
Pops up the figure for the specified data set.
Returns value from pylab.ginput().
kwargs are sent to pylab.ginput()
"""
# this will temporarily fix the deprecation warning
import warnings
import matplotlib.cboo... | [
"def",
"ginput",
"(",
"self",
",",
"data_set",
"=",
"0",
",",
"*",
"*",
"kwargs",
")",
":",
"# this will temporarily fix the deprecation warning",
"import",
"warnings",
"import",
"matplotlib",
".",
"cbook",
"warnings",
".",
"filterwarnings",
"(",
"\"ignore\"",
","... | Pops up the figure for the specified data set.
Returns value from pylab.ginput().
kwargs are sent to pylab.ginput() | [
"Pops",
"up",
"the",
"figure",
"for",
"the",
"specified",
"data",
"set",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_data.py#L2991-L3005 |
Spinmob/spinmob | _plotting_mess.py | _match_data_sets | def _match_data_sets(x,y):
"""
Makes sure everything is the same shape. "Intelligently".
"""
# Handle the None for x or y
if x is None:
# If x is none, y can be either [1,2] or [[1,2],[1,2]]
if _fun.is_iterable(y[0]):
# make an array of arrays to match
x = []... | python | def _match_data_sets(x,y):
"""
Makes sure everything is the same shape. "Intelligently".
"""
# Handle the None for x or y
if x is None:
# If x is none, y can be either [1,2] or [[1,2],[1,2]]
if _fun.is_iterable(y[0]):
# make an array of arrays to match
x = []... | [
"def",
"_match_data_sets",
"(",
"x",
",",
"y",
")",
":",
"# Handle the None for x or y",
"if",
"x",
"is",
"None",
":",
"# If x is none, y can be either [1,2] or [[1,2],[1,2]]",
"if",
"_fun",
".",
"is_iterable",
"(",
"y",
"[",
"0",
"]",
")",
":",
"# make an array o... | Makes sure everything is the same shape. "Intelligently". | [
"Makes",
"sure",
"everything",
"is",
"the",
"same",
"shape",
".",
"Intelligently",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L26-L64 |
Spinmob/spinmob | _plotting_mess.py | _match_error_to_data_set | def _match_error_to_data_set(x, ex):
"""
Inflates ex to match the dimensionality of x, "intelligently".
x is assumed to be a 2D array.
"""
# Simplest case, ex is None or a number
if not _fun.is_iterable(ex):
# Just make a matched list of Nones
if ex is None: ex = [ex]*l... | python | def _match_error_to_data_set(x, ex):
"""
Inflates ex to match the dimensionality of x, "intelligently".
x is assumed to be a 2D array.
"""
# Simplest case, ex is None or a number
if not _fun.is_iterable(ex):
# Just make a matched list of Nones
if ex is None: ex = [ex]*l... | [
"def",
"_match_error_to_data_set",
"(",
"x",
",",
"ex",
")",
":",
"# Simplest case, ex is None or a number",
"if",
"not",
"_fun",
".",
"is_iterable",
"(",
"ex",
")",
":",
"# Just make a matched list of Nones",
"if",
"ex",
"is",
"None",
":",
"ex",
"=",
"[",
"ex",... | Inflates ex to match the dimensionality of x, "intelligently".
x is assumed to be a 2D array. | [
"Inflates",
"ex",
"to",
"match",
"the",
"dimensionality",
"of",
"x",
"intelligently",
".",
"x",
"is",
"assumed",
"to",
"be",
"a",
"2D",
"array",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L66-L98 |
Spinmob/spinmob | _plotting_mess.py | complex_data | def complex_data(data, edata=None, draw=True, **kwargs):
"""
Plots the imaginary vs real for complex data.
Parameters
----------
data
Array of complex data
edata=None
Array of complex error bars
draw=True
Draw the plot after it's assembled?
Se... | python | def complex_data(data, edata=None, draw=True, **kwargs):
"""
Plots the imaginary vs real for complex data.
Parameters
----------
data
Array of complex data
edata=None
Array of complex error bars
draw=True
Draw the plot after it's assembled?
Se... | [
"def",
"complex_data",
"(",
"data",
",",
"edata",
"=",
"None",
",",
"draw",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"_pylab",
".",
"ioff",
"(",
")",
"# generate the data the easy way",
"try",
":",
"rdata",
"=",
"_n",
".",
"real",
"(",
"data",
... | Plots the imaginary vs real for complex data.
Parameters
----------
data
Array of complex data
edata=None
Array of complex error bars
draw=True
Draw the plot after it's assembled?
See spinmob.plot.xy.data() for additional optional keyword arguments. | [
"Plots",
"the",
"imaginary",
"vs",
"real",
"for",
"complex",
"data",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L103-L157 |
Spinmob/spinmob | _plotting_mess.py | complex_databoxes | def complex_databoxes(ds, script='d[1]+1j*d[2]', escript=None, **kwargs):
"""
Uses databoxes and specified script to generate data and send to
spinmob.plot.complex_data()
Parameters
----------
ds
List of databoxes
script='d[1]+1j*d[2]'
Complex-valued script fo... | python | def complex_databoxes(ds, script='d[1]+1j*d[2]', escript=None, **kwargs):
"""
Uses databoxes and specified script to generate data and send to
spinmob.plot.complex_data()
Parameters
----------
ds
List of databoxes
script='d[1]+1j*d[2]'
Complex-valued script fo... | [
"def",
"complex_databoxes",
"(",
"ds",
",",
"script",
"=",
"'d[1]+1j*d[2]'",
",",
"escript",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"datas",
"=",
"[",
"]",
"labels",
"=",
"[",
"]",
"if",
"escript",
"is",
"None",
":",
"errors",
"=",
"None",
... | Uses databoxes and specified script to generate data and send to
spinmob.plot.complex_data()
Parameters
----------
ds
List of databoxes
script='d[1]+1j*d[2]'
Complex-valued script for data array.
escript=None
Complex-valued script for error bars
... | [
"Uses",
"databoxes",
"and",
"specified",
"script",
"to",
"generate",
"data",
"and",
"send",
"to",
"spinmob",
".",
"plot",
".",
"complex_data",
"()"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L162-L198 |
Spinmob/spinmob | _plotting_mess.py | complex_files | def complex_files(script='d[1]+1j*d[2]', escript=None, paths=None, **kwargs):
"""
Loads files and plots complex data in the real-imaginary plane.
Parameters
----------
script='d[1]+1j*d[2]'
Complex-valued script for data array.
escript=None
Complex-valued script fo... | python | def complex_files(script='d[1]+1j*d[2]', escript=None, paths=None, **kwargs):
"""
Loads files and plots complex data in the real-imaginary plane.
Parameters
----------
script='d[1]+1j*d[2]'
Complex-valued script for data array.
escript=None
Complex-valued script fo... | [
"def",
"complex_files",
"(",
"script",
"=",
"'d[1]+1j*d[2]'",
",",
"escript",
"=",
"None",
",",
"paths",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ds",
"=",
"_data",
".",
"load_multiple",
"(",
"paths",
"=",
"paths",
")",
"if",
"len",
"(",
"ds"... | Loads files and plots complex data in the real-imaginary plane.
Parameters
----------
script='d[1]+1j*d[2]'
Complex-valued script for data array.
escript=None
Complex-valued script for error bars
paths=None
List of paths to open. None means use a dialog
Se... | [
"Loads",
"files",
"and",
"plots",
"complex",
"data",
"in",
"the",
"real",
"-",
"imaginary",
"plane",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L202-L230 |
Spinmob/spinmob | _plotting_mess.py | complex_function | def complex_function(f='1.0/(1+1j*x)', xmin=-1, xmax=1, steps=200, p='x', g=None, erange=False, **kwargs):
"""
Plots function(s) in the complex plane over the specified range.
Parameters
----------
f='1.0/(1+1j*x)'
Complex-valued function or list of functions to plot.
... | python | def complex_function(f='1.0/(1+1j*x)', xmin=-1, xmax=1, steps=200, p='x', g=None, erange=False, **kwargs):
"""
Plots function(s) in the complex plane over the specified range.
Parameters
----------
f='1.0/(1+1j*x)'
Complex-valued function or list of functions to plot.
... | [
"def",
"complex_function",
"(",
"f",
"=",
"'1.0/(1+1j*x)'",
",",
"xmin",
"=",
"-",
"1",
",",
"xmax",
"=",
"1",
",",
"steps",
"=",
"200",
",",
"p",
"=",
"'x'",
",",
"g",
"=",
"None",
",",
"erange",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":"... | Plots function(s) in the complex plane over the specified range.
Parameters
----------
f='1.0/(1+1j*x)'
Complex-valued function or list of functions to plot.
These can be string functions or single-argument python functions;
additional globals can be supplied by g.... | [
"Plots",
"function",
"(",
"s",
")",
"in",
"the",
"complex",
"plane",
"over",
"the",
"specified",
"range",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L233-L256 |
Spinmob/spinmob | _plotting_mess.py | magphase_data | def magphase_data(xdata, ydata, eydata=None, exdata=None, xscale='linear', mscale='linear', pscale='linear', mlabel='Magnitude', plabel='Phase', phase='degrees', figure='gcf', clear=1, draw=True, **kwargs):
"""
Plots the magnitude and phase of complex ydata vs xdata.
Parameters
----------
xdata ... | python | def magphase_data(xdata, ydata, eydata=None, exdata=None, xscale='linear', mscale='linear', pscale='linear', mlabel='Magnitude', plabel='Phase', phase='degrees', figure='gcf', clear=1, draw=True, **kwargs):
"""
Plots the magnitude and phase of complex ydata vs xdata.
Parameters
----------
xdata ... | [
"def",
"magphase_data",
"(",
"xdata",
",",
"ydata",
",",
"eydata",
"=",
"None",
",",
"exdata",
"=",
"None",
",",
"xscale",
"=",
"'linear'",
",",
"mscale",
"=",
"'linear'",
",",
"pscale",
"=",
"'linear'",
",",
"mlabel",
"=",
"'Magnitude'",
",",
"plabel",
... | Plots the magnitude and phase of complex ydata vs xdata.
Parameters
----------
xdata
Real-valued x-axis data
ydata
Complex-valued y-axis data
eydata=None
Complex-valued y-error
exdata=None
Real-valued x-error
xs... | [
"Plots",
"the",
"magnitude",
"and",
"phase",
"of",
"complex",
"ydata",
"vs",
"xdata",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L258-L355 |
Spinmob/spinmob | _plotting_mess.py | magphase_databoxes | def magphase_databoxes(ds, xscript=0, yscript='d[1]+1j*d[2]', eyscript=None, exscript=None, g=None, **kwargs):
"""
Use databoxes and scripts to generate data and plot the complex magnitude
and phase versus xdata.
Parameters
----------
ds
List of databoxes
xscript=0
... | python | def magphase_databoxes(ds, xscript=0, yscript='d[1]+1j*d[2]', eyscript=None, exscript=None, g=None, **kwargs):
"""
Use databoxes and scripts to generate data and plot the complex magnitude
and phase versus xdata.
Parameters
----------
ds
List of databoxes
xscript=0
... | [
"def",
"magphase_databoxes",
"(",
"ds",
",",
"xscript",
"=",
"0",
",",
"yscript",
"=",
"'d[1]+1j*d[2]'",
",",
"eyscript",
"=",
"None",
",",
"exscript",
"=",
"None",
",",
"g",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"databoxes",
"(",
"ds",
","... | Use databoxes and scripts to generate data and plot the complex magnitude
and phase versus xdata.
Parameters
----------
ds
List of databoxes
xscript=0
Script for x data
yscript='d[1]+1j*d[2]'
Script for y data
eyscript=None
Script for y error
... | [
"Use",
"databoxes",
"and",
"scripts",
"to",
"generate",
"data",
"and",
"plot",
"the",
"complex",
"magnitude",
"and",
"phase",
"versus",
"xdata",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L358-L381 |
Spinmob/spinmob | _plotting_mess.py | magphase_files | def magphase_files(xscript=0, yscript='d[1]+1j*d[2]', eyscript=None, exscript=None, paths=None, g=None, **kwargs):
"""
This will load a bunch of data files, generate data based on the supplied
scripts, and then plot the ydata's magnitude and phase versus xdata.
Parameters
----------
xscript=0
... | python | def magphase_files(xscript=0, yscript='d[1]+1j*d[2]', eyscript=None, exscript=None, paths=None, g=None, **kwargs):
"""
This will load a bunch of data files, generate data based on the supplied
scripts, and then plot the ydata's magnitude and phase versus xdata.
Parameters
----------
xscript=0
... | [
"def",
"magphase_files",
"(",
"xscript",
"=",
"0",
",",
"yscript",
"=",
"'d[1]+1j*d[2]'",
",",
"eyscript",
"=",
"None",
",",
"exscript",
"=",
"None",
",",
"paths",
"=",
"None",
",",
"g",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"file... | This will load a bunch of data files, generate data based on the supplied
scripts, and then plot the ydata's magnitude and phase versus xdata.
Parameters
----------
xscript=0
Script for x data
yscript='d[1]+1j*d[2]'
Script for y data
eyscript=None
Script for y error... | [
"This",
"will",
"load",
"a",
"bunch",
"of",
"data",
"files",
"generate",
"data",
"based",
"on",
"the",
"supplied",
"scripts",
"and",
"then",
"plot",
"the",
"ydata",
"s",
"magnitude",
"and",
"phase",
"versus",
"xdata",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L383-L412 |
Spinmob/spinmob | _plotting_mess.py | magphase_function | def magphase_function(f='1.0/(1+1j*x)', xmin=-1, xmax=1, steps=200, p='x', g=None, erange=False, **kwargs):
"""
Plots function(s) magnitude and phase over the specified range.
Parameters
----------
f='1.0/(1+1j*x)'
Complex-valued function or list of functions to plot.
... | python | def magphase_function(f='1.0/(1+1j*x)', xmin=-1, xmax=1, steps=200, p='x', g=None, erange=False, **kwargs):
"""
Plots function(s) magnitude and phase over the specified range.
Parameters
----------
f='1.0/(1+1j*x)'
Complex-valued function or list of functions to plot.
... | [
"def",
"magphase_function",
"(",
"f",
"=",
"'1.0/(1+1j*x)'",
",",
"xmin",
"=",
"-",
"1",
",",
"xmax",
"=",
"1",
",",
"steps",
"=",
"200",
",",
"p",
"=",
"'x'",
",",
"g",
"=",
"None",
",",
"erange",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":... | Plots function(s) magnitude and phase over the specified range.
Parameters
----------
f='1.0/(1+1j*x)'
Complex-valued function or list of functions to plot.
These can be string functions or single-argument python functions;
additional globals can be supplied by g.
... | [
"Plots",
"function",
"(",
"s",
")",
"magnitude",
"and",
"phase",
"over",
"the",
"specified",
"range",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L414-L435 |
Spinmob/spinmob | _plotting_mess.py | realimag_data | def realimag_data(xdata, ydata, eydata=None, exdata=None, xscale='linear', rscale='linear', iscale='linear', rlabel='Real', ilabel='Imaginary', figure='gcf', clear=1, draw=True, **kwargs):
"""
Plots the real and imaginary parts of complex ydata vs xdata.
Parameters
----------
xdata
Real-val... | python | def realimag_data(xdata, ydata, eydata=None, exdata=None, xscale='linear', rscale='linear', iscale='linear', rlabel='Real', ilabel='Imaginary', figure='gcf', clear=1, draw=True, **kwargs):
"""
Plots the real and imaginary parts of complex ydata vs xdata.
Parameters
----------
xdata
Real-val... | [
"def",
"realimag_data",
"(",
"xdata",
",",
"ydata",
",",
"eydata",
"=",
"None",
",",
"exdata",
"=",
"None",
",",
"xscale",
"=",
"'linear'",
",",
"rscale",
"=",
"'linear'",
",",
"iscale",
"=",
"'linear'",
",",
"rlabel",
"=",
"'Real'",
",",
"ilabel",
"="... | Plots the real and imaginary parts of complex ydata vs xdata.
Parameters
----------
xdata
Real-valued x-axis data
ydata
Complex-valued y-axis data
eydata=None
Complex-valued y-error
exdata=None
Real-valued x-error
xscale='line... | [
"Plots",
"the",
"real",
"and",
"imaginary",
"parts",
"of",
"complex",
"ydata",
"vs",
"xdata",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L441-L524 |
Spinmob/spinmob | _plotting_mess.py | realimag_databoxes | def realimag_databoxes(ds, xscript=0, yscript="d[1]+1j*d[2]", eyscript=None, exscript=None, g=None, **kwargs):
"""
Use databoxes and scripts to generate data and plot the real and
imaginary ydata versus xdata.
Parameters
----------
ds
List of databoxes
xscript=0
Sc... | python | def realimag_databoxes(ds, xscript=0, yscript="d[1]+1j*d[2]", eyscript=None, exscript=None, g=None, **kwargs):
"""
Use databoxes and scripts to generate data and plot the real and
imaginary ydata versus xdata.
Parameters
----------
ds
List of databoxes
xscript=0
Sc... | [
"def",
"realimag_databoxes",
"(",
"ds",
",",
"xscript",
"=",
"0",
",",
"yscript",
"=",
"\"d[1]+1j*d[2]\"",
",",
"eyscript",
"=",
"None",
",",
"exscript",
"=",
"None",
",",
"g",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"databoxes",
"(",
"ds",
"... | Use databoxes and scripts to generate data and plot the real and
imaginary ydata versus xdata.
Parameters
----------
ds
List of databoxes
xscript=0
Script for x data
yscript='d[1]+1j*d[2]'
Script for y data
eyscript=None
Script for y error
e... | [
"Use",
"databoxes",
"and",
"scripts",
"to",
"generate",
"data",
"and",
"plot",
"the",
"real",
"and",
"imaginary",
"ydata",
"versus",
"xdata",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L527-L550 |
Spinmob/spinmob | _plotting_mess.py | realimag_files | def realimag_files(xscript=0, yscript="d[1]+1j*d[2]", eyscript=None, exscript=None, paths=None, g=None, **kwargs):
"""
This will load a bunch of data files, generate data based on the supplied
scripts, and then plot the ydata's real and imaginary parts versus xdata.
Parameters
----------
xscrip... | python | def realimag_files(xscript=0, yscript="d[1]+1j*d[2]", eyscript=None, exscript=None, paths=None, g=None, **kwargs):
"""
This will load a bunch of data files, generate data based on the supplied
scripts, and then plot the ydata's real and imaginary parts versus xdata.
Parameters
----------
xscrip... | [
"def",
"realimag_files",
"(",
"xscript",
"=",
"0",
",",
"yscript",
"=",
"\"d[1]+1j*d[2]\"",
",",
"eyscript",
"=",
"None",
",",
"exscript",
"=",
"None",
",",
"paths",
"=",
"None",
",",
"g",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"fi... | This will load a bunch of data files, generate data based on the supplied
scripts, and then plot the ydata's real and imaginary parts versus xdata.
Parameters
----------
xscript=0
Script for x data
yscript='d[1]+1j*d[2]'
Script for y data
eyscript=None
Script for y ... | [
"This",
"will",
"load",
"a",
"bunch",
"of",
"data",
"files",
"generate",
"data",
"based",
"on",
"the",
"supplied",
"scripts",
"and",
"then",
"plot",
"the",
"ydata",
"s",
"real",
"and",
"imaginary",
"parts",
"versus",
"xdata",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L552-L580 |
Spinmob/spinmob | _plotting_mess.py | realimag_function | def realimag_function(f='1.0/(1+1j*x)', xmin=-1, xmax=1, steps=200, p='x', g=None, erange=False, **kwargs):
"""
Plots function(s) real and imaginary parts over the specified range.
Parameters
----------
f='1.0/(1+1j*x)'
Complex-valued function or list of functions to plot. ... | python | def realimag_function(f='1.0/(1+1j*x)', xmin=-1, xmax=1, steps=200, p='x', g=None, erange=False, **kwargs):
"""
Plots function(s) real and imaginary parts over the specified range.
Parameters
----------
f='1.0/(1+1j*x)'
Complex-valued function or list of functions to plot. ... | [
"def",
"realimag_function",
"(",
"f",
"=",
"'1.0/(1+1j*x)'",
",",
"xmin",
"=",
"-",
"1",
",",
"xmax",
"=",
"1",
",",
"steps",
"=",
"200",
",",
"p",
"=",
"'x'",
",",
"g",
"=",
"None",
",",
"erange",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":... | Plots function(s) real and imaginary parts over the specified range.
Parameters
----------
f='1.0/(1+1j*x)'
Complex-valued function or list of functions to plot.
These can be string functions or single-argument python functions;
additional globals can be supplied b... | [
"Plots",
"function",
"(",
"s",
")",
"real",
"and",
"imaginary",
"parts",
"over",
"the",
"specified",
"range",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L583-L604 |
Spinmob/spinmob | _plotting_mess.py | xy_data | def xy_data(xdata, ydata, eydata=None, exdata=None, label=None, xlabel='', ylabel='', \
title='', shell_history=0, xshift=0, yshift=0, xshift_every=1, yshift_every=1, \
coarsen=0, style=None, clear=True, axes=None, xscale='linear', yscale='linear', grid=False, \
... | python | def xy_data(xdata, ydata, eydata=None, exdata=None, label=None, xlabel='', ylabel='', \
title='', shell_history=0, xshift=0, yshift=0, xshift_every=1, yshift_every=1, \
coarsen=0, style=None, clear=True, axes=None, xscale='linear', yscale='linear', grid=False, \
... | [
"def",
"xy_data",
"(",
"xdata",
",",
"ydata",
",",
"eydata",
"=",
"None",
",",
"exdata",
"=",
"None",
",",
"label",
"=",
"None",
",",
"xlabel",
"=",
"''",
",",
"ylabel",
"=",
"''",
",",
"title",
"=",
"''",
",",
"shell_history",
"=",
"0",
",",
"xs... | Plots specified data.
Parameters
----------
xdata, ydata
Arrays (or arrays of arrays) of data to plot
eydata=None, exdata=None
Arrays of x and y errorbar values
label=None
String or array of strings for the line labels
xlabel=''
L... | [
"Plots",
"specified",
"data",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L609-L746 |
Spinmob/spinmob | _plotting_mess.py | xy_databoxes | def xy_databoxes(ds, xscript=0, yscript='d[1]', eyscript=None, exscript=None, g=None, **kwargs):
"""
Use databoxes and scripts to generate and plot ydata versus xdata.
Parameters
----------
ds
List of databoxes
xscript=0
Script for x data
yscript='d[1]'
Scr... | python | def xy_databoxes(ds, xscript=0, yscript='d[1]', eyscript=None, exscript=None, g=None, **kwargs):
"""
Use databoxes and scripts to generate and plot ydata versus xdata.
Parameters
----------
ds
List of databoxes
xscript=0
Script for x data
yscript='d[1]'
Scr... | [
"def",
"xy_databoxes",
"(",
"ds",
",",
"xscript",
"=",
"0",
",",
"yscript",
"=",
"'d[1]'",
",",
"eyscript",
"=",
"None",
",",
"exscript",
"=",
"None",
",",
"g",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"databoxes",
"(",
"ds",
",",
"xscript",... | Use databoxes and scripts to generate and plot ydata versus xdata.
Parameters
----------
ds
List of databoxes
xscript=0
Script for x data
yscript='d[1]'
Script for y data
eyscript=None
Script for y error
exscript=None
Script for x error
... | [
"Use",
"databoxes",
"and",
"scripts",
"to",
"generate",
"and",
"plot",
"ydata",
"versus",
"xdata",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L748-L771 |
Spinmob/spinmob | _plotting_mess.py | xy_files | def xy_files(xscript=0, yscript='d[1]', eyscript=None, exscript=None, paths=None, g=None, **kwargs):
"""
This will load a bunch of data files, generate data based on the supplied
scripts, and then plot the ydata versus xdata.
Parameters
----------
xscript=0
Script for x data
yscrip... | python | def xy_files(xscript=0, yscript='d[1]', eyscript=None, exscript=None, paths=None, g=None, **kwargs):
"""
This will load a bunch of data files, generate data based on the supplied
scripts, and then plot the ydata versus xdata.
Parameters
----------
xscript=0
Script for x data
yscrip... | [
"def",
"xy_files",
"(",
"xscript",
"=",
"0",
",",
"yscript",
"=",
"'d[1]'",
",",
"eyscript",
"=",
"None",
",",
"exscript",
"=",
"None",
",",
"paths",
"=",
"None",
",",
"g",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"files",
"(",
"... | This will load a bunch of data files, generate data based on the supplied
scripts, and then plot the ydata versus xdata.
Parameters
----------
xscript=0
Script for x data
yscript='d[1]'
Script for y data
eyscript=None
Script for y error
exscript=None
Scr... | [
"This",
"will",
"load",
"a",
"bunch",
"of",
"data",
"files",
"generate",
"data",
"based",
"on",
"the",
"supplied",
"scripts",
"and",
"then",
"plot",
"the",
"ydata",
"versus",
"xdata",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L774-L803 |
Spinmob/spinmob | _plotting_mess.py | xy_function | def xy_function(f='sin(x)', xmin=-1, xmax=1, steps=200, p='x', g=None, erange=False, **kwargs):
"""
Plots function(s) over the specified range.
Parameters
----------
f='sin(x)'
Function or list of functions to plot.
These can be string functions or single-argument ... | python | def xy_function(f='sin(x)', xmin=-1, xmax=1, steps=200, p='x', g=None, erange=False, **kwargs):
"""
Plots function(s) over the specified range.
Parameters
----------
f='sin(x)'
Function or list of functions to plot.
These can be string functions or single-argument ... | [
"def",
"xy_function",
"(",
"f",
"=",
"'sin(x)'",
",",
"xmin",
"=",
"-",
"1",
",",
"xmax",
"=",
"1",
",",
"steps",
"=",
"200",
",",
"p",
"=",
"'x'",
",",
"g",
"=",
"None",
",",
"erange",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"functi... | Plots function(s) over the specified range.
Parameters
----------
f='sin(x)'
Function or list of functions to plot.
These can be string functions or single-argument python functions;
additional globals can be supplied by g.
xmin=-1, xmax=1, steps=200
... | [
"Plots",
"function",
"(",
"s",
")",
"over",
"the",
"specified",
"range",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L805-L826 |
Spinmob/spinmob | _plotting_mess.py | databoxes | def databoxes(ds, xscript=0, yscript=1, eyscript=None, exscript=None, g=None, plotter=xy_data, transpose=False, **kwargs):
"""
Plots the listed databox objects with the specified scripts.
ds list of databoxes
xscript script for x data
yscript script for y data
eyscript script for y ... | python | def databoxes(ds, xscript=0, yscript=1, eyscript=None, exscript=None, g=None, plotter=xy_data, transpose=False, **kwargs):
"""
Plots the listed databox objects with the specified scripts.
ds list of databoxes
xscript script for x data
yscript script for y data
eyscript script for y ... | [
"def",
"databoxes",
"(",
"ds",
",",
"xscript",
"=",
"0",
",",
"yscript",
"=",
"1",
",",
"eyscript",
"=",
"None",
",",
"exscript",
"=",
"None",
",",
"g",
"=",
"None",
",",
"plotter",
"=",
"xy_data",
",",
"transpose",
"=",
"False",
",",
"*",
"*",
"... | Plots the listed databox objects with the specified scripts.
ds list of databoxes
xscript script for x data
yscript script for y data
eyscript script for y error
exscript script for x error
plotter function used to do the plotting
transpose applies databox.transpose() prior t... | [
"Plots",
"the",
"listed",
"databox",
"objects",
"with",
"the",
"specified",
"scripts",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L833-L927 |
Spinmob/spinmob | _plotting_mess.py | files | def files(xscript=0, yscript=1, eyscript=None, exscript=None, g=None, plotter=xy_databoxes, paths=None, **kwargs):
"""
This will load a bunch of data files, generate data based on the supplied
scripts, and then plot this data using the specified databox plotter.
xscript, yscript, eyscript, exscript ... | python | def files(xscript=0, yscript=1, eyscript=None, exscript=None, g=None, plotter=xy_databoxes, paths=None, **kwargs):
"""
This will load a bunch of data files, generate data based on the supplied
scripts, and then plot this data using the specified databox plotter.
xscript, yscript, eyscript, exscript ... | [
"def",
"files",
"(",
"xscript",
"=",
"0",
",",
"yscript",
"=",
"1",
",",
"eyscript",
"=",
"None",
",",
"exscript",
"=",
"None",
",",
"g",
"=",
"None",
",",
"plotter",
"=",
"xy_databoxes",
",",
"paths",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
"... | This will load a bunch of data files, generate data based on the supplied
scripts, and then plot this data using the specified databox plotter.
xscript, yscript, eyscript, exscript scripts to generate x, y, and errors
g optional dictionary of globals
optional: ... | [
"This",
"will",
"load",
"a",
"bunch",
"of",
"data",
"files",
"generate",
"data",
"based",
"on",
"the",
"supplied",
"scripts",
"and",
"then",
"plot",
"this",
"data",
"using",
"the",
"specified",
"databox",
"plotter",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L929-L956 |
Spinmob/spinmob | _plotting_mess.py | image_data | def image_data(Z, X=[0,1.0], Y=[0,1.0], aspect=1.0, zmin=None, zmax=None, clear=1, clabel='z', autoformat=True, colormap="Last Used", shell_history=0, **kwargs):
"""
Generates an image plot.
Parameters
----------
Z
2-d array of z-values
X=[0,1.0], Y=[0,1.0]
1-d array of x... | python | def image_data(Z, X=[0,1.0], Y=[0,1.0], aspect=1.0, zmin=None, zmax=None, clear=1, clabel='z', autoformat=True, colormap="Last Used", shell_history=0, **kwargs):
"""
Generates an image plot.
Parameters
----------
Z
2-d array of z-values
X=[0,1.0], Y=[0,1.0]
1-d array of x... | [
"def",
"image_data",
"(",
"Z",
",",
"X",
"=",
"[",
"0",
",",
"1.0",
"]",
",",
"Y",
"=",
"[",
"0",
",",
"1.0",
"]",
",",
"aspect",
"=",
"1.0",
",",
"zmin",
"=",
"None",
",",
"zmax",
"=",
"None",
",",
"clear",
"=",
"1",
",",
"clabel",
"=",
... | Generates an image plot.
Parameters
----------
Z
2-d array of z-values
X=[0,1.0], Y=[0,1.0]
1-d array of x-values (only the first and last element are used)
See matplotlib's imshow() for additional optional arguments. | [
"Generates",
"an",
"image",
"plot",
".",
"Parameters",
"----------",
"Z",
"2",
"-",
"d",
"array",
"of",
"z",
"-",
"values",
"X",
"=",
"[",
"0",
"1",
".",
"0",
"]",
"Y",
"=",
"[",
"0",
"1",
".",
"0",
"]",
"1",
"-",
"d",
"array",
"of",
"x",
"... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L1020-L1101 |
Spinmob/spinmob | _plotting_mess.py | image_function | def image_function(f='sin(5*x)*cos(5*y)', xmin=-1, xmax=1, ymin=-1, ymax=1, xsteps=100, ysteps=100, p='x,y', g=None, **kwargs):
"""
Plots a 2-d function over the specified range
Parameters
----------
f='sin(5*x)*cos(5*y)'
Takes two inputs and returns one value. Can also
... | python | def image_function(f='sin(5*x)*cos(5*y)', xmin=-1, xmax=1, ymin=-1, ymax=1, xsteps=100, ysteps=100, p='x,y', g=None, **kwargs):
"""
Plots a 2-d function over the specified range
Parameters
----------
f='sin(5*x)*cos(5*y)'
Takes two inputs and returns one value. Can also
... | [
"def",
"image_function",
"(",
"f",
"=",
"'sin(5*x)*cos(5*y)'",
",",
"xmin",
"=",
"-",
"1",
",",
"xmax",
"=",
"1",
",",
"ymin",
"=",
"-",
"1",
",",
"ymax",
"=",
"1",
",",
"xsteps",
"=",
"100",
",",
"ysteps",
"=",
"100",
",",
"p",
"=",
"'x,y'",
"... | Plots a 2-d function over the specified range
Parameters
----------
f='sin(5*x)*cos(5*y)'
Takes two inputs and returns one value. Can also
be a string function such as sin(x*y)
xmin=-1, xmax=1, ymin=-1, ymax=1
Range over which to generate/plot the data
... | [
"Plots",
"a",
"2",
"-",
"d",
"function",
"over",
"the",
"specified",
"range"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L1106-L1164 |
Spinmob/spinmob | _plotting_mess.py | image_file | def image_file(path=None, zscript='self[1:]', xscript='[0,1]', yscript='d[0]', g=None, **kwargs):
"""
Loads an data file and plots it with color. Data file must have columns of the
same length!
Parameters
----------
path=None
Path to data file.
zscript='self[1:]'
Determines... | python | def image_file(path=None, zscript='self[1:]', xscript='[0,1]', yscript='d[0]', g=None, **kwargs):
"""
Loads an data file and plots it with color. Data file must have columns of the
same length!
Parameters
----------
path=None
Path to data file.
zscript='self[1:]'
Determines... | [
"def",
"image_file",
"(",
"path",
"=",
"None",
",",
"zscript",
"=",
"'self[1:]'",
",",
"xscript",
"=",
"'[0,1]'",
",",
"yscript",
"=",
"'d[0]'",
",",
"g",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'delimiter'",
"in",
"kwargs",
":",
"deli... | Loads an data file and plots it with color. Data file must have columns of the
same length!
Parameters
----------
path=None
Path to data file.
zscript='self[1:]'
Determines how to get data from the columns
xscript='[0,1]', yscript='d[0]'
Determine the x and y arrays us... | [
"Loads",
"an",
"data",
"file",
"and",
"plots",
"it",
"with",
"color",
".",
"Data",
"file",
"must",
"have",
"columns",
"of",
"the",
"same",
"length!"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L1167-L1207 |
Spinmob/spinmob | _plotting_mess.py | parametric_function | def parametric_function(fx='sin(t)', fy='cos(t)', tmin=-1, tmax=1, steps=200, p='t', g=None, erange=False, **kwargs):
"""
Plots the parametric function over the specified range
Parameters
----------
fx='sin(t)', fy='cos(t)'
Functions or (matching) lists of functions to plot;
... | python | def parametric_function(fx='sin(t)', fy='cos(t)', tmin=-1, tmax=1, steps=200, p='t', g=None, erange=False, **kwargs):
"""
Plots the parametric function over the specified range
Parameters
----------
fx='sin(t)', fy='cos(t)'
Functions or (matching) lists of functions to plot;
... | [
"def",
"parametric_function",
"(",
"fx",
"=",
"'sin(t)'",
",",
"fy",
"=",
"'cos(t)'",
",",
"tmin",
"=",
"-",
"1",
",",
"tmax",
"=",
"1",
",",
"steps",
"=",
"200",
",",
"p",
"=",
"'t'",
",",
"g",
"=",
"None",
",",
"erange",
"=",
"False",
",",
"*... | Plots the parametric function over the specified range
Parameters
----------
fx='sin(t)', fy='cos(t)'
Functions or (matching) lists of functions to plot;
can be string functions or python functions taking one argument
tmin=-1, tmax=1, steps=200
Range over which... | [
"Plots",
"the",
"parametric",
"function",
"over",
"the",
"specified",
"range"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L1213-L1279 |
Spinmob/spinmob | _plotting_mess.py | plot_style_cycle.reset | def reset(self):
"""
Resets the style cycle.
"""
for key in list(self.keys()): self.iterators[key] = _itertools.cycle(self[key])
return self | python | def reset(self):
"""
Resets the style cycle.
"""
for key in list(self.keys()): self.iterators[key] = _itertools.cycle(self[key])
return self | [
"def",
"reset",
"(",
"self",
")",
":",
"for",
"key",
"in",
"list",
"(",
"self",
".",
"keys",
"(",
")",
")",
":",
"self",
".",
"iterators",
"[",
"key",
"]",
"=",
"_itertools",
".",
"cycle",
"(",
"self",
"[",
"key",
"]",
")",
"return",
"self"
] | Resets the style cycle. | [
"Resets",
"the",
"style",
"cycle",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_plotting_mess.py#L1320-L1325 |
Spinmob/spinmob | _pylab_tweaks.py | add_text | def add_text(text, x=0.01, y=0.01, axes="gca", draw=True, **kwargs):
"""
Adds text to the axes at the specified position.
**kwargs go to the axes.text() function.
"""
if axes=="gca": axes = _pylab.gca()
axes.text(x, y, text, transform=axes.transAxes, **kwargs)
if draw: _pylab.draw() | python | def add_text(text, x=0.01, y=0.01, axes="gca", draw=True, **kwargs):
"""
Adds text to the axes at the specified position.
**kwargs go to the axes.text() function.
"""
if axes=="gca": axes = _pylab.gca()
axes.text(x, y, text, transform=axes.transAxes, **kwargs)
if draw: _pylab.draw() | [
"def",
"add_text",
"(",
"text",
",",
"x",
"=",
"0.01",
",",
"y",
"=",
"0.01",
",",
"axes",
"=",
"\"gca\"",
",",
"draw",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"axes",
"==",
"\"gca\"",
":",
"axes",
"=",
"_pylab",
".",
"gca",
"(",
... | Adds text to the axes at the specified position.
**kwargs go to the axes.text() function. | [
"Adds",
"text",
"to",
"the",
"axes",
"at",
"the",
"specified",
"position",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L36-L44 |
Spinmob/spinmob | _pylab_tweaks.py | auto_zoom | def auto_zoom(zoomx=True, zoomy=True, axes="gca", x_space=0.04, y_space=0.04, draw=True):
"""
Looks at the bounds of the plotted data and zooms accordingly, leaving some
space around the data.
"""
# Disable auto-updating by default.
_pylab.ioff()
if axes=="gca": axes = _pylab.gca()
# ... | python | def auto_zoom(zoomx=True, zoomy=True, axes="gca", x_space=0.04, y_space=0.04, draw=True):
"""
Looks at the bounds of the plotted data and zooms accordingly, leaving some
space around the data.
"""
# Disable auto-updating by default.
_pylab.ioff()
if axes=="gca": axes = _pylab.gca()
# ... | [
"def",
"auto_zoom",
"(",
"zoomx",
"=",
"True",
",",
"zoomy",
"=",
"True",
",",
"axes",
"=",
"\"gca\"",
",",
"x_space",
"=",
"0.04",
",",
"y_space",
"=",
"0.04",
",",
"draw",
"=",
"True",
")",
":",
"# Disable auto-updating by default.",
"_pylab",
".",
"io... | Looks at the bounds of the plotted data and zooms accordingly, leaving some
space around the data. | [
"Looks",
"at",
"the",
"bounds",
"of",
"the",
"plotted",
"data",
"and",
"zooms",
"accordingly",
"leaving",
"some",
"space",
"around",
"the",
"data",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L46-L83 |
Spinmob/spinmob | _pylab_tweaks.py | click_estimate_slope | def click_estimate_slope():
"""
Takes two clicks and returns the slope.
Right-click aborts.
"""
c1 = _pylab.ginput()
if len(c1)==0:
return None
c2 = _pylab.ginput()
if len(c2)==0:
return None
return (c1[0][1]-c2[0][1])/(c1[0][0]-c2[0][0]) | python | def click_estimate_slope():
"""
Takes two clicks and returns the slope.
Right-click aborts.
"""
c1 = _pylab.ginput()
if len(c1)==0:
return None
c2 = _pylab.ginput()
if len(c2)==0:
return None
return (c1[0][1]-c2[0][1])/(c1[0][0]-c2[0][0]) | [
"def",
"click_estimate_slope",
"(",
")",
":",
"c1",
"=",
"_pylab",
".",
"ginput",
"(",
")",
"if",
"len",
"(",
"c1",
")",
"==",
"0",
":",
"return",
"None",
"c2",
"=",
"_pylab",
".",
"ginput",
"(",
")",
"if",
"len",
"(",
"c2",
")",
"==",
"0",
":"... | Takes two clicks and returns the slope.
Right-click aborts. | [
"Takes",
"two",
"clicks",
"and",
"returns",
"the",
"slope",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L133-L148 |
Spinmob/spinmob | _pylab_tweaks.py | click_estimate_curvature | def click_estimate_curvature():
"""
Takes two clicks and returns the curvature, assuming the first click
was the minimum of a parabola and the second was some other point.
Returns the second derivative of the function giving this parabola.
Right-click aborts.
"""
c1 = _pylab.ginput()
... | python | def click_estimate_curvature():
"""
Takes two clicks and returns the curvature, assuming the first click
was the minimum of a parabola and the second was some other point.
Returns the second derivative of the function giving this parabola.
Right-click aborts.
"""
c1 = _pylab.ginput()
... | [
"def",
"click_estimate_curvature",
"(",
")",
":",
"c1",
"=",
"_pylab",
".",
"ginput",
"(",
")",
"if",
"len",
"(",
"c1",
")",
"==",
"0",
":",
"return",
"None",
"c2",
"=",
"_pylab",
".",
"ginput",
"(",
")",
"if",
"len",
"(",
"c2",
")",
"==",
"0",
... | Takes two clicks and returns the curvature, assuming the first click
was the minimum of a parabola and the second was some other point.
Returns the second derivative of the function giving this parabola.
Right-click aborts. | [
"Takes",
"two",
"clicks",
"and",
"returns",
"the",
"curvature",
"assuming",
"the",
"first",
"click",
"was",
"the",
"minimum",
"of",
"a",
"parabola",
"and",
"the",
"second",
"was",
"some",
"other",
"point",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L150-L168 |
Spinmob/spinmob | _pylab_tweaks.py | click_estimate_difference | def click_estimate_difference():
"""
Takes two clicks and returns the difference vector [dx, dy].
Right-click aborts.
"""
c1 = _pylab.ginput()
if len(c1)==0:
return None
c2 = _pylab.ginput()
if len(c2)==0:
return None
return [c2[0][0]-c1[0][0], c2[0][1]-c1[0][1]] | python | def click_estimate_difference():
"""
Takes two clicks and returns the difference vector [dx, dy].
Right-click aborts.
"""
c1 = _pylab.ginput()
if len(c1)==0:
return None
c2 = _pylab.ginput()
if len(c2)==0:
return None
return [c2[0][0]-c1[0][0], c2[0][1]-c1[0][1]] | [
"def",
"click_estimate_difference",
"(",
")",
":",
"c1",
"=",
"_pylab",
".",
"ginput",
"(",
")",
"if",
"len",
"(",
"c1",
")",
"==",
"0",
":",
"return",
"None",
"c2",
"=",
"_pylab",
".",
"ginput",
"(",
")",
"if",
"len",
"(",
"c2",
")",
"==",
"0",
... | Takes two clicks and returns the difference vector [dx, dy].
Right-click aborts. | [
"Takes",
"two",
"clicks",
"and",
"returns",
"the",
"difference",
"vector",
"[",
"dx",
"dy",
"]",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L170-L185 |
Spinmob/spinmob | _pylab_tweaks.py | copy_figure_to_clipboard | def copy_figure_to_clipboard(figure='gcf'):
"""
Copies the specified figure to the system clipboard. Specifying 'gcf'
will use the current figure.
"""
try:
import pyqtgraph as _p
# Get the current figure if necessary
if figure is 'gcf': figure = _s.pylab.gcf(... | python | def copy_figure_to_clipboard(figure='gcf'):
"""
Copies the specified figure to the system clipboard. Specifying 'gcf'
will use the current figure.
"""
try:
import pyqtgraph as _p
# Get the current figure if necessary
if figure is 'gcf': figure = _s.pylab.gcf(... | [
"def",
"copy_figure_to_clipboard",
"(",
"figure",
"=",
"'gcf'",
")",
":",
"try",
":",
"import",
"pyqtgraph",
"as",
"_p",
"# Get the current figure if necessary ",
"if",
"figure",
"is",
"'gcf'",
":",
"figure",
"=",
"_s",
".",
"pylab",
".",
"gcf",
"(",
")... | Copies the specified figure to the system clipboard. Specifying 'gcf'
will use the current figure. | [
"Copies",
"the",
"specified",
"figure",
"to",
"the",
"system",
"clipboard",
".",
"Specifying",
"gcf",
"will",
"use",
"the",
"current",
"figure",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L188-L208 |
Spinmob/spinmob | _pylab_tweaks.py | differentiate_shown_data | def differentiate_shown_data(neighbors=1, fyname=1, **kwargs):
"""
Differentiates the data visible on the specified axes using
fun.derivative_fit() (if neighbors > 0), and derivative() otherwise.
Modifies the visible data using manipulate_shown_data(**kwargs)
"""
if neighbors:
def D(x,y... | python | def differentiate_shown_data(neighbors=1, fyname=1, **kwargs):
"""
Differentiates the data visible on the specified axes using
fun.derivative_fit() (if neighbors > 0), and derivative() otherwise.
Modifies the visible data using manipulate_shown_data(**kwargs)
"""
if neighbors:
def D(x,y... | [
"def",
"differentiate_shown_data",
"(",
"neighbors",
"=",
"1",
",",
"fyname",
"=",
"1",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"neighbors",
":",
"def",
"D",
"(",
"x",
",",
"y",
")",
":",
"return",
"_fun",
".",
"derivative_fit",
"(",
"x",
",",
"y"... | Differentiates the data visible on the specified axes using
fun.derivative_fit() (if neighbors > 0), and derivative() otherwise.
Modifies the visible data using manipulate_shown_data(**kwargs) | [
"Differentiates",
"the",
"data",
"visible",
"on",
"the",
"specified",
"axes",
"using",
"fun",
".",
"derivative_fit",
"()",
"(",
"if",
"neighbors",
">",
"0",
")",
"and",
"derivative",
"()",
"otherwise",
".",
"Modifies",
"the",
"visible",
"data",
"using",
"man... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L210-L224 |
Spinmob/spinmob | _pylab_tweaks.py | fit_shown_data | def fit_shown_data(f="a*x+b", p="a=1, b=2", axes="gca", verbose=True, **kwargs):
"""
Fast-and-loos quick fit:
Loops over each line of the supplied axes and fits with the supplied
function (f) and parameters (p). Assumes uniform error and scales this
such that the reduced chi^2 is 1.
Returns a ... | python | def fit_shown_data(f="a*x+b", p="a=1, b=2", axes="gca", verbose=True, **kwargs):
"""
Fast-and-loos quick fit:
Loops over each line of the supplied axes and fits with the supplied
function (f) and parameters (p). Assumes uniform error and scales this
such that the reduced chi^2 is 1.
Returns a ... | [
"def",
"fit_shown_data",
"(",
"f",
"=",
"\"a*x+b\"",
",",
"p",
"=",
"\"a=1, b=2\"",
",",
"axes",
"=",
"\"gca\"",
",",
"verbose",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"# get the axes",
"if",
"axes",
"==",
"\"gca\"",
":",
"axes",
"=",
"_pylab"... | Fast-and-loos quick fit:
Loops over each line of the supplied axes and fits with the supplied
function (f) and parameters (p). Assumes uniform error and scales this
such that the reduced chi^2 is 1.
Returns a list of fitter objects
**kwargs are sent to _s.data.fitter() | [
"Fast",
"-",
"and",
"-",
"loos",
"quick",
"fit",
":"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L226-L268 |
Spinmob/spinmob | _pylab_tweaks.py | format_figure | def format_figure(figure=None, tall=False, draw=True, modify_geometry=True):
"""
This formats the figure in a compact way with (hopefully) enough useful
information for printing large data sets. Used mostly for line and scatter
plots with long, information-filled titles.
Chances are somewhat slim t... | python | def format_figure(figure=None, tall=False, draw=True, modify_geometry=True):
"""
This formats the figure in a compact way with (hopefully) enough useful
information for printing large data sets. Used mostly for line and scatter
plots with long, information-filled titles.
Chances are somewhat slim t... | [
"def",
"format_figure",
"(",
"figure",
"=",
"None",
",",
"tall",
"=",
"False",
",",
"draw",
"=",
"True",
",",
"modify_geometry",
"=",
"True",
")",
":",
"_pylab",
".",
"ioff",
"(",
")",
"if",
"figure",
"==",
"None",
":",
"figure",
"=",
"_pylab",
".",
... | This formats the figure in a compact way with (hopefully) enough useful
information for printing large data sets. Used mostly for line and scatter
plots with long, information-filled titles.
Chances are somewhat slim this will be ideal for you but it very well might
and is at least a good starting poin... | [
"This",
"formats",
"the",
"figure",
"in",
"a",
"compact",
"way",
"with",
"(",
"hopefully",
")",
"enough",
"useful",
"information",
"for",
"printing",
"large",
"data",
"sets",
".",
"Used",
"mostly",
"for",
"line",
"and",
"scatter",
"plots",
"with",
"long",
... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L270-L353 |
Spinmob/spinmob | _pylab_tweaks.py | get_figure_window_geometry | def get_figure_window_geometry(fig='gcf'):
"""
This will currently only work for Qt4Agg and WXAgg backends.
Returns position, size
postion = [x, y]
size = [width, height]
fig can be 'gcf', a number, or a figure object.
"""
if type(fig)==str: fig = _pylab.gcf()
elif _fu... | python | def get_figure_window_geometry(fig='gcf'):
"""
This will currently only work for Qt4Agg and WXAgg backends.
Returns position, size
postion = [x, y]
size = [width, height]
fig can be 'gcf', a number, or a figure object.
"""
if type(fig)==str: fig = _pylab.gcf()
elif _fu... | [
"def",
"get_figure_window_geometry",
"(",
"fig",
"=",
"'gcf'",
")",
":",
"if",
"type",
"(",
"fig",
")",
"==",
"str",
":",
"fig",
"=",
"_pylab",
".",
"gcf",
"(",
")",
"elif",
"_fun",
".",
"is_a_number",
"(",
"fig",
")",
":",
"fig",
"=",
"_pylab",
".... | This will currently only work for Qt4Agg and WXAgg backends.
Returns position, size
postion = [x, y]
size = [width, height]
fig can be 'gcf', a number, or a figure object. | [
"This",
"will",
"currently",
"only",
"work",
"for",
"Qt4Agg",
"and",
"WXAgg",
"backends",
".",
"Returns",
"position",
"size"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L363-L385 |
Spinmob/spinmob | _pylab_tweaks.py | image_format_figure | def image_format_figure(figure=None, draw=True):
"""
This formats the figure in a compact way with (hopefully) enough useful
information for printing large data sets. Used mostly for line and scatter
plots with long, information-filled titles.
Chances are somewhat slim this will be ideal for you bu... | python | def image_format_figure(figure=None, draw=True):
"""
This formats the figure in a compact way with (hopefully) enough useful
information for printing large data sets. Used mostly for line and scatter
plots with long, information-filled titles.
Chances are somewhat slim this will be ideal for you bu... | [
"def",
"image_format_figure",
"(",
"figure",
"=",
"None",
",",
"draw",
"=",
"True",
")",
":",
"_pylab",
".",
"ioff",
"(",
")",
"if",
"figure",
"==",
"None",
":",
"figure",
"=",
"_pylab",
".",
"gcf",
"(",
")",
"set_figure_window_geometry",
"(",
"figure",
... | This formats the figure in a compact way with (hopefully) enough useful
information for printing large data sets. Used mostly for line and scatter
plots with long, information-filled titles.
Chances are somewhat slim this will be ideal for you but it very well might
and is at least a good starting poin... | [
"This",
"formats",
"the",
"figure",
"in",
"a",
"compact",
"way",
"with",
"(",
"hopefully",
")",
"enough",
"useful",
"information",
"for",
"printing",
"large",
"data",
"sets",
".",
"Used",
"mostly",
"for",
"line",
"and",
"scatter",
"plots",
"with",
"long",
... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L388-L416 |
Spinmob/spinmob | _pylab_tweaks.py | impose_legend_limit | def impose_legend_limit(limit=30, axes="gca", **kwargs):
"""
This will erase all but, say, 30 of the legend entries and remake the legend.
You'll probably have to move it back into your favorite position at this point.
"""
if axes=="gca": axes = _pylab.gca()
# make these axes current
_pylab... | python | def impose_legend_limit(limit=30, axes="gca", **kwargs):
"""
This will erase all but, say, 30 of the legend entries and remake the legend.
You'll probably have to move it back into your favorite position at this point.
"""
if axes=="gca": axes = _pylab.gca()
# make these axes current
_pylab... | [
"def",
"impose_legend_limit",
"(",
"limit",
"=",
"30",
",",
"axes",
"=",
"\"gca\"",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"axes",
"==",
"\"gca\"",
":",
"axes",
"=",
"_pylab",
".",
"gca",
"(",
")",
"# make these axes current",
"_pylab",
".",
"axes",
... | This will erase all but, say, 30 of the legend entries and remake the legend.
You'll probably have to move it back into your favorite position at this point. | [
"This",
"will",
"erase",
"all",
"but",
"say",
"30",
"of",
"the",
"legend",
"entries",
"and",
"remake",
"the",
"legend",
".",
"You",
"ll",
"probably",
"have",
"to",
"move",
"it",
"back",
"into",
"your",
"favorite",
"position",
"at",
"this",
"point",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L418-L433 |
Spinmob/spinmob | _pylab_tweaks.py | image_coarsen | def image_coarsen(xlevel=0, ylevel=0, image="auto", method='average'):
"""
This will coarsen the image data by binning each xlevel+1 along the x-axis
and each ylevel+1 points along the y-axis
type can be 'average', 'min', or 'max'
"""
if image == "auto": image = _pylab.gca().images[0]
Z = ... | python | def image_coarsen(xlevel=0, ylevel=0, image="auto", method='average'):
"""
This will coarsen the image data by binning each xlevel+1 along the x-axis
and each ylevel+1 points along the y-axis
type can be 'average', 'min', or 'max'
"""
if image == "auto": image = _pylab.gca().images[0]
Z = ... | [
"def",
"image_coarsen",
"(",
"xlevel",
"=",
"0",
",",
"ylevel",
"=",
"0",
",",
"image",
"=",
"\"auto\"",
",",
"method",
"=",
"'average'",
")",
":",
"if",
"image",
"==",
"\"auto\"",
":",
"image",
"=",
"_pylab",
".",
"gca",
"(",
")",
".",
"images",
"... | This will coarsen the image data by binning each xlevel+1 along the x-axis
and each ylevel+1 points along the y-axis
type can be 'average', 'min', or 'max' | [
"This",
"will",
"coarsen",
"the",
"image",
"data",
"by",
"binning",
"each",
"xlevel",
"+",
"1",
"along",
"the",
"x",
"-",
"axis",
"and",
"each",
"ylevel",
"+",
"1",
"points",
"along",
"the",
"y",
"-",
"axis"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L449-L469 |
Spinmob/spinmob | _pylab_tweaks.py | image_neighbor_smooth | def image_neighbor_smooth(xlevel=0.2, ylevel=0.2, image="auto"):
"""
This will bleed nearest neighbor pixels into each other with
the specified weight factors.
"""
if image == "auto": image = _pylab.gca().images[0]
Z = _n.array(image.get_array())
# store this image in the undo list
glo... | python | def image_neighbor_smooth(xlevel=0.2, ylevel=0.2, image="auto"):
"""
This will bleed nearest neighbor pixels into each other with
the specified weight factors.
"""
if image == "auto": image = _pylab.gca().images[0]
Z = _n.array(image.get_array())
# store this image in the undo list
glo... | [
"def",
"image_neighbor_smooth",
"(",
"xlevel",
"=",
"0.2",
",",
"ylevel",
"=",
"0.2",
",",
"image",
"=",
"\"auto\"",
")",
":",
"if",
"image",
"==",
"\"auto\"",
":",
"image",
"=",
"_pylab",
".",
"gca",
"(",
")",
".",
"images",
"[",
"0",
"]",
"Z",
"=... | This will bleed nearest neighbor pixels into each other with
the specified weight factors. | [
"This",
"will",
"bleed",
"nearest",
"neighbor",
"pixels",
"into",
"each",
"other",
"with",
"the",
"specified",
"weight",
"factors",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L472-L506 |
Spinmob/spinmob | _pylab_tweaks.py | image_undo | def image_undo():
"""
Undoes the last coarsen or smooth command.
"""
if len(image_undo_list) <= 0:
print("no undos in memory")
return
[image, Z] = image_undo_list.pop(-1)
image.set_array(Z)
_pylab.draw() | python | def image_undo():
"""
Undoes the last coarsen or smooth command.
"""
if len(image_undo_list) <= 0:
print("no undos in memory")
return
[image, Z] = image_undo_list.pop(-1)
image.set_array(Z)
_pylab.draw() | [
"def",
"image_undo",
"(",
")",
":",
"if",
"len",
"(",
"image_undo_list",
")",
"<=",
"0",
":",
"print",
"(",
"\"no undos in memory\"",
")",
"return",
"[",
"image",
",",
"Z",
"]",
"=",
"image_undo_list",
".",
"pop",
"(",
"-",
"1",
")",
"image",
".",
"s... | Undoes the last coarsen or smooth command. | [
"Undoes",
"the",
"last",
"coarsen",
"or",
"smooth",
"command",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L508-L518 |
Spinmob/spinmob | _pylab_tweaks.py | image_set_aspect | def image_set_aspect(aspect=1.0, axes="gca"):
"""
sets the aspect ratio of the current zoom level of the imshow image
"""
if axes is "gca": axes = _pylab.gca()
e = axes.get_images()[0].get_extent()
axes.set_aspect(abs((e[1]-e[0])/(e[3]-e[2]))/aspect) | python | def image_set_aspect(aspect=1.0, axes="gca"):
"""
sets the aspect ratio of the current zoom level of the imshow image
"""
if axes is "gca": axes = _pylab.gca()
e = axes.get_images()[0].get_extent()
axes.set_aspect(abs((e[1]-e[0])/(e[3]-e[2]))/aspect) | [
"def",
"image_set_aspect",
"(",
"aspect",
"=",
"1.0",
",",
"axes",
"=",
"\"gca\"",
")",
":",
"if",
"axes",
"is",
"\"gca\"",
":",
"axes",
"=",
"_pylab",
".",
"gca",
"(",
")",
"e",
"=",
"axes",
".",
"get_images",
"(",
")",
"[",
"0",
"]",
".",
"get_... | sets the aspect ratio of the current zoom level of the imshow image | [
"sets",
"the",
"aspect",
"ratio",
"of",
"the",
"current",
"zoom",
"level",
"of",
"the",
"imshow",
"image"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L521-L528 |
Spinmob/spinmob | _pylab_tweaks.py | image_set_extent | def image_set_extent(x=None, y=None, axes="gca"):
"""
Set's the first image's extent, then redraws.
Examples:
x = [1,4]
y = [33.3, 22]
"""
if axes == "gca": axes = _pylab.gca()
# get the current plot limits
xlim = axes.get_xlim()
ylim = axes.get_ylim()
# get the old extent... | python | def image_set_extent(x=None, y=None, axes="gca"):
"""
Set's the first image's extent, then redraws.
Examples:
x = [1,4]
y = [33.3, 22]
"""
if axes == "gca": axes = _pylab.gca()
# get the current plot limits
xlim = axes.get_xlim()
ylim = axes.get_ylim()
# get the old extent... | [
"def",
"image_set_extent",
"(",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"axes",
"=",
"\"gca\"",
")",
":",
"if",
"axes",
"==",
"\"gca\"",
":",
"axes",
"=",
"_pylab",
".",
"gca",
"(",
")",
"# get the current plot limits",
"xlim",
"=",
"axes",
".",
... | Set's the first image's extent, then redraws.
Examples:
x = [1,4]
y = [33.3, 22] | [
"Set",
"s",
"the",
"first",
"image",
"s",
"extent",
"then",
"redraws",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L530-L586 |
Spinmob/spinmob | _pylab_tweaks.py | image_scale | def image_scale(xscale=1.0, yscale=1.0, axes="gca"):
"""
Scales the image extent.
"""
if axes == "gca": axes = _pylab.gca()
e = axes.images[0].get_extent()
x1 = e[0]*xscale
x2 = e[1]*xscale
y1 = e[2]*yscale
y2 = e[3]*yscale
image_set_extent([x1,x2],[y1,y2], axes) | python | def image_scale(xscale=1.0, yscale=1.0, axes="gca"):
"""
Scales the image extent.
"""
if axes == "gca": axes = _pylab.gca()
e = axes.images[0].get_extent()
x1 = e[0]*xscale
x2 = e[1]*xscale
y1 = e[2]*yscale
y2 = e[3]*yscale
image_set_extent([x1,x2],[y1,y2], axes) | [
"def",
"image_scale",
"(",
"xscale",
"=",
"1.0",
",",
"yscale",
"=",
"1.0",
",",
"axes",
"=",
"\"gca\"",
")",
":",
"if",
"axes",
"==",
"\"gca\"",
":",
"axes",
"=",
"_pylab",
".",
"gca",
"(",
")",
"e",
"=",
"axes",
".",
"images",
"[",
"0",
"]",
... | Scales the image extent. | [
"Scales",
"the",
"image",
"extent",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L589-L601 |
Spinmob/spinmob | _pylab_tweaks.py | image_click_xshift | def image_click_xshift(axes = "gca"):
"""
Takes a starting and ending point, then shifts the image y by this amount
"""
if axes == "gca": axes = _pylab.gca()
try:
p1 = _pylab.ginput()
p2 = _pylab.ginput()
xshift = p2[0][0]-p1[0][0]
e = axes.images[0].get_extent()
... | python | def image_click_xshift(axes = "gca"):
"""
Takes a starting and ending point, then shifts the image y by this amount
"""
if axes == "gca": axes = _pylab.gca()
try:
p1 = _pylab.ginput()
p2 = _pylab.ginput()
xshift = p2[0][0]-p1[0][0]
e = axes.images[0].get_extent()
... | [
"def",
"image_click_xshift",
"(",
"axes",
"=",
"\"gca\"",
")",
":",
"if",
"axes",
"==",
"\"gca\"",
":",
"axes",
"=",
"_pylab",
".",
"gca",
"(",
")",
"try",
":",
"p1",
"=",
"_pylab",
".",
"ginput",
"(",
")",
"p2",
"=",
"_pylab",
".",
"ginput",
"(",
... | Takes a starting and ending point, then shifts the image y by this amount | [
"Takes",
"a",
"starting",
"and",
"ending",
"point",
"then",
"shifts",
"the",
"image",
"y",
"by",
"this",
"amount"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L605-L626 |
Spinmob/spinmob | _pylab_tweaks.py | image_click_yshift | def image_click_yshift(axes = "gca"):
"""
Takes a starting and ending point, then shifts the image y by this amount
"""
if axes == "gca": axes = _pylab.gca()
try:
p1 = _pylab.ginput()
p2 = _pylab.ginput()
yshift = p2[0][1]-p1[0][1]
e = axes.images[0].get_extent()
... | python | def image_click_yshift(axes = "gca"):
"""
Takes a starting and ending point, then shifts the image y by this amount
"""
if axes == "gca": axes = _pylab.gca()
try:
p1 = _pylab.ginput()
p2 = _pylab.ginput()
yshift = p2[0][1]-p1[0][1]
e = axes.images[0].get_extent()
... | [
"def",
"image_click_yshift",
"(",
"axes",
"=",
"\"gca\"",
")",
":",
"if",
"axes",
"==",
"\"gca\"",
":",
"axes",
"=",
"_pylab",
".",
"gca",
"(",
")",
"try",
":",
"p1",
"=",
"_pylab",
".",
"ginput",
"(",
")",
"p2",
"=",
"_pylab",
".",
"ginput",
"(",
... | Takes a starting and ending point, then shifts the image y by this amount | [
"Takes",
"a",
"starting",
"and",
"ending",
"point",
"then",
"shifts",
"the",
"image",
"y",
"by",
"this",
"amount"
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L628-L649 |
Spinmob/spinmob | _pylab_tweaks.py | image_shift | def image_shift(xshift=0, yshift=0, axes="gca"):
"""
This will shift an image to a new location on x and y.
"""
if axes=="gca": axes = _pylab.gca()
e = axes.images[0].get_extent()
e[0] = e[0] + xshift
e[1] = e[1] + xshift
e[2] = e[2] + yshift
e[3] = e[3] + yshift
axes.images[... | python | def image_shift(xshift=0, yshift=0, axes="gca"):
"""
This will shift an image to a new location on x and y.
"""
if axes=="gca": axes = _pylab.gca()
e = axes.images[0].get_extent()
e[0] = e[0] + xshift
e[1] = e[1] + xshift
e[2] = e[2] + yshift
e[3] = e[3] + yshift
axes.images[... | [
"def",
"image_shift",
"(",
"xshift",
"=",
"0",
",",
"yshift",
"=",
"0",
",",
"axes",
"=",
"\"gca\"",
")",
":",
"if",
"axes",
"==",
"\"gca\"",
":",
"axes",
"=",
"_pylab",
".",
"gca",
"(",
")",
"e",
"=",
"axes",
".",
"images",
"[",
"0",
"]",
".",... | This will shift an image to a new location on x and y. | [
"This",
"will",
"shift",
"an",
"image",
"to",
"a",
"new",
"location",
"on",
"x",
"and",
"y",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L651-L667 |
Spinmob/spinmob | _pylab_tweaks.py | image_set_clim | def image_set_clim(zmin=None, zmax=None, axes="gca"):
"""
This will set the clim (range) of the colorbar.
Setting zmin or zmax to None will not change them.
Setting zmin or zmax to "auto" will auto-scale them to include all the data.
"""
if axes=="gca": axes=_pylab.gca()
image = axes.image... | python | def image_set_clim(zmin=None, zmax=None, axes="gca"):
"""
This will set the clim (range) of the colorbar.
Setting zmin or zmax to None will not change them.
Setting zmin or zmax to "auto" will auto-scale them to include all the data.
"""
if axes=="gca": axes=_pylab.gca()
image = axes.image... | [
"def",
"image_set_clim",
"(",
"zmin",
"=",
"None",
",",
"zmax",
"=",
"None",
",",
"axes",
"=",
"\"gca\"",
")",
":",
"if",
"axes",
"==",
"\"gca\"",
":",
"axes",
"=",
"_pylab",
".",
"gca",
"(",
")",
"image",
"=",
"axes",
".",
"images",
"[",
"0",
"]... | This will set the clim (range) of the colorbar.
Setting zmin or zmax to None will not change them.
Setting zmin or zmax to "auto" will auto-scale them to include all the data. | [
"This",
"will",
"set",
"the",
"clim",
"(",
"range",
")",
"of",
"the",
"colorbar",
"."
] | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L671-L690 |
Spinmob/spinmob | _pylab_tweaks.py | integrate_shown_data | def integrate_shown_data(scale=1, fyname=1, autozero=0, **kwargs):
"""
Numerically integrates the data visible on the current/specified axes using
scale*fun.integrate_data(x,y). Modifies the visible data using
manipulate_shown_data(**kwargs)
autozero is the number of data points used to estimate th... | python | def integrate_shown_data(scale=1, fyname=1, autozero=0, **kwargs):
"""
Numerically integrates the data visible on the current/specified axes using
scale*fun.integrate_data(x,y). Modifies the visible data using
manipulate_shown_data(**kwargs)
autozero is the number of data points used to estimate th... | [
"def",
"integrate_shown_data",
"(",
"scale",
"=",
"1",
",",
"fyname",
"=",
"1",
",",
"autozero",
"=",
"0",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"I",
"(",
"x",
",",
"y",
")",
":",
"xout",
",",
"iout",
"=",
"_fun",
".",
"integrate_data",
"(",
... | Numerically integrates the data visible on the current/specified axes using
scale*fun.integrate_data(x,y). Modifies the visible data using
manipulate_shown_data(**kwargs)
autozero is the number of data points used to estimate the background
for subtraction. If autozero = 0, no background subtraction is... | [
"Numerically",
"integrates",
"the",
"data",
"visible",
"on",
"the",
"current",
"/",
"specified",
"axes",
"using",
"scale",
"*",
"fun",
".",
"integrate_data",
"(",
"x",
"y",
")",
".",
"Modifies",
"the",
"visible",
"data",
"using",
"manipulate_shown_data",
"(",
... | train | https://github.com/Spinmob/spinmob/blob/f037f5df07f194bcd4a01f4d9916e57b9e8fb45a/_pylab_tweaks.py#L763-L780 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.