partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
scanABFfolder
scan an ABF directory and subdirectory. Try to do this just once. Returns ABF files, SWHLab files, and groups.
doc/oldcode/swhlab/core/common.py
def scanABFfolder(abfFolder): """ scan an ABF directory and subdirectory. Try to do this just once. Returns ABF files, SWHLab files, and groups. """ assert os.path.isdir(abfFolder) filesABF=forwardSlash(sorted(glob.glob(abfFolder+"/*.*"))) filesSWH=[] if os.path.exists(abfFolder+"/swhlab...
def scanABFfolder(abfFolder): """ scan an ABF directory and subdirectory. Try to do this just once. Returns ABF files, SWHLab files, and groups. """ assert os.path.isdir(abfFolder) filesABF=forwardSlash(sorted(glob.glob(abfFolder+"/*.*"))) filesSWH=[] if os.path.exists(abfFolder+"/swhlab...
[ "scan", "an", "ABF", "directory", "and", "subdirectory", ".", "Try", "to", "do", "this", "just", "once", ".", "Returns", "ABF", "files", "SWHLab", "files", "and", "groups", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L631-L642
[ "def", "scanABFfolder", "(", "abfFolder", ")", ":", "assert", "os", ".", "path", ".", "isdir", "(", "abfFolder", ")", "filesABF", "=", "forwardSlash", "(", "sorted", "(", "glob", ".", "glob", "(", "abfFolder", "+", "\"/*.*\"", ")", ")", ")", "filesSWH", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
getParent
given an ABF file name, return the ABF of its parent.
doc/oldcode/swhlab/core/common.py
def getParent(abfFname): """given an ABF file name, return the ABF of its parent.""" child=os.path.abspath(abfFname) files=sorted(glob.glob(os.path.dirname(child)+"/*.*")) parentID=abfFname #its own parent for fname in files: if fname.endswith(".abf") and fname.replace(".abf",".TIF") in file...
def getParent(abfFname): """given an ABF file name, return the ABF of its parent.""" child=os.path.abspath(abfFname) files=sorted(glob.glob(os.path.dirname(child)+"/*.*")) parentID=abfFname #its own parent for fname in files: if fname.endswith(".abf") and fname.replace(".abf",".TIF") in file...
[ "given", "an", "ABF", "file", "name", "return", "the", "ABF", "of", "its", "parent", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L644-L654
[ "def", "getParent", "(", "abfFname", ")", ":", "child", "=", "os", ".", "path", ".", "abspath", "(", "abfFname", ")", "files", "=", "sorted", "(", "glob", ".", "glob", "(", "os", ".", "path", ".", "dirname", "(", "child", ")", "+", "\"/*.*\"", ")",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
getParent2
given an ABF and the groups dict, return the ID of its parent.
doc/oldcode/swhlab/core/common.py
def getParent2(abfFname,groups): """given an ABF and the groups dict, return the ID of its parent.""" if ".abf" in abfFname: abfFname=os.path.basename(abfFname).replace(".abf","") for parentID in groups.keys(): if abfFname in groups[parentID]: return parentID return abfFname
def getParent2(abfFname,groups): """given an ABF and the groups dict, return the ID of its parent.""" if ".abf" in abfFname: abfFname=os.path.basename(abfFname).replace(".abf","") for parentID in groups.keys(): if abfFname in groups[parentID]: return parentID return abfFname
[ "given", "an", "ABF", "and", "the", "groups", "dict", "return", "the", "ID", "of", "its", "parent", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L656-L663
[ "def", "getParent2", "(", "abfFname", ",", "groups", ")", ":", "if", "\".abf\"", "in", "abfFname", ":", "abfFname", "=", "os", ".", "path", ".", "basename", "(", "abfFname", ")", ".", "replace", "(", "\".abf\"", ",", "\"\"", ")", "for", "parentID", "in...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
getNotesForABF
given an ABF, find the parent, return that line of experiments.txt
doc/oldcode/swhlab/core/common.py
def getNotesForABF(abfFile): """given an ABF, find the parent, return that line of experiments.txt""" parent=getParent(abfFile) parent=os.path.basename(parent).replace(".abf","") expFile=os.path.dirname(abfFile)+"/experiment.txt" if not os.path.exists(expFile): return "no experiment file" ...
def getNotesForABF(abfFile): """given an ABF, find the parent, return that line of experiments.txt""" parent=getParent(abfFile) parent=os.path.basename(parent).replace(".abf","") expFile=os.path.dirname(abfFile)+"/experiment.txt" if not os.path.exists(expFile): return "no experiment file" ...
[ "given", "an", "ABF", "find", "the", "parent", "return", "that", "line", "of", "experiments", ".", "txt" ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L665-L682
[ "def", "getNotesForABF", "(", "abfFile", ")", ":", "parent", "=", "getParent", "(", "abfFile", ")", "parent", "=", "os", ".", "path", ".", "basename", "(", "parent", ")", ".", "replace", "(", "\".abf\"", ",", "\"\"", ")", "expFile", "=", "os", ".", "...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
getABFgroups
given a list of ALL files (not just ABFs), return a dict[ID]=[ID,ID,ID]. Parents are determined if a .abf matches a .TIF. This is made to assign children files to parent ABF IDs.
doc/oldcode/swhlab/core/common.py
def getABFgroups(files): """ given a list of ALL files (not just ABFs), return a dict[ID]=[ID,ID,ID]. Parents are determined if a .abf matches a .TIF. This is made to assign children files to parent ABF IDs. """ children=[] groups={} for fname in sorted(files): if fname.endswith(...
def getABFgroups(files): """ given a list of ALL files (not just ABFs), return a dict[ID]=[ID,ID,ID]. Parents are determined if a .abf matches a .TIF. This is made to assign children files to parent ABF IDs. """ children=[] groups={} for fname in sorted(files): if fname.endswith(...
[ "given", "a", "list", "of", "ALL", "files", "(", "not", "just", "ABFs", ")", "return", "a", "dict", "[", "ID", "]", "=", "[", "ID", "ID", "ID", "]", ".", "Parents", "are", "determined", "if", "a", ".", "abf", "matches", "a", ".", "TIF", ".", "T...
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L684-L702
[ "def", "getABFgroups", "(", "files", ")", ":", "children", "=", "[", "]", "groups", "=", "{", "}", "for", "fname", "in", "sorted", "(", "files", ")", ":", "if", "fname", ".", "endswith", "(", "\".abf\"", ")", ":", "if", "fname", ".", "replace", "("...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
getIDfileDict
given a list of files, return a dict[ID]=[files]. This is made to assign children files to parent ABF IDs.
doc/oldcode/swhlab/core/common.py
def getIDfileDict(files): """ given a list of files, return a dict[ID]=[files]. This is made to assign children files to parent ABF IDs. """ d={} orphans=[] for fname in files: if fname.endswith(".abf"): d[os.path.basename(fname)[:-4]]=[] for fname in files: i...
def getIDfileDict(files): """ given a list of files, return a dict[ID]=[files]. This is made to assign children files to parent ABF IDs. """ d={} orphans=[] for fname in files: if fname.endswith(".abf"): d[os.path.basename(fname)[:-4]]=[] for fname in files: i...
[ "given", "a", "list", "of", "files", "return", "a", "dict", "[", "ID", "]", "=", "[", "files", "]", ".", "This", "is", "made", "to", "assign", "children", "files", "to", "parent", "ABF", "IDs", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L704-L728
[ "def", "getIDfileDict", "(", "files", ")", ":", "d", "=", "{", "}", "orphans", "=", "[", "]", "for", "fname", "in", "files", ":", "if", "fname", ".", "endswith", "(", "\".abf\"", ")", ":", "d", "[", "os", ".", "path", ".", "basename", "(", "fname...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
getIDsFromFiles
given a path or list of files, return ABF IDs.
doc/oldcode/swhlab/core/common.py
def getIDsFromFiles(files): """given a path or list of files, return ABF IDs.""" if type(files) is str: files=glob.glob(files+"/*.*") IDs=[] for fname in files: if fname[-4:].lower()=='.abf': ext=fname.split('.')[-1] IDs.append(os.path.basename(fname).replace('.'+...
def getIDsFromFiles(files): """given a path or list of files, return ABF IDs.""" if type(files) is str: files=glob.glob(files+"/*.*") IDs=[] for fname in files: if fname[-4:].lower()=='.abf': ext=fname.split('.')[-1] IDs.append(os.path.basename(fname).replace('.'+...
[ "given", "a", "path", "or", "list", "of", "files", "return", "ABF", "IDs", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L730-L739
[ "def", "getIDsFromFiles", "(", "files", ")", ":", "if", "type", "(", "files", ")", "is", "str", ":", "files", "=", "glob", ".", "glob", "(", "files", "+", "\"/*.*\"", ")", "IDs", "=", "[", "]", "for", "fname", "in", "files", ":", "if", "fname", "...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
inspectABF
May be given an ABF object or filename.
doc/oldcode/swhlab/core/common.py
def inspectABF(abf=exampleABF,saveToo=False,justPlot=False): """May be given an ABF object or filename.""" pylab.close('all') print(" ~~ inspectABF()") if type(abf) is str: abf=swhlab.ABF(abf) swhlab.plot.new(abf,forceNewFigure=True) if abf.sweepInterval*abf.sweeps<60*5: #shorter than 5 ...
def inspectABF(abf=exampleABF,saveToo=False,justPlot=False): """May be given an ABF object or filename.""" pylab.close('all') print(" ~~ inspectABF()") if type(abf) is str: abf=swhlab.ABF(abf) swhlab.plot.new(abf,forceNewFigure=True) if abf.sweepInterval*abf.sweeps<60*5: #shorter than 5 ...
[ "May", "be", "given", "an", "ABF", "object", "or", "filename", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L741-L768
[ "def", "inspectABF", "(", "abf", "=", "exampleABF", ",", "saveToo", "=", "False", ",", "justPlot", "=", "False", ")", ":", "pylab", ".", "close", "(", "'all'", ")", "print", "(", "\" ~~ inspectABF()\"", ")", "if", "type", "(", "abf", ")", "is", "str", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ftp_login
return an "FTP" object after logging in.
doc/oldcode/swhlab/core/common.py
def ftp_login(folder=None): """return an "FTP" object after logging in.""" pwDir=os.path.realpath(__file__) for i in range(3): pwDir=os.path.dirname(pwDir) pwFile = os.path.join(pwDir,"passwd.txt") print(" -- looking for login information in:\n [%s]"%pwFile) try: with open(pwFi...
def ftp_login(folder=None): """return an "FTP" object after logging in.""" pwDir=os.path.realpath(__file__) for i in range(3): pwDir=os.path.dirname(pwDir) pwFile = os.path.join(pwDir,"passwd.txt") print(" -- looking for login information in:\n [%s]"%pwFile) try: with open(pwFi...
[ "return", "an", "FTP", "object", "after", "logging", "in", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L798-L829
[ "def", "ftp_login", "(", "folder", "=", "None", ")", ":", "pwDir", "=", "os", ".", "path", ".", "realpath", "(", "__file__", ")", "for", "i", "in", "range", "(", "3", ")", ":", "pwDir", "=", "os", ".", "path", ".", "dirname", "(", "pwDir", ")", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ftp_folder_match
upload everything from localFolder into the current FTP folder.
doc/oldcode/swhlab/core/common.py
def ftp_folder_match(ftp,localFolder,deleteStuff=True): """upload everything from localFolder into the current FTP folder.""" for fname in glob.glob(localFolder+"/*.*"): ftp_upload(ftp,fname) return
def ftp_folder_match(ftp,localFolder,deleteStuff=True): """upload everything from localFolder into the current FTP folder.""" for fname in glob.glob(localFolder+"/*.*"): ftp_upload(ftp,fname) return
[ "upload", "everything", "from", "localFolder", "into", "the", "current", "FTP", "folder", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L831-L835
[ "def", "ftp_folder_match", "(", "ftp", ",", "localFolder", ",", "deleteStuff", "=", "True", ")", ":", "for", "fname", "in", "glob", ".", "glob", "(", "localFolder", "+", "\"/*.*\"", ")", ":", "ftp_upload", "(", "ftp", ",", "fname", ")", "return" ]
a86c3c65323cec809a4bd4f81919644927094bf5
valid
version_upload
Only scott should do this. Upload new version to site.
doc/oldcode/swhlab/core/common.py
def version_upload(fname,username="nibjb"): """Only scott should do this. Upload new version to site.""" print("popping up pasword window...") password=TK_askPassword("FTP LOGIN","enter password for %s"%username) if not password: return print("username:",username) print("password:","*"*(...
def version_upload(fname,username="nibjb"): """Only scott should do this. Upload new version to site.""" print("popping up pasword window...") password=TK_askPassword("FTP LOGIN","enter password for %s"%username) if not password: return print("username:",username) print("password:","*"*(...
[ "Only", "scott", "should", "do", "this", ".", "Upload", "new", "version", "to", "site", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L845-L861
[ "def", "version_upload", "(", "fname", ",", "username", "=", "\"nibjb\"", ")", ":", "print", "(", "\"popping up pasword window...\"", ")", "password", "=", "TK_askPassword", "(", "\"FTP LOGIN\"", ",", "\"enter password for %s\"", "%", "username", ")", "if", "not", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
TK_askPassword
use the GUI to ask for a string.
doc/oldcode/swhlab/core/common.py
def TK_askPassword(title="input",msg="type here:"): """use the GUI to ask for a string.""" root = tkinter.Tk() root.withdraw() #hide tk window root.attributes("-topmost", True) #always on top root.lift() #bring to top value=tkinter.simpledialog.askstring(title,msg) root.destroy() return ...
def TK_askPassword(title="input",msg="type here:"): """use the GUI to ask for a string.""" root = tkinter.Tk() root.withdraw() #hide tk window root.attributes("-topmost", True) #always on top root.lift() #bring to top value=tkinter.simpledialog.askstring(title,msg) root.destroy() return ...
[ "use", "the", "GUI", "to", "ask", "for", "a", "string", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L865-L873
[ "def", "TK_askPassword", "(", "title", "=", "\"input\"", ",", "msg", "=", "\"type here:\"", ")", ":", "root", "=", "tkinter", ".", "Tk", "(", ")", "root", ".", "withdraw", "(", ")", "#hide tk window", "root", ".", "attributes", "(", "\"-topmost\"", ",", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
TK_message
use the GUI to pop up a message.
doc/oldcode/swhlab/core/common.py
def TK_message(title,msg): """use the GUI to pop up a message.""" root = tkinter.Tk() root.withdraw() #hide tk window root.attributes("-topmost", True) #always on top root.lift() #bring to top tkinter.messagebox.showwarning(title, msg) root.destroy()
def TK_message(title,msg): """use the GUI to pop up a message.""" root = tkinter.Tk() root.withdraw() #hide tk window root.attributes("-topmost", True) #always on top root.lift() #bring to top tkinter.messagebox.showwarning(title, msg) root.destroy()
[ "use", "the", "GUI", "to", "pop", "up", "a", "message", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L875-L882
[ "def", "TK_message", "(", "title", ",", "msg", ")", ":", "root", "=", "tkinter", ".", "Tk", "(", ")", "root", ".", "withdraw", "(", ")", "#hide tk window", "root", ".", "attributes", "(", "\"-topmost\"", ",", "True", ")", "#always on top", "root", ".", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
TK_ask
use the GUI to ask YES or NO.
doc/oldcode/swhlab/core/common.py
def TK_ask(title,msg): """use the GUI to ask YES or NO.""" root = tkinter.Tk() root.attributes("-topmost", True) #always on top root.withdraw() #hide tk window result=tkinter.messagebox.askyesno(title,msg) root.destroy() return result
def TK_ask(title,msg): """use the GUI to ask YES or NO.""" root = tkinter.Tk() root.attributes("-topmost", True) #always on top root.withdraw() #hide tk window result=tkinter.messagebox.askyesno(title,msg) root.destroy() return result
[ "use", "the", "GUI", "to", "ask", "YES", "or", "NO", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L884-L891
[ "def", "TK_ask", "(", "title", ",", "msg", ")", ":", "root", "=", "tkinter", ".", "Tk", "(", ")", "root", ".", "attributes", "(", "\"-topmost\"", ",", "True", ")", "#always on top", "root", ".", "withdraw", "(", ")", "#hide tk window", "result", "=", "...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
image_convert
Convert weird TIF files into web-friendly versions. Auto contrast is applied (saturating lower and upper 0.1%). make saveAs True to save as .TIF.png make saveAs False and it won't save at all make saveAs "someFile.jpg" to save it as a different path/format
doc/oldcode/swhlab/core/common.py
def image_convert(fname,saveAs=True,showToo=False): """ Convert weird TIF files into web-friendly versions. Auto contrast is applied (saturating lower and upper 0.1%). make saveAs True to save as .TIF.png make saveAs False and it won't save at all make saveAs "someFile.jpg" to save i...
def image_convert(fname,saveAs=True,showToo=False): """ Convert weird TIF files into web-friendly versions. Auto contrast is applied (saturating lower and upper 0.1%). make saveAs True to save as .TIF.png make saveAs False and it won't save at all make saveAs "someFile.jpg" to save i...
[ "Convert", "weird", "TIF", "files", "into", "web", "-", "friendly", "versions", ".", "Auto", "contrast", "is", "applied", "(", "saturating", "lower", "and", "upper", "0", ".", "1%", ")", ".", "make", "saveAs", "True", "to", "save", "as", ".", "TIF", "....
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/common.py#L896-L937
[ "def", "image_convert", "(", "fname", ",", "saveAs", "=", "True", ",", "showToo", "=", "False", ")", ":", "# load the image", "#im = Image.open(fname) #PIL can't handle 12-bit TIFs well", "im", "=", "scipy", ".", "ndimage", ".", "imread", "(", "fname", ")", "#scip...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
processArgs
check out the arguments and figure out what to do.
swhlab/command.py
def processArgs(): """check out the arguments and figure out what to do.""" if len(sys.argv)<2: print("\n\nERROR:") print("this script requires arguments!") print('try "python command.py info"') return if sys.argv[1]=='info': print("import paths:\n ","\n ".join(sys.p...
def processArgs(): """check out the arguments and figure out what to do.""" if len(sys.argv)<2: print("\n\nERROR:") print("this script requires arguments!") print('try "python command.py info"') return if sys.argv[1]=='info': print("import paths:\n ","\n ".join(sys.p...
[ "check", "out", "the", "arguments", "and", "figure", "out", "what", "to", "do", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/command.py#L23-L64
[ "def", "processArgs", "(", ")", ":", "if", "len", "(", "sys", ".", "argv", ")", "<", "2", ":", "print", "(", "\"\\n\\nERROR:\"", ")", "print", "(", "\"this script requires arguments!\"", ")", "print", "(", "'try \"python command.py info\"'", ")", "return", "if...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
detect
An AP will be detected by a upslope that exceeds 50V/s. Analyzed too. if type(sweep) is int, graph int(sweep) if sweep==None, process all sweeps sweep.
doc/oldcode/swhlab/core/ap.py
def detect(abf,sweep=None,threshold_upslope=50,dT=.1,saveToo=True): """ An AP will be detected by a upslope that exceeds 50V/s. Analyzed too. if type(sweep) is int, graph int(sweep) if sweep==None, process all sweeps sweep. """ if type(sweep) is int: sweeps=[sweep] else: ...
def detect(abf,sweep=None,threshold_upslope=50,dT=.1,saveToo=True): """ An AP will be detected by a upslope that exceeds 50V/s. Analyzed too. if type(sweep) is int, graph int(sweep) if sweep==None, process all sweeps sweep. """ if type(sweep) is int: sweeps=[sweep] else: ...
[ "An", "AP", "will", "be", "detected", "by", "a", "upslope", "that", "exceeds", "50V", "/", "s", ".", "Analyzed", "too", ".", "if", "type", "(", "sweep", ")", "is", "int", "graph", "int", "(", "sweep", ")", "if", "sweep", "==", "None", "process", "a...
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L36-L78
[ "def", "detect", "(", "abf", ",", "sweep", "=", "None", ",", "threshold_upslope", "=", "50", ",", "dT", "=", ".1", ",", "saveToo", "=", "True", ")", ":", "if", "type", "(", "sweep", ")", "is", "int", ":", "sweeps", "=", "[", "sweep", "]", "else",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
analyzeAPgroup
On the current (setSweep()) sweep, calculate things like accomodation. Only call directly just for demonstrating how it works by making a graph. Or call this if you want really custom T1 and T2 (multiple per sweep) This is called by default with default T1 and T2. Manually call it again for custom.
doc/oldcode/swhlab/core/ap.py
def analyzeAPgroup(abf=exampleABF,T1=None,T2=None,plotToo=False): """ On the current (setSweep()) sweep, calculate things like accomodation. Only call directly just for demonstrating how it works by making a graph. Or call this if you want really custom T1 and T2 (multiple per sweep) This is calle...
def analyzeAPgroup(abf=exampleABF,T1=None,T2=None,plotToo=False): """ On the current (setSweep()) sweep, calculate things like accomodation. Only call directly just for demonstrating how it works by making a graph. Or call this if you want really custom T1 and T2 (multiple per sweep) This is calle...
[ "On", "the", "current", "(", "setSweep", "()", ")", "sweep", "calculate", "things", "like", "accomodation", ".", "Only", "call", "directly", "just", "for", "demonstrating", "how", "it", "works", "by", "making", "a", "graph", ".", "Or", "call", "this", "if"...
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L80-L128
[ "def", "analyzeAPgroup", "(", "abf", "=", "exampleABF", ",", "T1", "=", "None", ",", "T2", "=", "None", ",", "plotToo", "=", "False", ")", ":", "if", "T1", "is", "None", "or", "T2", "is", "None", ":", "if", "len", "(", "abf", ".", "protoSeqX", ")...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
check_AP_group
after running detect() and abf.SAP is populated, this checks it.
doc/oldcode/swhlab/core/ap.py
def check_AP_group(abf=exampleABF,sweep=0): """ after running detect() and abf.SAP is populated, this checks it. """ abf.setSweep(sweep) swhlab.plot.new(abf,title="sweep %d (%d pA)"%(abf.currentSweep,abf.protoSeqY[1])) swhlab.plot.sweep(abf) SAP=cm.matrixToDicts(abf.SAP[sweep]) if "T1" i...
def check_AP_group(abf=exampleABF,sweep=0): """ after running detect() and abf.SAP is populated, this checks it. """ abf.setSweep(sweep) swhlab.plot.new(abf,title="sweep %d (%d pA)"%(abf.currentSweep,abf.protoSeqY[1])) swhlab.plot.sweep(abf) SAP=cm.matrixToDicts(abf.SAP[sweep]) if "T1" i...
[ "after", "running", "detect", "()", "and", "abf", ".", "SAP", "is", "populated", "this", "checks", "it", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L130-L151
[ "def", "check_AP_group", "(", "abf", "=", "exampleABF", ",", "sweep", "=", "0", ")", ":", "abf", ".", "setSweep", "(", "sweep", ")", "swhlab", ".", "plot", ".", "new", "(", "abf", ",", "title", "=", "\"sweep %d (%d pA)\"", "%", "(", "abf", ".", "curr...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
analyzeAP
given a sweep and a time point, return the AP array for that AP. APs will be centered in time by their maximum upslope.
doc/oldcode/swhlab/core/ap.py
def analyzeAP(Y,dY,I,rate,verbose=False): """ given a sweep and a time point, return the AP array for that AP. APs will be centered in time by their maximum upslope. """ Ims = int(rate/1000) #Is per MS IsToLook=5*Ims #TODO: clarify this, ms until downslope is over upslope=np.max(dY[I:I+IsToL...
def analyzeAP(Y,dY,I,rate,verbose=False): """ given a sweep and a time point, return the AP array for that AP. APs will be centered in time by their maximum upslope. """ Ims = int(rate/1000) #Is per MS IsToLook=5*Ims #TODO: clarify this, ms until downslope is over upslope=np.max(dY[I:I+IsToL...
[ "given", "a", "sweep", "and", "a", "time", "point", "return", "the", "AP", "array", "for", "that", "AP", ".", "APs", "will", "be", "centered", "in", "time", "by", "their", "maximum", "upslope", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L153-L215
[ "def", "analyzeAP", "(", "Y", ",", "dY", ",", "I", ",", "rate", ",", "verbose", "=", "False", ")", ":", "Ims", "=", "int", "(", "rate", "/", "1000", ")", "#Is per MS", "IsToLook", "=", "5", "*", "Ims", "#TODO: clarify this, ms until downslope is over", "...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
check_sweep
Plotting for an eyeball check of AP detection in the given sweep.
doc/oldcode/swhlab/core/ap.py
def check_sweep(abf,sweep=None,dT=.1): """Plotting for an eyeball check of AP detection in the given sweep.""" if abf.APs is None: APs=[] else: APs=cm.matrixToDicts(abf.APs) if sweep is None or len(sweep)==0: #find the first sweep with >5APs in it for sweepNum in range(abf.sweep...
def check_sweep(abf,sweep=None,dT=.1): """Plotting for an eyeball check of AP detection in the given sweep.""" if abf.APs is None: APs=[] else: APs=cm.matrixToDicts(abf.APs) if sweep is None or len(sweep)==0: #find the first sweep with >5APs in it for sweepNum in range(abf.sweep...
[ "Plotting", "for", "an", "eyeball", "check", "of", "AP", "detection", "in", "the", "given", "sweep", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L217-L268
[ "def", "check_sweep", "(", "abf", ",", "sweep", "=", "None", ",", "dT", "=", ".1", ")", ":", "if", "abf", ".", "APs", "is", "None", ":", "APs", "=", "[", "]", "else", ":", "APs", "=", "cm", ".", "matrixToDicts", "(", "abf", ".", "APs", ")", "...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
get_AP_timepoints
return list of time points (sec) of all AP events in experiment.
doc/oldcode/swhlab/core/ap.py
def get_AP_timepoints(abf): """return list of time points (sec) of all AP events in experiment.""" col=abf.APs.dtype.names.index("expT") timePoints=[] for i in range(len(abf.APs)): timePoints.append(abf.APs[i][col]) return timePoints
def get_AP_timepoints(abf): """return list of time points (sec) of all AP events in experiment.""" col=abf.APs.dtype.names.index("expT") timePoints=[] for i in range(len(abf.APs)): timePoints.append(abf.APs[i][col]) return timePoints
[ "return", "list", "of", "time", "points", "(", "sec", ")", "of", "all", "AP", "events", "in", "experiment", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L270-L276
[ "def", "get_AP_timepoints", "(", "abf", ")", ":", "col", "=", "abf", ".", "APs", ".", "dtype", ".", "names", ".", "index", "(", "\"expT\"", ")", "timePoints", "=", "[", "]", "for", "i", "in", "range", "(", "len", "(", "abf", ".", "APs", ")", ")",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
check_AP_raw
X
doc/oldcode/swhlab/core/ap.py
def check_AP_raw(abf,n=10): """X""" timePoints=get_AP_timepoints(abf)[:n] #first 10 if len(timePoints)==0: return swhlab.plot.new(abf,True,title="AP shape (n=%d)"%n,xlabel="ms") Ys=abf.get_data_around(timePoints,padding=.2) Xs=(np.arange(len(Ys[0]))-len(Ys[0])/2)*1000/abf.rate for i ...
def check_AP_raw(abf,n=10): """X""" timePoints=get_AP_timepoints(abf)[:n] #first 10 if len(timePoints)==0: return swhlab.plot.new(abf,True,title="AP shape (n=%d)"%n,xlabel="ms") Ys=abf.get_data_around(timePoints,padding=.2) Xs=(np.arange(len(Ys[0]))-len(Ys[0])/2)*1000/abf.rate for i ...
[ "X" ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L278-L293
[ "def", "check_AP_raw", "(", "abf", ",", "n", "=", "10", ")", ":", "timePoints", "=", "get_AP_timepoints", "(", "abf", ")", "[", ":", "n", "]", "#first 10", "if", "len", "(", "timePoints", ")", "==", "0", ":", "return", "swhlab", ".", "plot", ".", "...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
check_AP_deriv
X
doc/oldcode/swhlab/core/ap.py
def check_AP_deriv(abf,n=10): """X""" timePoints=get_AP_timepoints(abf)[:10] #first 10 if len(timePoints)==0: return swhlab.plot.new(abf,True,title="AP velocity (n=%d)"%n,xlabel="ms",ylabel="V/S") pylab.axhline(-50,color='r',lw=2,ls="--",alpha=.2) pylab.axhline(-100,color='r',lw=2,ls="--...
def check_AP_deriv(abf,n=10): """X""" timePoints=get_AP_timepoints(abf)[:10] #first 10 if len(timePoints)==0: return swhlab.plot.new(abf,True,title="AP velocity (n=%d)"%n,xlabel="ms",ylabel="V/S") pylab.axhline(-50,color='r',lw=2,ls="--",alpha=.2) pylab.axhline(-100,color='r',lw=2,ls="--...
[ "X" ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L295-L308
[ "def", "check_AP_deriv", "(", "abf", ",", "n", "=", "10", ")", ":", "timePoints", "=", "get_AP_timepoints", "(", "abf", ")", "[", ":", "10", "]", "#first 10", "if", "len", "(", "timePoints", ")", "==", "0", ":", "return", "swhlab", ".", "plot", ".", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
check_AP_phase
X
doc/oldcode/swhlab/core/ap.py
def check_AP_phase(abf,n=10): """X""" timePoints=get_AP_timepoints(abf)[:10] #first 10 if len(timePoints)==0: return swhlab.plot.new(abf,True,title="AP phase (n=%d)"%n,xlabel="mV",ylabel="V/S") Ys=abf.get_data_around(timePoints,msDeriv=.1,padding=.005) Xs=abf.get_data_around(timePoints,p...
def check_AP_phase(abf,n=10): """X""" timePoints=get_AP_timepoints(abf)[:10] #first 10 if len(timePoints)==0: return swhlab.plot.new(abf,True,title="AP phase (n=%d)"%n,xlabel="mV",ylabel="V/S") Ys=abf.get_data_around(timePoints,msDeriv=.1,padding=.005) Xs=abf.get_data_around(timePoints,p...
[ "X" ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L310-L321
[ "def", "check_AP_phase", "(", "abf", ",", "n", "=", "10", ")", ":", "timePoints", "=", "get_AP_timepoints", "(", "abf", ")", "[", ":", "10", "]", "#first 10", "if", "len", "(", "timePoints", ")", "==", "0", ":", "return", "swhlab", ".", "plot", ".", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
stats_first
provide all stats on the first AP.
doc/oldcode/swhlab/core/ap.py
def stats_first(abf): """provide all stats on the first AP.""" msg="" for sweep in range(abf.sweeps): for AP in abf.APs[sweep]: for key in sorted(AP.keys()): if key[-1] is "I" or key[-2:] in ["I1","I2"]: continue msg+="%s = %s\n"%(key,A...
def stats_first(abf): """provide all stats on the first AP.""" msg="" for sweep in range(abf.sweeps): for AP in abf.APs[sweep]: for key in sorted(AP.keys()): if key[-1] is "I" or key[-2:] in ["I1","I2"]: continue msg+="%s = %s\n"%(key,A...
[ "provide", "all", "stats", "on", "the", "first", "AP", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L323-L332
[ "def", "stats_first", "(", "abf", ")", ":", "msg", "=", "\"\"", "for", "sweep", "in", "range", "(", "abf", ".", "sweeps", ")", ":", "for", "AP", "in", "abf", ".", "APs", "[", "sweep", "]", ":", "for", "key", "in", "sorted", "(", "AP", ".", "key...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
get_values
returns Xs, Ys (the key), and sweep #s for every AP found.
doc/oldcode/swhlab/core/ap.py
def get_values(abf,key="freq",continuous=False): """returns Xs, Ys (the key), and sweep #s for every AP found.""" Xs,Ys,Ss=[],[],[] for sweep in range(abf.sweeps): for AP in cm.matrixToDicts(abf.APs): if not AP["sweep"]==sweep: continue Ys.append(AP[key]) ...
def get_values(abf,key="freq",continuous=False): """returns Xs, Ys (the key), and sweep #s for every AP found.""" Xs,Ys,Ss=[],[],[] for sweep in range(abf.sweeps): for AP in cm.matrixToDicts(abf.APs): if not AP["sweep"]==sweep: continue Ys.append(AP[key]) ...
[ "returns", "Xs", "Ys", "(", "the", "key", ")", "and", "sweep", "#s", "for", "every", "AP", "found", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L334-L348
[ "def", "get_values", "(", "abf", ",", "key", "=", "\"freq\"", ",", "continuous", "=", "False", ")", ":", "Xs", ",", "Ys", ",", "Ss", "=", "[", "]", ",", "[", "]", ",", "[", "]", "for", "sweep", "in", "range", "(", "abf", ".", "sweeps", ")", "...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
getAvgBySweep
return average of a feature divided by sweep.
doc/oldcode/swhlab/core/ap.py
def getAvgBySweep(abf,feature,T0=None,T1=None): """return average of a feature divided by sweep.""" if T1 is None: T1=abf.sweepLength if T0 is None: T0=0 data = [np.empty((0))]*abf.sweeps for AP in cm.dictFlat(cm.matrixToDicts(abf.APs)): if T0<AP['sweepT']<T1: val...
def getAvgBySweep(abf,feature,T0=None,T1=None): """return average of a feature divided by sweep.""" if T1 is None: T1=abf.sweepLength if T0 is None: T0=0 data = [np.empty((0))]*abf.sweeps for AP in cm.dictFlat(cm.matrixToDicts(abf.APs)): if T0<AP['sweepT']<T1: val...
[ "return", "average", "of", "a", "feature", "divided", "by", "sweep", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/ap.py#L363-L381
[ "def", "getAvgBySweep", "(", "abf", ",", "feature", ",", "T0", "=", "None", ",", "T1", "=", "None", ")", ":", "if", "T1", "is", "None", ":", "T1", "=", "abf", ".", "sweepLength", "if", "T0", "is", "None", ":", "T0", "=", "0", "data", "=", "[", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
readLog
return a list of [stamp, project] elements.
swhlab/tools/project log/analyze.py
def readLog(fname="workdays.csv",onlyAfter=datetime.datetime(year=2017,month=1,day=1)): """return a list of [stamp, project] elements.""" with open(fname) as f: raw=f.read().split("\n") efforts=[] #date,nickname for line in raw[1:]: line=line.strip().split(",") date=dateti...
def readLog(fname="workdays.csv",onlyAfter=datetime.datetime(year=2017,month=1,day=1)): """return a list of [stamp, project] elements.""" with open(fname) as f: raw=f.read().split("\n") efforts=[] #date,nickname for line in raw[1:]: line=line.strip().split(",") date=dateti...
[ "return", "a", "list", "of", "[", "stamp", "project", "]", "elements", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/tools/project log/analyze.py#L5-L21
[ "def", "readLog", "(", "fname", "=", "\"workdays.csv\"", ",", "onlyAfter", "=", "datetime", ".", "datetime", "(", "year", "=", "2017", ",", "month", "=", "1", ",", "day", "=", "1", ")", ")", ":", "with", "open", "(", "fname", ")", "as", "f", ":", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
waitTillCopied
sometimes a huge file takes several seconds to copy over. This will hang until the file is copied (file size is stable).
doc/oldcode/indexing/monitor.py
def waitTillCopied(fname): """ sometimes a huge file takes several seconds to copy over. This will hang until the file is copied (file size is stable). """ lastSize=0 while True: thisSize=os.path.getsize(fname) print("size:",thisSize) if lastSize==thisSize: pr...
def waitTillCopied(fname): """ sometimes a huge file takes several seconds to copy over. This will hang until the file is copied (file size is stable). """ lastSize=0 while True: thisSize=os.path.getsize(fname) print("size:",thisSize) if lastSize==thisSize: pr...
[ "sometimes", "a", "huge", "file", "takes", "several", "seconds", "to", "copy", "over", ".", "This", "will", "hang", "until", "the", "file", "is", "copied", "(", "file", "size", "is", "stable", ")", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/monitor.py#L12-L26
[ "def", "waitTillCopied", "(", "fname", ")", ":", "lastSize", "=", "0", "while", "True", ":", "thisSize", "=", "os", ".", "path", ".", "getsize", "(", "fname", ")", "print", "(", "\"size:\"", ",", "thisSize", ")", "if", "lastSize", "==", "thisSize", ":"...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
lazygo
continuously monitor a folder for new abfs and try to analyze them. This is intended to watch only one folder, but can run multiple copies.
doc/oldcode/indexing/monitor.py
def lazygo(watchFolder='../abfs/',reAnalyze=False,rebuildSite=False, keepGoing=True,matching=False): """ continuously monitor a folder for new abfs and try to analyze them. This is intended to watch only one folder, but can run multiple copies. """ abfsKnown=[] while True: pr...
def lazygo(watchFolder='../abfs/',reAnalyze=False,rebuildSite=False, keepGoing=True,matching=False): """ continuously monitor a folder for new abfs and try to analyze them. This is intended to watch only one folder, but can run multiple copies. """ abfsKnown=[] while True: pr...
[ "continuously", "monitor", "a", "folder", "for", "new", "abfs", "and", "try", "to", "analyze", "them", ".", "This", "is", "intended", "to", "watch", "only", "one", "folder", "but", "can", "run", "multiple", "copies", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/monitor.py#L33-L66
[ "def", "lazygo", "(", "watchFolder", "=", "'../abfs/'", ",", "reAnalyze", "=", "False", ",", "rebuildSite", "=", "False", ",", "keepGoing", "=", "True", ",", "matching", "=", "False", ")", ":", "abfsKnown", "=", "[", "]", "while", "True", ":", "print", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABF2.phasicTonic
chunkMs should be ~50 ms or greater. bin sizes must be equal to or multiples of the data resolution. transients smaller than the expected RMS will be silenced.
doc/uses/EPSCs-and-IPSCs/variance method/2016-12-17 02 graphTime.py
def phasicTonic(self,m1=None,m2=None,chunkMs=50,quietPercentile=10, histResolution=.5,plotToo=False,rmsExpected=5): """ chunkMs should be ~50 ms or greater. bin sizes must be equal to or multiples of the data resolution. transients smaller than the expected RMS will ...
def phasicTonic(self,m1=None,m2=None,chunkMs=50,quietPercentile=10, histResolution=.5,plotToo=False,rmsExpected=5): """ chunkMs should be ~50 ms or greater. bin sizes must be equal to or multiples of the data resolution. transients smaller than the expected RMS will ...
[ "chunkMs", "should", "be", "~50", "ms", "or", "greater", ".", "bin", "sizes", "must", "be", "equal", "to", "or", "multiples", "of", "the", "data", "resolution", ".", "transients", "smaller", "than", "the", "expected", "RMS", "will", "be", "silenced", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/uses/EPSCs-and-IPSCs/variance method/2016-12-17 02 graphTime.py#L12-L64
[ "def", "phasicTonic", "(", "self", ",", "m1", "=", "None", ",", "m2", "=", "None", ",", "chunkMs", "=", "50", ",", "quietPercentile", "=", "10", ",", "histResolution", "=", ".5", ",", "plotToo", "=", "False", ",", "rmsExpected", "=", "5", ")", ":", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
values_above_sweep
To make plots like AP frequency over original trace. dataI=[i] #the i of the sweep dataY=[1.234] #something like inst freq
doc/oldcode/swhlab/core/plot.py
def values_above_sweep(abf,dataI,dataY,ylabel="",useFigure=None): """ To make plots like AP frequency over original trace. dataI=[i] #the i of the sweep dataY=[1.234] #something like inst freq """ xOffset = abf.currentSweep*abf.sweepInterval if not useFigure: #just passing the figure makes i...
def values_above_sweep(abf,dataI,dataY,ylabel="",useFigure=None): """ To make plots like AP frequency over original trace. dataI=[i] #the i of the sweep dataY=[1.234] #something like inst freq """ xOffset = abf.currentSweep*abf.sweepInterval if not useFigure: #just passing the figure makes i...
[ "To", "make", "plots", "like", "AP", "frequency", "over", "original", "trace", ".", "dataI", "=", "[", "i", "]", "#the", "i", "of", "the", "sweep", "dataY", "=", "[", "1", ".", "234", "]", "#something", "like", "inst", "freq" ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/plot.py#L48-L84
[ "def", "values_above_sweep", "(", "abf", ",", "dataI", ",", "dataY", ",", "ylabel", "=", "\"\"", ",", "useFigure", "=", "None", ")", ":", "xOffset", "=", "abf", ".", "currentSweep", "*", "abf", ".", "sweepInterval", "if", "not", "useFigure", ":", "#just ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
gain
easy way to plot a gain function.
doc/oldcode/swhlab/core/plot.py
def gain(abf): """easy way to plot a gain function.""" Ys=np.nan_to_num(swhlab.ap.getAvgBySweep(abf,'freq')) Xs=abf.clampValues(abf.dataX[int(abf.protoSeqX[1]+.01)]) swhlab.plot.new(abf,title="gain function",xlabel="command current (pA)", ylabel="average inst. freq. (Hz)") pylab....
def gain(abf): """easy way to plot a gain function.""" Ys=np.nan_to_num(swhlab.ap.getAvgBySweep(abf,'freq')) Xs=abf.clampValues(abf.dataX[int(abf.protoSeqX[1]+.01)]) swhlab.plot.new(abf,title="gain function",xlabel="command current (pA)", ylabel="average inst. freq. (Hz)") pylab....
[ "easy", "way", "to", "plot", "a", "gain", "function", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/plot.py#L86-L94
[ "def", "gain", "(", "abf", ")", ":", "Ys", "=", "np", ".", "nan_to_num", "(", "swhlab", ".", "ap", ".", "getAvgBySweep", "(", "abf", ",", "'freq'", ")", ")", "Xs", "=", "abf", ".", "clampValues", "(", "abf", ".", "dataX", "[", "int", "(", "abf", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
IV
Given two time points (seconds) return IV data. Optionally plots a fancy graph (with errorbars) Returns [[AV],[SD]] for the given range.
doc/oldcode/swhlab/core/plot.py
def IV(abf,T1,T2,plotToo=True,color='b'): """ Given two time points (seconds) return IV data. Optionally plots a fancy graph (with errorbars) Returns [[AV],[SD]] for the given range. """ rangeData=abf.average_data([[T1,T2]]) #get the average data per sweep AV,SD=rangeData[:,0,0],rangeData[:,...
def IV(abf,T1,T2,plotToo=True,color='b'): """ Given two time points (seconds) return IV data. Optionally plots a fancy graph (with errorbars) Returns [[AV],[SD]] for the given range. """ rangeData=abf.average_data([[T1,T2]]) #get the average data per sweep AV,SD=rangeData[:,0,0],rangeData[:,...
[ "Given", "two", "time", "points", "(", "seconds", ")", "return", "IV", "data", ".", "Optionally", "plots", "a", "fancy", "graph", "(", "with", "errorbars", ")", "Returns", "[[", "AV", "]", "[", "SD", "]]", "for", "the", "given", "range", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/plot.py#L96-L152
[ "def", "IV", "(", "abf", ",", "T1", ",", "T2", ",", "plotToo", "=", "True", ",", "color", "=", "'b'", ")", ":", "rangeData", "=", "abf", ".", "average_data", "(", "[", "[", "T1", ",", "T2", "]", "]", ")", "#get the average data per sweep", "AV", ",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
comments
draw vertical lines at comment points. Defaults to seconds.
doc/oldcode/swhlab/core/plot.py
def comments(abf,minutes=False): """draw vertical lines at comment points. Defaults to seconds.""" if not len(abf.commentTimes): return for i in range(len(abf.commentTimes)): t,c = abf.commentTimes[i],abf.commentTags[i] if minutes: t=t/60 pylab.axvline(t,lw=1,colo...
def comments(abf,minutes=False): """draw vertical lines at comment points. Defaults to seconds.""" if not len(abf.commentTimes): return for i in range(len(abf.commentTimes)): t,c = abf.commentTimes[i],abf.commentTags[i] if minutes: t=t/60 pylab.axvline(t,lw=1,colo...
[ "draw", "vertical", "lines", "at", "comment", "points", ".", "Defaults", "to", "seconds", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/plot.py#L154-L170
[ "def", "comments", "(", "abf", ",", "minutes", "=", "False", ")", ":", "if", "not", "len", "(", "abf", ".", "commentTimes", ")", ":", "return", "for", "i", "in", "range", "(", "len", "(", "abf", ".", "commentTimes", ")", ")", ":", "t", ",", "c", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
dual
Plot two channels of current sweep (top/bottom).
doc/oldcode/swhlab/core/plot.py
def dual(ABF): """Plot two channels of current sweep (top/bottom).""" new(ABF) pylab.subplot(211) pylab.title("Input A (channel 0)") ABF.channel=0 sweep(ABF) pylab.subplot(212) pylab.title("Input B (channel 1)") ABF.channel=1 sweep(ABF)
def dual(ABF): """Plot two channels of current sweep (top/bottom).""" new(ABF) pylab.subplot(211) pylab.title("Input A (channel 0)") ABF.channel=0 sweep(ABF) pylab.subplot(212) pylab.title("Input B (channel 1)") ABF.channel=1 sweep(ABF)
[ "Plot", "two", "channels", "of", "current", "sweep", "(", "top", "/", "bottom", ")", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/plot.py#L196-L206
[ "def", "dual", "(", "ABF", ")", ":", "new", "(", "ABF", ")", "pylab", ".", "subplot", "(", "211", ")", "pylab", ".", "title", "(", "\"Input A (channel 0)\"", ")", "ABF", ".", "channel", "=", "0", "sweep", "(", "ABF", ")", "pylab", ".", "subplot", "...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
sweep
Load a particular sweep then plot it. If sweep is None or False, just plot current dataX/dataY. If rainbow, it'll make it color coded prettily.
doc/oldcode/swhlab/core/plot.py
def sweep(ABF,sweep=None,rainbow=True,alpha=None,protocol=False,color='b', continuous=False,offsetX=0,offsetY=0,minutes=False, decimate=None,newFigure=False): """ Load a particular sweep then plot it. If sweep is None or False, just plot current dataX/dataY. If rainbow, it'...
def sweep(ABF,sweep=None,rainbow=True,alpha=None,protocol=False,color='b', continuous=False,offsetX=0,offsetY=0,minutes=False, decimate=None,newFigure=False): """ Load a particular sweep then plot it. If sweep is None or False, just plot current dataX/dataY. If rainbow, it'...
[ "Load", "a", "particular", "sweep", "then", "plot", "it", ".", "If", "sweep", "is", "None", "or", "False", "just", "plot", "current", "dataX", "/", "dataY", ".", "If", "rainbow", "it", "ll", "make", "it", "color", "coded", "prettily", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/plot.py#L209-L273
[ "def", "sweep", "(", "ABF", ",", "sweep", "=", "None", ",", "rainbow", "=", "True", ",", "alpha", "=", "None", ",", "protocol", "=", "False", ",", "color", "=", "'b'", ",", "continuous", "=", "False", ",", "offsetX", "=", "0", ",", "offsetY", "=", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
annotate
stamp the bottom with file info.
doc/oldcode/swhlab/core/plot.py
def annotate(abf): """stamp the bottom with file info.""" msg="SWHLab %s "%str(swhlab.VERSION) msg+="ID:%s "%abf.ID msg+="CH:%d "%abf.channel msg+="PROTOCOL:%s "%abf.protoComment msg+="COMMAND: %d%s "%(abf.holding,abf.units) msg+="GENERATED:%s "%'{0:%Y-%m-%d %H:%M:%S}'.format(datetime.dateti...
def annotate(abf): """stamp the bottom with file info.""" msg="SWHLab %s "%str(swhlab.VERSION) msg+="ID:%s "%abf.ID msg+="CH:%d "%abf.channel msg+="PROTOCOL:%s "%abf.protoComment msg+="COMMAND: %d%s "%(abf.holding,abf.units) msg+="GENERATED:%s "%'{0:%Y-%m-%d %H:%M:%S}'.format(datetime.dateti...
[ "stamp", "the", "bottom", "with", "file", "info", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/plot.py#L275-L290
[ "def", "annotate", "(", "abf", ")", ":", "msg", "=", "\"SWHLab %s \"", "%", "str", "(", "swhlab", ".", "VERSION", ")", "msg", "+=", "\"ID:%s \"", "%", "abf", ".", "ID", "msg", "+=", "\"CH:%d \"", "%", "abf", ".", "channel", "msg", "+=", "\"PROTOCOL:%s ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
new
makes a new matplotlib figure with default dims and DPI. Also labels it with pA or mV depending on ABF.
doc/oldcode/swhlab/core/plot.py
def new(ABF,forceNewFigure=False,title=None,xlabel=None,ylabel=None): """ makes a new matplotlib figure with default dims and DPI. Also labels it with pA or mV depending on ABF. """ if len(pylab.get_fignums()) and forceNewFigure==False: #print("adding to existing figure") return ...
def new(ABF,forceNewFigure=False,title=None,xlabel=None,ylabel=None): """ makes a new matplotlib figure with default dims and DPI. Also labels it with pA or mV depending on ABF. """ if len(pylab.get_fignums()) and forceNewFigure==False: #print("adding to existing figure") return ...
[ "makes", "a", "new", "matplotlib", "figure", "with", "default", "dims", "and", "DPI", ".", "Also", "labels", "it", "with", "pA", "or", "mV", "depending", "on", "ABF", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/plot.py#L292-L311
[ "def", "new", "(", "ABF", ",", "forceNewFigure", "=", "False", ",", "title", "=", "None", ",", "xlabel", "=", "None", ",", "ylabel", "=", "None", ")", ":", "if", "len", "(", "pylab", ".", "get_fignums", "(", ")", ")", "and", "forceNewFigure", "==", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
save
Save the pylab figure somewhere. If fname==False, show it instead. Height force > dpi force if a tag is given instead of a filename, save it alongside the ABF
doc/oldcode/swhlab/core/plot.py
def save(abf,fname=None,tag=None,width=700,close=True,facecolor='w', resize=True): """ Save the pylab figure somewhere. If fname==False, show it instead. Height force > dpi force if a tag is given instead of a filename, save it alongside the ABF """ if len(pylab.gca().get_lines...
def save(abf,fname=None,tag=None,width=700,close=True,facecolor='w', resize=True): """ Save the pylab figure somewhere. If fname==False, show it instead. Height force > dpi force if a tag is given instead of a filename, save it alongside the ABF """ if len(pylab.gca().get_lines...
[ "Save", "the", "pylab", "figure", "somewhere", ".", "If", "fname", "==", "False", "show", "it", "instead", ".", "Height", "force", ">", "dpi", "force", "if", "a", "tag", "is", "given", "instead", "of", "a", "filename", "save", "it", "alongside", "the", ...
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/swhlab/core/plot.py#L317-L344
[ "def", "save", "(", "abf", ",", "fname", "=", "None", ",", "tag", "=", "None", ",", "width", "=", "700", ",", "close", "=", "True", ",", "facecolor", "=", "'w'", ",", "resize", "=", "True", ")", ":", "if", "len", "(", "pylab", ".", "gca", "(", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
tryLoadingFrom
if the module is in this path, load it from the local folder.
swhlab/__init__.py
def tryLoadingFrom(tryPath,moduleName='swhlab'): """if the module is in this path, load it from the local folder.""" if not 'site-packages' in swhlab.__file__: print("loaded custom swhlab module from", os.path.dirname(swhlab.__file__)) return # no need to warn if it's already outsi...
def tryLoadingFrom(tryPath,moduleName='swhlab'): """if the module is in this path, load it from the local folder.""" if not 'site-packages' in swhlab.__file__: print("loaded custom swhlab module from", os.path.dirname(swhlab.__file__)) return # no need to warn if it's already outsi...
[ "if", "the", "module", "is", "in", "this", "path", "load", "it", "from", "the", "local", "folder", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/__init__.py#L19-L34
[ "def", "tryLoadingFrom", "(", "tryPath", ",", "moduleName", "=", "'swhlab'", ")", ":", "if", "not", "'site-packages'", "in", "swhlab", ".", "__file__", ":", "print", "(", "\"loaded custom swhlab module from\"", ",", "os", ".", "path", ".", "dirname", "(", "swh...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
DynamicArgs.update
Called to update the state of the iterator. This methods receives the set of task ids from the previous set of tasks together with the launch information to allow the output values to be parsed using the output_extractor. This data is then used to determine the next desired point in the...
lancet/dynamic.py
def update(self, tids, info): """ Called to update the state of the iterator. This methods receives the set of task ids from the previous set of tasks together with the launch information to allow the output values to be parsed using the output_extractor. This data is then ...
def update(self, tids, info): """ Called to update the state of the iterator. This methods receives the set of task ids from the previous set of tasks together with the launch information to allow the output values to be parsed using the output_extractor. This data is then ...
[ "Called", "to", "update", "the", "state", "of", "the", "iterator", ".", "This", "methods", "receives", "the", "set", "of", "task", "ids", "from", "the", "previous", "set", "of", "tasks", "together", "with", "the", "launch", "information", "to", "allow", "t...
ioam/lancet
python
https://github.com/ioam/lancet/blob/1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e/lancet/dynamic.py#L80-L105
[ "def", "update", "(", "self", ",", "tids", ",", "info", ")", ":", "outputs_dir", "=", "os", ".", "path", ".", "join", "(", "info", "[", "'root_directory'", "]", ",", "'streams'", ")", "pattern", "=", "'%s_*_tid_*{tid}.o.{tid}*'", "%", "info", "[", "'batc...
1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e
valid
DynamicArgs.show
When dynamic, not all argument values may be available.
lancet/dynamic.py
def show(self): """ When dynamic, not all argument values may be available. """ copied = self.copy() enumerated = [el for el in enumerate(copied)] for (group_ind, specs) in enumerated: if len(enumerated) > 1: print("Group %d" % group_ind) ordering ...
def show(self): """ When dynamic, not all argument values may be available. """ copied = self.copy() enumerated = [el for el in enumerate(copied)] for (group_ind, specs) in enumerated: if len(enumerated) > 1: print("Group %d" % group_ind) ordering ...
[ "When", "dynamic", "not", "all", "argument", "values", "may", "be", "available", "." ]
ioam/lancet
python
https://github.com/ioam/lancet/blob/1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e/lancet/dynamic.py#L108-L121
[ "def", "show", "(", "self", ")", ":", "copied", "=", "self", ".", "copy", "(", ")", "enumerated", "=", "[", "el", "for", "el", "in", "enumerate", "(", "copied", ")", "]", "for", "(", "group_ind", ",", "specs", ")", "in", "enumerated", ":", "if", ...
1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e
valid
DynamicArgs._trace_summary
Summarizes the trace of values used to update the DynamicArgs and the arguments subsequently returned. May be used to implement the summary method.
lancet/dynamic.py
def _trace_summary(self): """ Summarizes the trace of values used to update the DynamicArgs and the arguments subsequently returned. May be used to implement the summary method. """ for (i, (val, args)) in enumerate(self.trace): if args is StopIteration: ...
def _trace_summary(self): """ Summarizes the trace of values used to update the DynamicArgs and the arguments subsequently returned. May be used to implement the summary method. """ for (i, (val, args)) in enumerate(self.trace): if args is StopIteration: ...
[ "Summarizes", "the", "trace", "of", "values", "used", "to", "update", "the", "DynamicArgs", "and", "the", "arguments", "subsequently", "returned", ".", "May", "be", "used", "to", "implement", "the", "summary", "method", "." ]
ioam/lancet
python
https://github.com/ioam/lancet/blob/1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e/lancet/dynamic.py#L124-L139
[ "def", "_trace_summary", "(", "self", ")", ":", "for", "(", "i", ",", "(", "val", ",", "args", ")", ")", "in", "enumerate", "(", "self", ".", "trace", ")", ":", "if", "args", "is", "StopIteration", ":", "info", "=", "\"Terminated\"", "else", ":", "...
1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e
valid
SimpleGradientDescent._update_state
Takes as input a list or tuple of two elements. First the value returned by incrementing by 'stepsize' followed by the value returned after a 'stepsize' decrement.
lancet/dynamic.py
def _update_state(self, vals): """ Takes as input a list or tuple of two elements. First the value returned by incrementing by 'stepsize' followed by the value returned after a 'stepsize' decrement. """ self._steps_complete += 1 if self._steps_complete == self.max...
def _update_state(self, vals): """ Takes as input a list or tuple of two elements. First the value returned by incrementing by 'stepsize' followed by the value returned after a 'stepsize' decrement. """ self._steps_complete += 1 if self._steps_complete == self.max...
[ "Takes", "as", "input", "a", "list", "or", "tuple", "of", "two", "elements", ".", "First", "the", "value", "returned", "by", "incrementing", "by", "stepsize", "followed", "by", "the", "value", "returned", "after", "a", "stepsize", "decrement", "." ]
ioam/lancet
python
https://github.com/ioam/lancet/blob/1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e/lancet/dynamic.py#L228-L248
[ "def", "_update_state", "(", "self", ",", "vals", ")", ":", "self", ".", "_steps_complete", "+=", "1", "if", "self", ".", "_steps_complete", "==", "self", ".", "max_steps", ":", "self", ".", "_termination_info", "=", "(", "False", ",", "self", ".", "_bes...
1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e
valid
proto_unknown
protocol: unknown.
swhlab/analysis/protocols.py
def proto_unknown(theABF): """protocol: unknown.""" abf=ABF(theABF) abf.log.info("analyzing as an unknown protocol") plot=ABFplot(abf) plot.rainbow=False plot.title=None plot.figure_height,plot.figure_width=SQUARESIZE,SQUARESIZE plot.kwargs["lw"]=.5 plot.figure_chronological() pl...
def proto_unknown(theABF): """protocol: unknown.""" abf=ABF(theABF) abf.log.info("analyzing as an unknown protocol") plot=ABFplot(abf) plot.rainbow=False plot.title=None plot.figure_height,plot.figure_width=SQUARESIZE,SQUARESIZE plot.kwargs["lw"]=.5 plot.figure_chronological() pl...
[ "protocol", ":", "unknown", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L43-L54
[ "def", "proto_unknown", "(", "theABF", ")", ":", "abf", "=", "ABF", "(", "theABF", ")", "abf", ".", "log", ".", "info", "(", "\"analyzing as an unknown protocol\"", ")", "plot", "=", "ABFplot", "(", "abf", ")", "plot", ".", "rainbow", "=", "False", "plot...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_0111
protocol: IC ramp for AP shape analysis.
swhlab/analysis/protocols.py
def proto_0111(theABF): """protocol: IC ramp for AP shape analysis.""" abf=ABF(theABF) abf.log.info("analyzing as an IC ramp") # AP detection ap=AP(abf) ap.detect() # also calculate derivative for each sweep abf.derivative=True # create the multi-plot figure plt.figure(figsize...
def proto_0111(theABF): """protocol: IC ramp for AP shape analysis.""" abf=ABF(theABF) abf.log.info("analyzing as an IC ramp") # AP detection ap=AP(abf) ap.detect() # also calculate derivative for each sweep abf.derivative=True # create the multi-plot figure plt.figure(figsize...
[ "protocol", ":", "IC", "ramp", "for", "AP", "shape", "analysis", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L82-L134
[ "def", "proto_0111", "(", "theABF", ")", ":", "abf", "=", "ABF", "(", "theABF", ")", "abf", ".", "log", ".", "info", "(", "\"analyzing as an IC ramp\"", ")", "# AP detection", "ap", "=", "AP", "(", "abf", ")", "ap", ".", "detect", "(", ")", "# also cal...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_gain
protocol: gain function of some sort. step size and start at are pA.
swhlab/analysis/protocols.py
def proto_gain(theABF,stepSize=25,startAt=-100): """protocol: gain function of some sort. step size and start at are pA.""" abf=ABF(theABF) abf.log.info("analyzing as an IC ramp") plot=ABFplot(abf) plot.kwargs["lw"]=.5 plot.title="" currents=np.arange(abf.sweeps)*stepSize-startAt # AP d...
def proto_gain(theABF,stepSize=25,startAt=-100): """protocol: gain function of some sort. step size and start at are pA.""" abf=ABF(theABF) abf.log.info("analyzing as an IC ramp") plot=ABFplot(abf) plot.kwargs["lw"]=.5 plot.title="" currents=np.arange(abf.sweeps)*stepSize-startAt # AP d...
[ "protocol", ":", "gain", "function", "of", "some", "sort", ".", "step", "size", "and", "start", "at", "are", "pA", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L136-L211
[ "def", "proto_gain", "(", "theABF", ",", "stepSize", "=", "25", ",", "startAt", "=", "-", "100", ")", ":", "abf", "=", "ABF", "(", "theABF", ")", "abf", ".", "log", ".", "info", "(", "\"analyzing as an IC ramp\"", ")", "plot", "=", "ABFplot", "(", "a...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_0201
protocol: membrane test.
swhlab/analysis/protocols.py
def proto_0201(theABF): """protocol: membrane test.""" abf=ABF(theABF) abf.log.info("analyzing as a membrane test") plot=ABFplot(abf) plot.figure_height,plot.figure_width=SQUARESIZE/2,SQUARESIZE/2 plot.figure_sweeps() # save it plt.tight_layout() frameAndSave(abf,"membrane test") ...
def proto_0201(theABF): """protocol: membrane test.""" abf=ABF(theABF) abf.log.info("analyzing as a membrane test") plot=ABFplot(abf) plot.figure_height,plot.figure_width=SQUARESIZE/2,SQUARESIZE/2 plot.figure_sweeps() # save it plt.tight_layout() frameAndSave(abf,"membrane test") ...
[ "protocol", ":", "membrane", "test", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L225-L236
[ "def", "proto_0201", "(", "theABF", ")", ":", "abf", "=", "ABF", "(", "theABF", ")", "abf", ".", "log", ".", "info", "(", "\"analyzing as a membrane test\"", ")", "plot", "=", "ABFplot", "(", "abf", ")", "plot", ".", "figure_height", ",", "plot", ".", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_0202
protocol: MTIV.
swhlab/analysis/protocols.py
def proto_0202(theABF): """protocol: MTIV.""" abf=ABF(theABF) abf.log.info("analyzing as MTIV") plot=ABFplot(abf) plot.figure_height,plot.figure_width=SQUARESIZE,SQUARESIZE plot.title="" plot.kwargs["alpha"]=.6 plot.figure_sweeps() # frame to uppwer/lower bounds, ignoring peaks from...
def proto_0202(theABF): """protocol: MTIV.""" abf=ABF(theABF) abf.log.info("analyzing as MTIV") plot=ABFplot(abf) plot.figure_height,plot.figure_width=SQUARESIZE,SQUARESIZE plot.title="" plot.kwargs["alpha"]=.6 plot.figure_sweeps() # frame to uppwer/lower bounds, ignoring peaks from...
[ "protocol", ":", "MTIV", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L238-L257
[ "def", "proto_0202", "(", "theABF", ")", ":", "abf", "=", "ABF", "(", "theABF", ")", "abf", ".", "log", ".", "info", "(", "\"analyzing as MTIV\"", ")", "plot", "=", "ABFplot", "(", "abf", ")", "plot", ".", "figure_height", ",", "plot", ".", "figure_wid...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_0203
protocol: vast IV.
swhlab/analysis/protocols.py
def proto_0203(theABF): """protocol: vast IV.""" abf=ABF(theABF) abf.log.info("analyzing as a fast IV") plot=ABFplot(abf) plot.title="" m1,m2=.7,1 plt.figure(figsize=(SQUARESIZE,SQUARESIZE/2)) plt.subplot(121) plot.figure_sweeps() plt.axvspan(m1,m2,color='r',ec=None,alpha=.1) ...
def proto_0203(theABF): """protocol: vast IV.""" abf=ABF(theABF) abf.log.info("analyzing as a fast IV") plot=ABFplot(abf) plot.title="" m1,m2=.7,1 plt.figure(figsize=(SQUARESIZE,SQUARESIZE/2)) plt.subplot(121) plot.figure_sweeps() plt.axvspan(m1,m2,color='r',ec=None,alpha=.1) ...
[ "protocol", ":", "vast", "IV", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L259-L288
[ "def", "proto_0203", "(", "theABF", ")", ":", "abf", "=", "ABF", "(", "theABF", ")", "abf", ".", "log", ".", "info", "(", "\"analyzing as a fast IV\"", ")", "plot", "=", "ABFplot", "(", "abf", ")", "plot", ".", "title", "=", "\"\"", "m1", ",", "m2", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_0303
protocol: repeated IC ramps.
swhlab/analysis/protocols.py
def proto_0303(theABF): """protocol: repeated IC ramps.""" abf=ABF(theABF) abf.log.info("analyzing as a halorhodopsin (2s pulse)") # show average voltage proto_avgRange(theABF,0.2,1.2) plt.close('all') # show stacked sweeps plt.figure(figsize=(8,8)) for sweep in abf.setsweeps(): ...
def proto_0303(theABF): """protocol: repeated IC ramps.""" abf=ABF(theABF) abf.log.info("analyzing as a halorhodopsin (2s pulse)") # show average voltage proto_avgRange(theABF,0.2,1.2) plt.close('all') # show stacked sweeps plt.figure(figsize=(8,8)) for sweep in abf.setsweeps(): ...
[ "protocol", ":", "repeated", "IC", "ramps", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L316-L370
[ "def", "proto_0303", "(", "theABF", ")", ":", "abf", "=", "ABF", "(", "theABF", ")", "abf", ".", "log", ".", "info", "(", "\"analyzing as a halorhodopsin (2s pulse)\"", ")", "# show average voltage", "proto_avgRange", "(", "theABF", ",", "0.2", ",", "1.2", ")"...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_0304
protocol: repeated IC steps.
swhlab/analysis/protocols.py
def proto_0304(theABF): """protocol: repeated IC steps.""" abf=ABF(theABF) abf.log.info("analyzing as repeated current-clamp step") # prepare for AP analysis ap=AP(abf) # calculate rest potential avgVoltagePerSweep = []; times = [] for sweep in abf.setsweeps(): avgVoltageP...
def proto_0304(theABF): """protocol: repeated IC steps.""" abf=ABF(theABF) abf.log.info("analyzing as repeated current-clamp step") # prepare for AP analysis ap=AP(abf) # calculate rest potential avgVoltagePerSweep = []; times = [] for sweep in abf.setsweeps(): avgVoltageP...
[ "protocol", ":", "repeated", "IC", "steps", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L372-L424
[ "def", "proto_0304", "(", "theABF", ")", ":", "abf", "=", "ABF", "(", "theABF", ")", "abf", ".", "log", ".", "info", "(", "\"analyzing as repeated current-clamp step\"", ")", "# prepare for AP analysis", "ap", "=", "AP", "(", "abf", ")", "# calculate rest potent...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_avgRange
experiment: generic VC time course experiment.
swhlab/analysis/protocols.py
def proto_avgRange(theABF,m1=None,m2=None): """experiment: generic VC time course experiment.""" abf=ABF(theABF) abf.log.info("analyzing as a fast IV") if m1 is None: m1=abf.sweepLength if m2 is None: m2=abf.sweepLength I1=int(abf.pointsPerSec*m1) I2=int(abf.pointsPerSec*m2...
def proto_avgRange(theABF,m1=None,m2=None): """experiment: generic VC time course experiment.""" abf=ABF(theABF) abf.log.info("analyzing as a fast IV") if m1 is None: m1=abf.sweepLength if m2 is None: m2=abf.sweepLength I1=int(abf.pointsPerSec*m1) I2=int(abf.pointsPerSec*m2...
[ "experiment", ":", "generic", "VC", "time", "course", "experiment", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L718-L774
[ "def", "proto_avgRange", "(", "theABF", ",", "m1", "=", "None", ",", "m2", "=", "None", ")", ":", "abf", "=", "ABF", "(", "theABF", ")", "abf", ".", "log", ".", "info", "(", "\"analyzing as a fast IV\"", ")", "if", "m1", "is", "None", ":", "m1", "=...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
analyze
given a filename or ABF object, try to analyze it.
swhlab/analysis/protocols.py
def analyze(fname=False,save=True,show=None): """given a filename or ABF object, try to analyze it.""" if fname and os.path.exists(fname.replace(".abf",".rst")): print("SKIPPING DUE TO RST FILE") return swhlab.plotting.core.IMAGE_SAVE=save if show is None: if cm.isIpython(): ...
def analyze(fname=False,save=True,show=None): """given a filename or ABF object, try to analyze it.""" if fname and os.path.exists(fname.replace(".abf",".rst")): print("SKIPPING DUE TO RST FILE") return swhlab.plotting.core.IMAGE_SAVE=save if show is None: if cm.isIpython(): ...
[ "given", "a", "filename", "or", "ABF", "object", "try", "to", "analyze", "it", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/protocols.py#L776-L803
[ "def", "analyze", "(", "fname", "=", "False", ",", "save", "=", "True", ",", "show", "=", "None", ")", ":", "if", "fname", "and", "os", ".", "path", ".", "exists", "(", "fname", ".", "replace", "(", "\".abf\"", ",", "\".rst\"", ")", ")", ":", "pr...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
processFolder
call processAbf() for every ABF in a folder.
swhlab/analysis/glance.py
def processFolder(abfFolder): """call processAbf() for every ABF in a folder.""" if not type(abfFolder) is str or not len(abfFolder)>3: return files=sorted(glob.glob(abfFolder+"/*.abf")) for i,fname in enumerate(files): print("\n\n\n### PROCESSING {} of {}:".format(i,len(files)),os.path....
def processFolder(abfFolder): """call processAbf() for every ABF in a folder.""" if not type(abfFolder) is str or not len(abfFolder)>3: return files=sorted(glob.glob(abfFolder+"/*.abf")) for i,fname in enumerate(files): print("\n\n\n### PROCESSING {} of {}:".format(i,len(files)),os.path....
[ "call", "processAbf", "()", "for", "every", "ABF", "in", "a", "folder", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/glance.py#L26-L35
[ "def", "processFolder", "(", "abfFolder", ")", ":", "if", "not", "type", "(", "abfFolder", ")", "is", "str", "or", "not", "len", "(", "abfFolder", ")", ">", "3", ":", "return", "files", "=", "sorted", "(", "glob", ".", "glob", "(", "abfFolder", "+", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
processAbf
automatically generate a single representative image for an ABF. If saveAs is given (full path of a jpg of png file), the image will be saved. Otherwise, the image will pop up in a matplotlib window.
swhlab/analysis/glance.py
def processAbf(abfFname,saveAs=False,dpi=100,show=True): """ automatically generate a single representative image for an ABF. If saveAs is given (full path of a jpg of png file), the image will be saved. Otherwise, the image will pop up in a matplotlib window. """ if not type(abfFname) is str or...
def processAbf(abfFname,saveAs=False,dpi=100,show=True): """ automatically generate a single representative image for an ABF. If saveAs is given (full path of a jpg of png file), the image will be saved. Otherwise, the image will pop up in a matplotlib window. """ if not type(abfFname) is str or...
[ "automatically", "generate", "a", "single", "representative", "image", "for", "an", "ABF", ".", "If", "saveAs", "is", "given", "(", "full", "path", "of", "a", "jpg", "of", "png", "file", ")", "the", "image", "will", "be", "saved", ".", "Otherwise", "the"...
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/analysis/glance.py#L37-L102
[ "def", "processAbf", "(", "abfFname", ",", "saveAs", "=", "False", ",", "dpi", "=", "100", ",", "show", "=", "True", ")", ":", "if", "not", "type", "(", "abfFname", ")", "is", "str", "or", "not", "len", "(", "abfFname", ")", ">", "3", ":", "retur...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
frameAndSave
frame the current matplotlib plot with ABF info, and optionally save it. Note that this is entirely independent of the ABFplot class object. if saveImage is False, show it instead. Datatype should be: * plot * experiment
swhlab/plotting/core.py
def frameAndSave(abf,tag="",dataType="plot",saveAsFname=False,closeWhenDone=True): """ frame the current matplotlib plot with ABF info, and optionally save it. Note that this is entirely independent of the ABFplot class object. if saveImage is False, show it instead. Datatype should be: * p...
def frameAndSave(abf,tag="",dataType="plot",saveAsFname=False,closeWhenDone=True): """ frame the current matplotlib plot with ABF info, and optionally save it. Note that this is entirely independent of the ABFplot class object. if saveImage is False, show it instead. Datatype should be: * p...
[ "frame", "the", "current", "matplotlib", "plot", "with", "ABF", "info", "and", "optionally", "save", "it", ".", "Note", "that", "this", "is", "entirely", "independent", "of", "the", "ABFplot", "class", "object", ".", "if", "saveImage", "is", "False", "show",...
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/plotting/core.py#L24-L64
[ "def", "frameAndSave", "(", "abf", ",", "tag", "=", "\"\"", ",", "dataType", "=", "\"plot\"", ",", "saveAsFname", "=", "False", ",", "closeWhenDone", "=", "True", ")", ":", "print", "(", "\"closeWhenDone\"", ",", "closeWhenDone", ")", "plt", ".", "tight_la...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFplot.figure
make sure a figure is ready.
swhlab/plotting/core.py
def figure(self,forceNew=False): """make sure a figure is ready.""" if plt._pylab_helpers.Gcf.get_num_fig_managers()>0 and forceNew is False: self.log.debug("figure already seen, not creating one.") return if self.subplot: self.log.debug("subplot mode enabled...
def figure(self,forceNew=False): """make sure a figure is ready.""" if plt._pylab_helpers.Gcf.get_num_fig_managers()>0 and forceNew is False: self.log.debug("figure already seen, not creating one.") return if self.subplot: self.log.debug("subplot mode enabled...
[ "make", "sure", "a", "figure", "is", "ready", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/plotting/core.py#L99-L109
[ "def", "figure", "(", "self", ",", "forceNew", "=", "False", ")", ":", "if", "plt", ".", "_pylab_helpers", ".", "Gcf", ".", "get_num_fig_managers", "(", ")", ">", "0", "and", "forceNew", "is", "False", ":", "self", ".", "log", ".", "debug", "(", "\"f...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFplot.save
save the existing figure. does not close it.
swhlab/plotting/core.py
def save(self,callit="misc",closeToo=True,fullpath=False): """save the existing figure. does not close it.""" if fullpath is False: fname=self.abf.outPre+"plot_"+callit+".jpg" else: fname=callit if not os.path.exists(os.path.dirname(fname)): os.mkdir(o...
def save(self,callit="misc",closeToo=True,fullpath=False): """save the existing figure. does not close it.""" if fullpath is False: fname=self.abf.outPre+"plot_"+callit+".jpg" else: fname=callit if not os.path.exists(os.path.dirname(fname)): os.mkdir(o...
[ "save", "the", "existing", "figure", ".", "does", "not", "close", "it", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/plotting/core.py#L125-L136
[ "def", "save", "(", "self", ",", "callit", "=", "\"misc\"", ",", "closeToo", "=", "True", ",", "fullpath", "=", "False", ")", ":", "if", "fullpath", "is", "False", ":", "fname", "=", "self", ".", "abf", ".", "outPre", "+", "\"plot_\"", "+", "callit",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFplot.comments
Add comment lines/text to an existing plot. Defaults to seconds. Call after a plot has been made, and after margins have been set.
swhlab/plotting/core.py
def comments(self,minutes=False): """ Add comment lines/text to an existing plot. Defaults to seconds. Call after a plot has been made, and after margins have been set. """ if self.comments==0: return self.log.debug("adding comments to plot") for i,t i...
def comments(self,minutes=False): """ Add comment lines/text to an existing plot. Defaults to seconds. Call after a plot has been made, and after margins have been set. """ if self.comments==0: return self.log.debug("adding comments to plot") for i,t i...
[ "Add", "comment", "lines", "/", "text", "to", "an", "existing", "plot", ".", "Defaults", "to", "seconds", ".", "Call", "after", "a", "plot", "has", "been", "made", "and", "after", "margins", "have", "been", "set", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/plotting/core.py#L152-L167
[ "def", "comments", "(", "self", ",", "minutes", "=", "False", ")", ":", "if", "self", ".", "comments", "==", "0", ":", "return", "self", ".", "log", ".", "debug", "(", "\"adding comments to plot\"", ")", "for", "i", ",", "t", "in", "enumerate", "(", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFplot.figure_chronological
plot every sweep of an ABF file (with comments).
swhlab/plotting/core.py
def figure_chronological(self): """plot every sweep of an ABF file (with comments).""" self.log.debug("creating chronological plot") self.figure() for sweep in range(self.abf.sweeps): self.abf.setsweep(sweep) self.setColorBySweep() if self.abf.derivati...
def figure_chronological(self): """plot every sweep of an ABF file (with comments).""" self.log.debug("creating chronological plot") self.figure() for sweep in range(self.abf.sweeps): self.abf.setsweep(sweep) self.setColorBySweep() if self.abf.derivati...
[ "plot", "every", "sweep", "of", "an", "ABF", "file", "(", "with", "comments", ")", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/plotting/core.py#L187-L199
[ "def", "figure_chronological", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "\"creating chronological plot\"", ")", "self", ".", "figure", "(", ")", "for", "sweep", "in", "range", "(", "self", ".", "abf", ".", "sweeps", ")", ":", "self",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFplot.figure_sweeps
plot every sweep of an ABF file.
swhlab/plotting/core.py
def figure_sweeps(self, offsetX=0, offsetY=0): """plot every sweep of an ABF file.""" self.log.debug("creating overlayed sweeps plot") self.figure() for sweep in range(self.abf.sweeps): self.abf.setsweep(sweep) self.setColorBySweep() plt.plot(self.abf....
def figure_sweeps(self, offsetX=0, offsetY=0): """plot every sweep of an ABF file.""" self.log.debug("creating overlayed sweeps plot") self.figure() for sweep in range(self.abf.sweeps): self.abf.setsweep(sweep) self.setColorBySweep() plt.plot(self.abf....
[ "plot", "every", "sweep", "of", "an", "ABF", "file", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/plotting/core.py#L208-L220
[ "def", "figure_sweeps", "(", "self", ",", "offsetX", "=", "0", ",", "offsetY", "=", "0", ")", ":", "self", ".", "log", ".", "debug", "(", "\"creating overlayed sweeps plot\"", ")", "self", ".", "figure", "(", ")", "for", "sweep", "in", "range", "(", "s...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFplot.figure_protocol
plot the current sweep protocol.
swhlab/plotting/core.py
def figure_protocol(self): """plot the current sweep protocol.""" self.log.debug("creating overlayed protocols plot") self.figure() plt.plot(self.abf.protoX,self.abf.protoY,color='r') self.marginX=0 self.decorate(protocol=True)
def figure_protocol(self): """plot the current sweep protocol.""" self.log.debug("creating overlayed protocols plot") self.figure() plt.plot(self.abf.protoX,self.abf.protoY,color='r') self.marginX=0 self.decorate(protocol=True)
[ "plot", "the", "current", "sweep", "protocol", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/plotting/core.py#L222-L228
[ "def", "figure_protocol", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "\"creating overlayed protocols plot\"", ")", "self", ".", "figure", "(", ")", "plt", ".", "plot", "(", "self", ".", "abf", ".", "protoX", ",", "self", ".", "abf", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFplot.figure_protocols
plot the protocol of all sweeps.
swhlab/plotting/core.py
def figure_protocols(self): """plot the protocol of all sweeps.""" self.log.debug("creating overlayed protocols plot") self.figure() for sweep in range(self.abf.sweeps): self.abf.setsweep(sweep) plt.plot(self.abf.protoX,self.abf.protoY,color='r') self.marg...
def figure_protocols(self): """plot the protocol of all sweeps.""" self.log.debug("creating overlayed protocols plot") self.figure() for sweep in range(self.abf.sweeps): self.abf.setsweep(sweep) plt.plot(self.abf.protoX,self.abf.protoY,color='r') self.marg...
[ "plot", "the", "protocol", "of", "all", "sweeps", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/plotting/core.py#L230-L238
[ "def", "figure_protocols", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "\"creating overlayed protocols plot\"", ")", "self", ".", "figure", "(", ")", "for", "sweep", "in", "range", "(", "self", ".", "abf", ".", "sweeps", ")", ":", "self...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
fread
Given an already-open (rb mode) file object, return a certain number of bytes at a specific location. If a struct format is given, calculate the number of bytes required and return the object it represents.
doc/misc/reading abfs from scratch.py
def fread(f,byteLocation,structFormat=None,nBytes=1): """ Given an already-open (rb mode) file object, return a certain number of bytes at a specific location. If a struct format is given, calculate the number of bytes required and return the object it represents. """ f.seek(byteLocation) if str...
def fread(f,byteLocation,structFormat=None,nBytes=1): """ Given an already-open (rb mode) file object, return a certain number of bytes at a specific location. If a struct format is given, calculate the number of bytes required and return the object it represents. """ f.seek(byteLocation) if str...
[ "Given", "an", "already", "-", "open", "(", "rb", "mode", ")", "file", "object", "return", "a", "certain", "number", "of", "bytes", "at", "a", "specific", "location", ".", "If", "a", "struct", "format", "is", "given", "calculate", "the", "number", "of", ...
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/misc/reading abfs from scratch.py#L79-L90
[ "def", "fread", "(", "f", ",", "byteLocation", ",", "structFormat", "=", "None", ",", "nBytes", "=", "1", ")", ":", "f", ".", "seek", "(", "byteLocation", ")", "if", "structFormat", ":", "val", "=", "struct", ".", "unpack", "(", "structFormat", ",", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
abf_read_header
Practice pulling data straight out of an ABF's binary header. Support only ABF2 (ClampEx an ClampFit 10). Use only native python libraries. Strive for simplicity and readability (to promote language portability). This was made by Scott Harden after a line-by-line analysis of axonrawio.py from the neo io library...
doc/misc/reading abfs from scratch.py
def abf_read_header(fname, saveHeader=True): """ Practice pulling data straight out of an ABF's binary header. Support only ABF2 (ClampEx an ClampFit 10). Use only native python libraries. Strive for simplicity and readability (to promote language portability). This was made by Scott Harden after a line...
def abf_read_header(fname, saveHeader=True): """ Practice pulling data straight out of an ABF's binary header. Support only ABF2 (ClampEx an ClampFit 10). Use only native python libraries. Strive for simplicity and readability (to promote language portability). This was made by Scott Harden after a line...
[ "Practice", "pulling", "data", "straight", "out", "of", "an", "ABF", "s", "binary", "header", ".", "Support", "only", "ABF2", "(", "ClampEx", "an", "ClampFit", "10", ")", ".", "Use", "only", "native", "python", "libraries", ".", "Strive", "for", "simplicit...
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/misc/reading abfs from scratch.py#L92-L230
[ "def", "abf_read_header", "(", "fname", ",", "saveHeader", "=", "True", ")", ":", "### THESE OBJETS WILL BE FULL WHEN THIS FUNCTION IS COMPLETE", "header", "=", "{", "}", "# information about the file format", "sections", "=", "{", "}", "# contains byte positions (and block s...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
frames
create and save a two column frames HTML file.
swhlab/indexing/style.py
def frames(fname=None,menuWidth=200,launch=False): """create and save a two column frames HTML file.""" html=""" <frameset cols="%dpx,*%%"> <frame name="menu" src="index_menu.html"> <frame name="content" src="index_splash.html"> </frameset>"""%(menuWidth) with open(fname,'w') as f: f...
def frames(fname=None,menuWidth=200,launch=False): """create and save a two column frames HTML file.""" html=""" <frameset cols="%dpx,*%%"> <frame name="menu" src="index_menu.html"> <frame name="content" src="index_splash.html"> </frameset>"""%(menuWidth) with open(fname,'w') as f: f...
[ "create", "and", "save", "a", "two", "column", "frames", "HTML", "file", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/style.py#L68-L78
[ "def", "frames", "(", "fname", "=", "None", ",", "menuWidth", "=", "200", ",", "launch", "=", "False", ")", ":", "html", "=", "\"\"\"\n <frameset cols=\"%dpx,*%%\">\n <frame name=\"menu\" src=\"index_menu.html\">\n <frame name=\"content\" src=\"index_splash.html\">\n ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
save
wrap HTML in a top and bottom (with css) and save to disk.
swhlab/indexing/style.py
def save(html,fname=None,launch=False): """wrap HTML in a top and bottom (with css) and save to disk.""" html=html_top+html+html_bot html=html.replace("~GENAT~",swhlab.common.datetimeToString()) if fname is None: fname = tempfile.gettempdir()+"/temp.html" launch=True fname=os.path.ab...
def save(html,fname=None,launch=False): """wrap HTML in a top and bottom (with css) and save to disk.""" html=html_top+html+html_bot html=html.replace("~GENAT~",swhlab.common.datetimeToString()) if fname is None: fname = tempfile.gettempdir()+"/temp.html" launch=True fname=os.path.ab...
[ "wrap", "HTML", "in", "a", "top", "and", "bottom", "(", "with", "css", ")", "and", "save", "to", "disk", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/style.py#L80-L98
[ "def", "save", "(", "html", ",", "fname", "=", "None", ",", "launch", "=", "False", ")", ":", "html", "=", "html_top", "+", "html", "+", "html_bot", "html", "=", "html", ".", "replace", "(", "\"~GENAT~\"", ",", "swhlab", ".", "common", ".", "datetime...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
clampfit_rename
Given ABFs and TIFs formatted long style, rename each of them to prefix their number with a different number. Example: 2017_10_11_0011.abf Becomes: 2017_10_11_?011.abf where ? can be any character.
swhlab/tools/rename.py
def clampfit_rename(path,char): """ Given ABFs and TIFs formatted long style, rename each of them to prefix their number with a different number. Example: 2017_10_11_0011.abf Becomes: 2017_10_11_?011.abf where ? can be any character. """ assert len(char)==1 and type(char)==str, "replacement...
def clampfit_rename(path,char): """ Given ABFs and TIFs formatted long style, rename each of them to prefix their number with a different number. Example: 2017_10_11_0011.abf Becomes: 2017_10_11_?011.abf where ? can be any character. """ assert len(char)==1 and type(char)==str, "replacement...
[ "Given", "ABFs", "and", "TIFs", "formatted", "long", "style", "rename", "each", "of", "them", "to", "prefix", "their", "number", "with", "a", "different", "number", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/tools/rename.py#L3-L28
[ "def", "clampfit_rename", "(", "path", ",", "char", ")", ":", "assert", "len", "(", "char", ")", "==", "1", "and", "type", "(", "char", ")", "==", "str", ",", "\"replacement character must be a single character\"", "assert", "os", ".", "path", ".", "exists",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
kernel_gaussian
return a 1d gassuan array of a given size and sigma. If sigma isn't given, it will be 1/10 of the size, which is usually good.
doc/uses/EPSCs-and-IPSCs/smooth histogram method/01.py
def kernel_gaussian(size=100, sigma=None, forwardOnly=False): """ return a 1d gassuan array of a given size and sigma. If sigma isn't given, it will be 1/10 of the size, which is usually good. """ if sigma is None:sigma=size/10 points=np.exp(-np.power(np.arange(size)-size/2,2)/(2*np.power(sigma,...
def kernel_gaussian(size=100, sigma=None, forwardOnly=False): """ return a 1d gassuan array of a given size and sigma. If sigma isn't given, it will be 1/10 of the size, which is usually good. """ if sigma is None:sigma=size/10 points=np.exp(-np.power(np.arange(size)-size/2,2)/(2*np.power(sigma,...
[ "return", "a", "1d", "gassuan", "array", "of", "a", "given", "size", "and", "sigma", ".", "If", "sigma", "isn", "t", "given", "it", "will", "be", "1", "/", "10", "of", "the", "size", "which", "is", "usually", "good", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/uses/EPSCs-and-IPSCs/smooth histogram method/01.py#L19-L28
[ "def", "kernel_gaussian", "(", "size", "=", "100", ",", "sigma", "=", "None", ",", "forwardOnly", "=", "False", ")", ":", "if", "sigma", "is", "None", ":", "sigma", "=", "size", "/", "10", "points", "=", "np", ".", "exp", "(", "-", "np", ".", "po...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
analyzeSweep
m1 and m2, if given, are in seconds. returns [# EPSCs, # IPSCs]
doc/uses/EPSCs-and-IPSCs/smooth histogram method/01.py
def analyzeSweep(abf,sweep,m1=None,m2=None,plotToo=False): """ m1 and m2, if given, are in seconds. returns [# EPSCs, # IPSCs] """ abf.setsweep(sweep) if m1 is None: m1=0 else: m1=m1*abf.pointsPerSec if m2 is None: m2=-1 else: m2=m2*abf.pointsPerSec # obtain X and Y Yorig=ab...
def analyzeSweep(abf,sweep,m1=None,m2=None,plotToo=False): """ m1 and m2, if given, are in seconds. returns [# EPSCs, # IPSCs] """ abf.setsweep(sweep) if m1 is None: m1=0 else: m1=m1*abf.pointsPerSec if m2 is None: m2=-1 else: m2=m2*abf.pointsPerSec # obtain X and Y Yorig=ab...
[ "m1", "and", "m2", "if", "given", "are", "in", "seconds", ".", "returns", "[", "#", "EPSCs", "#", "IPSCs", "]" ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/uses/EPSCs-and-IPSCs/smooth histogram method/01.py#L105-L175
[ "def", "analyzeSweep", "(", "abf", ",", "sweep", ",", "m1", "=", "None", ",", "m2", "=", "None", ",", "plotToo", "=", "False", ")", ":", "abf", ".", "setsweep", "(", "sweep", ")", "if", "m1", "is", "None", ":", "m1", "=", "0", "else", ":", "m1"...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
filesByExtension
given a list of files, return a dict organized by extension.
swhlab/indexing/index_OLD.py
def filesByExtension(fnames): """given a list of files, return a dict organized by extension.""" byExt={"abf":[],"jpg":[],"tif":[]} # prime it with empties for fname in fnames: ext = os.path.splitext(fname)[1].replace(".",'').lower() if not ext in byExt.keys(): byExt[ext]=[] ...
def filesByExtension(fnames): """given a list of files, return a dict organized by extension.""" byExt={"abf":[],"jpg":[],"tif":[]} # prime it with empties for fname in fnames: ext = os.path.splitext(fname)[1].replace(".",'').lower() if not ext in byExt.keys(): byExt[ext]=[] ...
[ "given", "a", "list", "of", "files", "return", "a", "dict", "organized", "by", "extension", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/index_OLD.py#L1-L9
[ "def", "filesByExtension", "(", "fnames", ")", ":", "byExt", "=", "{", "\"abf\"", ":", "[", "]", ",", "\"jpg\"", ":", "[", "]", ",", "\"tif\"", ":", "[", "]", "}", "# prime it with empties", "for", "fname", "in", "fnames", ":", "ext", "=", "os", ".",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
findCells
given a list of files, return a list of cells by their ID. A cell is indicated when an ABF name matches the start of another file. Example: 123456.abf 123456-whatever.tif
swhlab/indexing/index_OLD.py
def findCells(fnames): """ given a list of files, return a list of cells by their ID. A cell is indicated when an ABF name matches the start of another file. Example: 123456.abf 123456-whatever.tif """ IDs=[] filesByExt = filesByExtension(fnames) for abfFname in fil...
def findCells(fnames): """ given a list of files, return a list of cells by their ID. A cell is indicated when an ABF name matches the start of another file. Example: 123456.abf 123456-whatever.tif """ IDs=[] filesByExt = filesByExtension(fnames) for abfFname in fil...
[ "given", "a", "list", "of", "files", "return", "a", "list", "of", "cells", "by", "their", "ID", ".", "A", "cell", "is", "indicated", "when", "an", "ABF", "name", "matches", "the", "start", "of", "another", "file", ".", "Example", ":", "123456", ".", ...
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/index_OLD.py#L11-L28
[ "def", "findCells", "(", "fnames", ")", ":", "IDs", "=", "[", "]", "filesByExt", "=", "filesByExtension", "(", "fnames", ")", "for", "abfFname", "in", "filesByExt", "[", "'abf'", "]", ":", "ID", "=", "os", ".", "path", ".", "splitext", "(", "abfFname",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
filesByCell
given files and cells, return a dict of files grouped by cell.
swhlab/indexing/index_OLD.py
def filesByCell(fnames,cells): """given files and cells, return a dict of files grouped by cell.""" byCell={} fnames=smartSort(fnames) days = list(set([elem[:5] for elem in fnames if elem.endswith(".abf")])) # so pythonic! for day in smartSort(days): parent=None for i,fname in enumer...
def filesByCell(fnames,cells): """given files and cells, return a dict of files grouped by cell.""" byCell={} fnames=smartSort(fnames) days = list(set([elem[:5] for elem in fnames if elem.endswith(".abf")])) # so pythonic! for day in smartSort(days): parent=None for i,fname in enumer...
[ "given", "files", "and", "cells", "return", "a", "dict", "of", "files", "grouped", "by", "cell", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/index_OLD.py#L30-L44
[ "def", "filesByCell", "(", "fnames", ",", "cells", ")", ":", "byCell", "=", "{", "}", "fnames", "=", "smartSort", "(", "fnames", ")", "days", "=", "list", "(", "set", "(", "[", "elem", "[", ":", "5", "]", "for", "elem", "in", "fnames", "if", "ele...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFindex.folderScan
populate class properties relating to files in the folder.
swhlab/indexing/index_OLD.py
def folderScan(self,abfFolder=None): """populate class properties relating to files in the folder.""" if abfFolder is None and 'abfFolder' in dir(self): abfFolder=self.abfFolder else: self.abfFolder=abfFolder self.abfFolder=os.path.abspath(self.abfFolder) ...
def folderScan(self,abfFolder=None): """populate class properties relating to files in the folder.""" if abfFolder is None and 'abfFolder' in dir(self): abfFolder=self.abfFolder else: self.abfFolder=abfFolder self.abfFolder=os.path.abspath(self.abfFolder) ...
[ "populate", "class", "properties", "relating", "to", "files", "in", "the", "folder", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/index_OLD.py#L76-L105
[ "def", "folderScan", "(", "self", ",", "abfFolder", "=", "None", ")", ":", "if", "abfFolder", "is", "None", "and", "'abfFolder'", "in", "dir", "(", "self", ")", ":", "abfFolder", "=", "self", ".", "abfFolder", "else", ":", "self", ".", "abfFolder", "="...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFindex.html_index
generate list of cells with links. keep this simple. automatically generates splash page and regnerates frames.
swhlab/indexing/index_OLD.py
def html_index(self,launch=False,showChildren=False): """ generate list of cells with links. keep this simple. automatically generates splash page and regnerates frames. """ self.makePics() # ensure all pics are converted # generate menu html='<a href="index_splas...
def html_index(self,launch=False,showChildren=False): """ generate list of cells with links. keep this simple. automatically generates splash page and regnerates frames. """ self.makePics() # ensure all pics are converted # generate menu html='<a href="index_splas...
[ "generate", "list", "of", "cells", "with", "links", ".", "keep", "this", "simple", ".", "automatically", "generates", "splash", "page", "and", "regnerates", "frames", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/index_OLD.py#L107-L131
[ "def", "html_index", "(", "self", ",", "launch", "=", "False", ",", "showChildren", "=", "False", ")", ":", "self", ".", "makePics", "(", ")", "# ensure all pics are converted", "# generate menu", "html", "=", "'<a href=\"index_splash.html\" target=\"content\">./%s/</a>...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFindex.html_index_splash
generate landing page.
swhlab/indexing/index_OLD.py
def html_index_splash(self): """generate landing page.""" html="""<h1 style="background-color: #EEEEFF; padding: 10px; border: 1px solid #CCCCFF;"> SWHLab <span style="font-size: 35%%;">%s<?span></h1> """%version.__version__ #html+='<code>%s</code><br><br>'%self.abfFolder ...
def html_index_splash(self): """generate landing page.""" html="""<h1 style="background-color: #EEEEFF; padding: 10px; border: 1px solid #CCCCFF;"> SWHLab <span style="font-size: 35%%;">%s<?span></h1> """%version.__version__ #html+='<code>%s</code><br><br>'%self.abfFolder ...
[ "generate", "landing", "page", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/index_OLD.py#L133-L147
[ "def", "html_index_splash", "(", "self", ")", ":", "html", "=", "\"\"\"<h1 style=\"background-color: #EEEEFF; padding: 10px; border: 1px solid #CCCCFF;\">\n SWHLab <span style=\"font-size: 35%%;\">%s<?span></h1>\n \"\"\"", "%", "version", ".", "__version__", "#html+='<code>%s...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFindex.html_single_basic
generate ./swhlab/xxyxxzzz.html for a single given abf. Input can be an ABF file path of ABF ID.
swhlab/indexing/index_OLD.py
def html_single_basic(self,ID): """ generate ./swhlab/xxyxxzzz.html for a single given abf. Input can be an ABF file path of ABF ID. """ if not ID in self.cells: self.log.error("ID [%s] not seen!",ID) return htmlFname=os.path.abspath(self.abfFolder...
def html_single_basic(self,ID): """ generate ./swhlab/xxyxxzzz.html for a single given abf. Input can be an ABF file path of ABF ID. """ if not ID in self.cells: self.log.error("ID [%s] not seen!",ID) return htmlFname=os.path.abspath(self.abfFolder...
[ "generate", ".", "/", "swhlab", "/", "xxyxxzzz", ".", "html", "for", "a", "single", "given", "abf", ".", "Input", "can", "be", "an", "ABF", "file", "path", "of", "ABF", "ID", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/index_OLD.py#L149-L168
[ "def", "html_single_basic", "(", "self", ",", "ID", ")", ":", "if", "not", "ID", "in", "self", ".", "cells", ":", "self", ".", "log", ".", "error", "(", "\"ID [%s] not seen!\"", ",", "ID", ")", "return", "htmlFname", "=", "os", ".", "path", ".", "abs...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFindex.html_singleAll
generate a data view for every ABF in the project folder.
swhlab/indexing/index_OLD.py
def html_singleAll(self,template="basic"): """generate a data view for every ABF in the project folder.""" for fname in smartSort(self.cells): if template=="fixed": self.html_single_fixed(fname) else: self.html_single_basic(fname)
def html_singleAll(self,template="basic"): """generate a data view for every ABF in the project folder.""" for fname in smartSort(self.cells): if template=="fixed": self.html_single_fixed(fname) else: self.html_single_basic(fname)
[ "generate", "a", "data", "view", "for", "every", "ABF", "in", "the", "project", "folder", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/index_OLD.py#L174-L180
[ "def", "html_singleAll", "(", "self", ",", "template", "=", "\"basic\"", ")", ":", "for", "fname", "in", "smartSort", "(", "self", ".", "cells", ")", ":", "if", "template", "==", "\"fixed\"", ":", "self", ".", "html_single_fixed", "(", "fname", ")", "els...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
ABFindex.makePics
convert every .image we find to a ./swhlab/ image
swhlab/indexing/index_OLD.py
def makePics(self): """convert every .image we find to a ./swhlab/ image""" rescanNeeded=False for fname in smartSort(self.fnames): if fname in self.fnames2: continue ext=os.path.splitext(fname)[1].lower() if ext in [".jpg",".png"]: ...
def makePics(self): """convert every .image we find to a ./swhlab/ image""" rescanNeeded=False for fname in smartSort(self.fnames): if fname in self.fnames2: continue ext=os.path.splitext(fname)[1].lower() if ext in [".jpg",".png"]: ...
[ "convert", "every", ".", "image", "we", "find", "to", "a", ".", "/", "swhlab", "/", "image" ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/swhlab/indexing/index_OLD.py#L182-L202
[ "def", "makePics", "(", "self", ")", ":", "rescanNeeded", "=", "False", "for", "fname", "in", "smartSort", "(", "self", ".", "fnames", ")", ":", "if", "fname", "in", "self", ".", "fnames2", ":", "continue", "ext", "=", "os", ".", "path", ".", "splite...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_01_01_HP010
hyperpolarization step. Use to calculate tau and stuff.
doc/oldcode/indexing/standard.py
def proto_01_01_HP010(abf=exampleABF): """hyperpolarization step. Use to calculate tau and stuff.""" swhlab.memtest.memtest(abf) #knows how to do IC memtest swhlab.memtest.checkSweep(abf) #lets you eyeball check how it did swhlab.plot.save(abf,tag="tau")
def proto_01_01_HP010(abf=exampleABF): """hyperpolarization step. Use to calculate tau and stuff.""" swhlab.memtest.memtest(abf) #knows how to do IC memtest swhlab.memtest.checkSweep(abf) #lets you eyeball check how it did swhlab.plot.save(abf,tag="tau")
[ "hyperpolarization", "step", ".", "Use", "to", "calculate", "tau", "and", "stuff", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L47-L51
[ "def", "proto_01_01_HP010", "(", "abf", "=", "exampleABF", ")", ":", "swhlab", ".", "memtest", ".", "memtest", "(", "abf", ")", "#knows how to do IC memtest", "swhlab", ".", "memtest", ".", "checkSweep", "(", "abf", ")", "#lets you eyeball check how it did", "swhl...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_01_11_rampStep
each sweep is a ramp (of set size) which builds on the last sweep. Used for detection of AP properties from first few APs.
doc/oldcode/indexing/standard.py
def proto_01_11_rampStep(abf=exampleABF): """each sweep is a ramp (of set size) which builds on the last sweep. Used for detection of AP properties from first few APs.""" standard_inspect(abf) swhlab.ap.detect(abf) swhlab.ap.check_sweep(abf) #eyeball how well event detection worked swhlab.plot.s...
def proto_01_11_rampStep(abf=exampleABF): """each sweep is a ramp (of set size) which builds on the last sweep. Used for detection of AP properties from first few APs.""" standard_inspect(abf) swhlab.ap.detect(abf) swhlab.ap.check_sweep(abf) #eyeball how well event detection worked swhlab.plot.s...
[ "each", "sweep", "is", "a", "ramp", "(", "of", "set", "size", ")", "which", "builds", "on", "the", "last", "sweep", ".", "Used", "for", "detection", "of", "AP", "properties", "from", "first", "few", "APs", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L53-L68
[ "def", "proto_01_11_rampStep", "(", "abf", "=", "exampleABF", ")", ":", "standard_inspect", "(", "abf", ")", "swhlab", ".", "ap", ".", "detect", "(", "abf", ")", "swhlab", ".", "ap", ".", "check_sweep", "(", "abf", ")", "#eyeball how well event detection worke...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_01_12_steps025
IC steps. Use to determine gain function.
doc/oldcode/indexing/standard.py
def proto_01_12_steps025(abf=exampleABF): """IC steps. Use to determine gain function.""" swhlab.ap.detect(abf) standard_groupingForInj(abf,200) for feature in ['freq','downslope']: swhlab.ap.plot_values(abf,feature,continuous=False) #plot AP info swhlab.plot.save(abf,tag='A_'+feature) ...
def proto_01_12_steps025(abf=exampleABF): """IC steps. Use to determine gain function.""" swhlab.ap.detect(abf) standard_groupingForInj(abf,200) for feature in ['freq','downslope']: swhlab.ap.plot_values(abf,feature,continuous=False) #plot AP info swhlab.plot.save(abf,tag='A_'+feature) ...
[ "IC", "steps", ".", "Use", "to", "determine", "gain", "function", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L70-L80
[ "def", "proto_01_12_steps025", "(", "abf", "=", "exampleABF", ")", ":", "swhlab", ".", "ap", ".", "detect", "(", "abf", ")", "standard_groupingForInj", "(", "abf", ",", "200", ")", "for", "feature", "in", "[", "'freq'", ",", "'downslope'", "]", ":", "swh...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_01_13_steps025dual
IC steps. See how hyperpol. step affects things.
doc/oldcode/indexing/standard.py
def proto_01_13_steps025dual(abf=exampleABF): """IC steps. See how hyperpol. step affects things.""" swhlab.ap.detect(abf) standard_groupingForInj(abf,200) for feature in ['freq','downslope']: swhlab.ap.plot_values(abf,feature,continuous=False) #plot AP info swhlab.plot.save(abf,tag='A_...
def proto_01_13_steps025dual(abf=exampleABF): """IC steps. See how hyperpol. step affects things.""" swhlab.ap.detect(abf) standard_groupingForInj(abf,200) for feature in ['freq','downslope']: swhlab.ap.plot_values(abf,feature,continuous=False) #plot AP info swhlab.plot.save(abf,tag='A_...
[ "IC", "steps", ".", "See", "how", "hyperpol", ".", "step", "affects", "things", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L86-L106
[ "def", "proto_01_13_steps025dual", "(", "abf", "=", "exampleABF", ")", ":", "swhlab", ".", "ap", ".", "detect", "(", "abf", ")", "standard_groupingForInj", "(", "abf", ",", "200", ")", "for", "feature", "in", "[", "'freq'", ",", "'downslope'", "]", ":", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_02_01_MT70
repeated membrane tests.
doc/oldcode/indexing/standard.py
def proto_02_01_MT70(abf=exampleABF): """repeated membrane tests.""" standard_overlayWithAverage(abf) swhlab.memtest.memtest(abf) swhlab.memtest.checkSweep(abf) swhlab.plot.save(abf,tag='check',resize=False)
def proto_02_01_MT70(abf=exampleABF): """repeated membrane tests.""" standard_overlayWithAverage(abf) swhlab.memtest.memtest(abf) swhlab.memtest.checkSweep(abf) swhlab.plot.save(abf,tag='check',resize=False)
[ "repeated", "membrane", "tests", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L109-L114
[ "def", "proto_02_01_MT70", "(", "abf", "=", "exampleABF", ")", ":", "standard_overlayWithAverage", "(", "abf", ")", "swhlab", ".", "memtest", ".", "memtest", "(", "abf", ")", "swhlab", ".", "memtest", ".", "checkSweep", "(", "abf", ")", "swhlab", ".", "plo...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_02_02_IVdual
dual I/V steps in VC mode, one from -70 and one -50.
doc/oldcode/indexing/standard.py
def proto_02_02_IVdual(abf=exampleABF): """dual I/V steps in VC mode, one from -70 and one -50.""" av1,sd1=swhlab.plot.IV(abf,.7,1,True,'b') swhlab.plot.save(abf,tag='iv1') a2v,sd2=swhlab.plot.IV(abf,2.2,2.5,True,'r') swhlab.plot.save(abf,tag='iv2') swhlab.plot.sweep(abf,'all') pylab.axis(...
def proto_02_02_IVdual(abf=exampleABF): """dual I/V steps in VC mode, one from -70 and one -50.""" av1,sd1=swhlab.plot.IV(abf,.7,1,True,'b') swhlab.plot.save(abf,tag='iv1') a2v,sd2=swhlab.plot.IV(abf,2.2,2.5,True,'r') swhlab.plot.save(abf,tag='iv2') swhlab.plot.sweep(abf,'all') pylab.axis(...
[ "dual", "I", "/", "V", "steps", "in", "VC", "mode", "one", "from", "-", "70", "and", "one", "-", "50", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L116-L126
[ "def", "proto_02_02_IVdual", "(", "abf", "=", "exampleABF", ")", ":", "av1", ",", "sd1", "=", "swhlab", ".", "plot", ".", "IV", "(", "abf", ",", ".7", ",", "1", ",", "True", ",", "'b'", ")", "swhlab", ".", "plot", ".", "save", "(", "abf", ",", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_02_03_IVfast
fast sweeps, 1 step per sweep, for clean IV without fast currents.
doc/oldcode/indexing/standard.py
def proto_02_03_IVfast(abf=exampleABF): """fast sweeps, 1 step per sweep, for clean IV without fast currents.""" av1,sd1=swhlab.plot.IV(abf,.6,.9,True) swhlab.plot.save(abf,tag='iv1') Xs=abf.clampValues(.6) #generate IV clamp values abf.saveThing([Xs,av1],'iv')
def proto_02_03_IVfast(abf=exampleABF): """fast sweeps, 1 step per sweep, for clean IV without fast currents.""" av1,sd1=swhlab.plot.IV(abf,.6,.9,True) swhlab.plot.save(abf,tag='iv1') Xs=abf.clampValues(.6) #generate IV clamp values abf.saveThing([Xs,av1],'iv')
[ "fast", "sweeps", "1", "step", "per", "sweep", "for", "clean", "IV", "without", "fast", "currents", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L128-L133
[ "def", "proto_02_03_IVfast", "(", "abf", "=", "exampleABF", ")", ":", "av1", ",", "sd1", "=", "swhlab", ".", "plot", ".", "IV", "(", "abf", ",", ".6", ",", ".9", ",", "True", ")", "swhlab", ".", "plot", ".", "save", "(", "abf", ",", "tag", "=", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_04_01_MTmon70s2
repeated membrane tests, likely with drug added. Maybe IPSCs.
doc/oldcode/indexing/standard.py
def proto_04_01_MTmon70s2(abf=exampleABF): """repeated membrane tests, likely with drug added. Maybe IPSCs.""" standard_inspect(abf) swhlab.memtest.memtest(abf) swhlab.memtest.checkSweep(abf) swhlab.plot.save(abf,tag='check',resize=False) swhlab.memtest.plot_standard4(abf) swhlab.plot.save(a...
def proto_04_01_MTmon70s2(abf=exampleABF): """repeated membrane tests, likely with drug added. Maybe IPSCs.""" standard_inspect(abf) swhlab.memtest.memtest(abf) swhlab.memtest.checkSweep(abf) swhlab.plot.save(abf,tag='check',resize=False) swhlab.memtest.plot_standard4(abf) swhlab.plot.save(a...
[ "repeated", "membrane", "tests", "likely", "with", "drug", "added", ".", "Maybe", "IPSCs", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L139-L146
[ "def", "proto_04_01_MTmon70s2", "(", "abf", "=", "exampleABF", ")", ":", "standard_inspect", "(", "abf", ")", "swhlab", ".", "memtest", ".", "memtest", "(", "abf", ")", "swhlab", ".", "memtest", ".", "checkSweep", "(", "abf", ")", "swhlab", ".", "plot", ...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_VC_50_MT_IV
combination of membrane test and IV steps.
doc/oldcode/indexing/standard.py
def proto_VC_50_MT_IV(abf=exampleABF): """combination of membrane test and IV steps.""" swhlab.memtest.memtest(abf) #do membrane test on every sweep swhlab.memtest.checkSweep(abf) #see all MT values swhlab.plot.save(abf,tag='02-check',resize=False) av1,sd1=swhlab.plot.IV(abf,1.2,1.4,True,'b') s...
def proto_VC_50_MT_IV(abf=exampleABF): """combination of membrane test and IV steps.""" swhlab.memtest.memtest(abf) #do membrane test on every sweep swhlab.memtest.checkSweep(abf) #see all MT values swhlab.plot.save(abf,tag='02-check',resize=False) av1,sd1=swhlab.plot.IV(abf,1.2,1.4,True,'b') s...
[ "combination", "of", "membrane", "test", "and", "IV", "steps", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L153-L162
[ "def", "proto_VC_50_MT_IV", "(", "abf", "=", "exampleABF", ")", ":", "swhlab", ".", "memtest", ".", "memtest", "(", "abf", ")", "#do membrane test on every sweep", "swhlab", ".", "memtest", ".", "checkSweep", "(", "abf", ")", "#see all MT values", "swhlab", ".",...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
proto_IC_ramp_gain
increasing ramps in (?) pA steps.
doc/oldcode/indexing/standard.py
def proto_IC_ramp_gain(abf=exampleABF): """increasing ramps in (?) pA steps.""" standard_inspect(abf) swhlab.ap.detect(abf) swhlab.ap.check_AP_raw(abf) #show overlayed first few APs swhlab.plot.save(abf,tag="01-raw",resize=False) swhlab.ap.check_AP_deriv(abf) #show overlayed first few APs s...
def proto_IC_ramp_gain(abf=exampleABF): """increasing ramps in (?) pA steps.""" standard_inspect(abf) swhlab.ap.detect(abf) swhlab.ap.check_AP_raw(abf) #show overlayed first few APs swhlab.plot.save(abf,tag="01-raw",resize=False) swhlab.ap.check_AP_deriv(abf) #show overlayed first few APs s...
[ "increasing", "ramps", "in", "(", "?", ")", "pA", "steps", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L164-L184
[ "def", "proto_IC_ramp_gain", "(", "abf", "=", "exampleABF", ")", ":", "standard_inspect", "(", "abf", ")", "swhlab", ".", "ap", ".", "detect", "(", "abf", ")", "swhlab", ".", "ap", ".", "check_AP_raw", "(", "abf", ")", "#show overlayed first few APs", "swhla...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
indexImages
OBSOLETE WAY TO INDEX A FOLDER.
doc/oldcode/indexing/standard.py
def indexImages(folder,fname="index.html"): """OBSOLETE WAY TO INDEX A FOLDER.""" #TODO: REMOVE html="<html><body>" for item in glob.glob(folder+"/*.*"): if item.split(".")[-1] in ['jpg','png']: html+="<h3>%s</h3>"%os.path.basename(item) html+='<img src="%s">'%os.path.basenam...
def indexImages(folder,fname="index.html"): """OBSOLETE WAY TO INDEX A FOLDER.""" #TODO: REMOVE html="<html><body>" for item in glob.glob(folder+"/*.*"): if item.split(".")[-1] in ['jpg','png']: html+="<h3>%s</h3>"%os.path.basename(item) html+='<img src="%s">'%os.path.basenam...
[ "OBSOLETE", "WAY", "TO", "INDEX", "A", "FOLDER", "." ]
swharden/SWHLab
python
https://github.com/swharden/SWHLab/blob/a86c3c65323cec809a4bd4f81919644927094bf5/doc/oldcode/indexing/standard.py#L283-L297
[ "def", "indexImages", "(", "folder", ",", "fname", "=", "\"index.html\"", ")", ":", "#TODO: REMOVE", "html", "=", "\"<html><body>\"", "for", "item", "in", "glob", ".", "glob", "(", "folder", "+", "\"/*.*\"", ")", ":", "if", "item", ".", "split", "(", "\"...
a86c3c65323cec809a4bd4f81919644927094bf5
valid
BaseActivatableModel.save
A custom save method that handles figuring out when something is activated or deactivated.
activatable_model/models.py
def save(self, *args, **kwargs): """ A custom save method that handles figuring out when something is activated or deactivated. """ current_activable_value = getattr(self, self.ACTIVATABLE_FIELD_NAME) is_active_changed = self.id is None or self.__original_activatable_value != cur...
def save(self, *args, **kwargs): """ A custom save method that handles figuring out when something is activated or deactivated. """ current_activable_value = getattr(self, self.ACTIVATABLE_FIELD_NAME) is_active_changed = self.id is None or self.__original_activatable_value != cur...
[ "A", "custom", "save", "method", "that", "handles", "figuring", "out", "when", "something", "is", "activated", "or", "deactivated", "." ]
ambitioninc/django-activatable-model
python
https://github.com/ambitioninc/django-activatable-model/blob/2c142430949a923a69201f4914a6b73a642b4b48/activatable_model/models.py#L97-L113
[ "def", "save", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "current_activable_value", "=", "getattr", "(", "self", ",", "self", ".", "ACTIVATABLE_FIELD_NAME", ")", "is_active_changed", "=", "self", ".", "id", "is", "None", "or", "se...
2c142430949a923a69201f4914a6b73a642b4b48
valid
BaseActivatableModel.delete
It is impossible to delete an activatable model unless force is True. This function instead sets it to inactive.
activatable_model/models.py
def delete(self, force=False, **kwargs): """ It is impossible to delete an activatable model unless force is True. This function instead sets it to inactive. """ if force: return super(BaseActivatableModel, self).delete(**kwargs) else: setattr(self, self.A...
def delete(self, force=False, **kwargs): """ It is impossible to delete an activatable model unless force is True. This function instead sets it to inactive. """ if force: return super(BaseActivatableModel, self).delete(**kwargs) else: setattr(self, self.A...
[ "It", "is", "impossible", "to", "delete", "an", "activatable", "model", "unless", "force", "is", "True", ".", "This", "function", "instead", "sets", "it", "to", "inactive", "." ]
ambitioninc/django-activatable-model
python
https://github.com/ambitioninc/django-activatable-model/blob/2c142430949a923a69201f4914a6b73a642b4b48/activatable_model/models.py#L115-L123
[ "def", "delete", "(", "self", ",", "force", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "force", ":", "return", "super", "(", "BaseActivatableModel", ",", "self", ")", ".", "delete", "(", "*", "*", "kwargs", ")", "else", ":", "setattr", ...
2c142430949a923a69201f4914a6b73a642b4b48
valid
Command.show
Write to file_handle if supplied, othewise print output
lancet/launch.py
def show(self, args, file_handle=None, **kwargs): "Write to file_handle if supplied, othewise print output" full_string = '' info = {'root_directory': '<root_directory>', 'batch_name': '<batch_name>', 'batch_tag': '<batch_tag>', ...
def show(self, args, file_handle=None, **kwargs): "Write to file_handle if supplied, othewise print output" full_string = '' info = {'root_directory': '<root_directory>', 'batch_name': '<batch_name>', 'batch_tag': '<batch_tag>', ...
[ "Write", "to", "file_handle", "if", "supplied", "othewise", "print", "output" ]
ioam/lancet
python
https://github.com/ioam/lancet/blob/1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e/lancet/launch.py#L72-L97
[ "def", "show", "(", "self", ",", "args", ",", "file_handle", "=", "None", ",", "*", "*", "kwargs", ")", ":", "full_string", "=", "''", "info", "=", "{", "'root_directory'", ":", "'<root_directory>'", ",", "'batch_name'", ":", "'<batch_name>'", ",", "'batch...
1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e
valid
Output.update
Update the launch information -- use if additional launches were made.
lancet/launch.py
def update(self): """Update the launch information -- use if additional launches were made. """ launches = [] for path in os.listdir(self.output_dir): full_path = os.path.join(self.output_dir, path) if os.path.isdir(full_path): launches.app...
def update(self): """Update the launch information -- use if additional launches were made. """ launches = [] for path in os.listdir(self.output_dir): full_path = os.path.join(self.output_dir, path) if os.path.isdir(full_path): launches.app...
[ "Update", "the", "launch", "information", "--", "use", "if", "additional", "launches", "were", "made", "." ]
ioam/lancet
python
https://github.com/ioam/lancet/blob/1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e/lancet/launch.py#L363-L372
[ "def", "update", "(", "self", ")", ":", "launches", "=", "[", "]", "for", "path", "in", "os", ".", "listdir", "(", "self", ".", "output_dir", ")", ":", "full_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "output_dir", ",", "path", ...
1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e
valid
Launcher.get_root_directory
A helper method that supplies the root directory name given a timestamp.
lancet/launch.py
def get_root_directory(self, timestamp=None): """ A helper method that supplies the root directory name given a timestamp. """ if timestamp is None: timestamp = self.timestamp if self.timestamp_format is not None: root_name = (time.strftime(self.timestamp_for...
def get_root_directory(self, timestamp=None): """ A helper method that supplies the root directory name given a timestamp. """ if timestamp is None: timestamp = self.timestamp if self.timestamp_format is not None: root_name = (time.strftime(self.timestamp_for...
[ "A", "helper", "method", "that", "supplies", "the", "root", "directory", "name", "given", "a", "timestamp", "." ]
ioam/lancet
python
https://github.com/ioam/lancet/blob/1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e/lancet/launch.py#L462-L476
[ "def", "get_root_directory", "(", "self", ",", "timestamp", "=", "None", ")", ":", "if", "timestamp", "is", "None", ":", "timestamp", "=", "self", ".", "timestamp", "if", "self", ".", "timestamp_format", "is", "not", "None", ":", "root_name", "=", "(", "...
1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e
valid
Launcher._append_log
The log contains the tids and corresponding specifications used during launch with the specifications in JSON format.
lancet/launch.py
def _append_log(self, specs): """ The log contains the tids and corresponding specifications used during launch with the specifications in JSON format. """ self._spec_log += specs # This should be removed log_path = os.path.join(self.root_directory, ("%s.log" % self.batch...
def _append_log(self, specs): """ The log contains the tids and corresponding specifications used during launch with the specifications in JSON format. """ self._spec_log += specs # This should be removed log_path = os.path.join(self.root_directory, ("%s.log" % self.batch...
[ "The", "log", "contains", "the", "tids", "and", "corresponding", "specifications", "used", "during", "launch", "with", "the", "specifications", "in", "JSON", "format", "." ]
ioam/lancet
python
https://github.com/ioam/lancet/blob/1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e/lancet/launch.py#L478-L485
[ "def", "_append_log", "(", "self", ",", "specs", ")", ":", "self", ".", "_spec_log", "+=", "specs", "# This should be removed", "log_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "root_directory", ",", "(", "\"%s.log\"", "%", "self", ".", ...
1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e
valid
Launcher._record_info
All launchers should call this method to write the info file at the end of the launch. The .info file is saved given setup_info supplied by _setup_launch into the root_directory. When called without setup_info, the existing info file is updated with the end-time.
lancet/launch.py
def _record_info(self, setup_info=None): """ All launchers should call this method to write the info file at the end of the launch. The .info file is saved given setup_info supplied by _setup_launch into the root_directory. When called without setup_info, the existing inf...
def _record_info(self, setup_info=None): """ All launchers should call this method to write the info file at the end of the launch. The .info file is saved given setup_info supplied by _setup_launch into the root_directory. When called without setup_info, the existing inf...
[ "All", "launchers", "should", "call", "this", "method", "to", "write", "the", "info", "file", "at", "the", "end", "of", "the", "launch", ".", "The", ".", "info", "file", "is", "saved", "given", "setup_info", "supplied", "by", "_setup_launch", "into", "the"...
ioam/lancet
python
https://github.com/ioam/lancet/blob/1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e/lancet/launch.py#L487-L512
[ "def", "_record_info", "(", "self", ",", "setup_info", "=", "None", ")", ":", "info_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "root_directory", ",", "(", "'%s.info'", "%", "self", ".", "batch_name", ")", ")", "if", "setup_info", "is...
1fbbf88fa0e8974ff9ed462e3cb11722ddebdd6e