diff --git a/404.html b/404.html index 9b8fa09a..8de05558 100644 --- a/404.html +++ b/404.html @@ -3,11 +3,11 @@ -Page Not Found | BrainDance - - +Page Not Found | BrainDance + + -
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

+
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

\ No newline at end of file diff --git a/assets/js/0c0d280c.5d6d46a2.js b/assets/js/0c0d280c.f4400746.js similarity index 97% rename from assets/js/0c0d280c.5d6d46a2.js rename to assets/js/0c0d280c.f4400746.js index a4d065cd..982b5d10 100644 --- a/assets/js/0c0d280c.5d6d46a2.js +++ b/assets/js/0c0d280c.f4400746.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[21],{2718:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>d});var r=n(4848),i=n(8453);const a={},s="module train.py",o={id:"docs/train.py",title:"train.py",description:"---",source:"@site/docs/docs/train.py.mdx",sourceDirName:"docs",slug:"/docs/train.py",permalink:"/BrainDance/docs/docs/train.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/train.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"spikedetector.py",permalink:"/BrainDance/docs/docs/spikedetector.py"},next:{title:"trainer.py",permalink:"/BrainDance/docs/docs/trainer.py"}},c={},d=[{value:"function train_detection_model",id:"function-train_detection_model",level:2},{value:"function main",id:"function-main",level:2}];function l(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/train.py#L0",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsx)(t.header,{children:(0,r.jsxs)(t.h1,{id:"module-trainpy",children:[(0,r.jsx)("kbd",{children:"module"})," ",(0,r.jsx)(t.code,{children:"train.py"})]})}),"\n",(0,r.jsx)(t.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/train.py#L11",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(t.h2,{id:"function-train_detection_model",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(t.code,{children:"train_detection_model"})]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"train_detection_model(\n recordings: list,\n dl_folder_name='dl_folder',\n validation_recording=None,\n thresh_amp=18.88275,\n thresh_std=0.6,\n sample_size_ms=10,\n recording_spike_before_ms=2,\n recording_spike_after_ms=2,\n samples_per_waveform=2,\n num_wfs_probs=[0.5, 0.3, 0.12, 0.06, 0.02],\n isi_wf_min_ms=0.2,\n isi_wf_max_ms=None,\n learning_rate=0.000776,\n momentum=0.85,\n training_thresh=0.01,\n learning_rate_patience=5,\n learning_rate_decay=0.4,\n epoch_patience=10,\n max_num_epochs=200,\n batch_size=1,\n num_workers=0,\n shuffle=True,\n training_random_seed=231,\n input_scale=0.01,\n input_scale_decay=0.1,\n device='cuda',\n dtype=torch.float16,\n **run_kilosort2_kwargs\n)\n"})}),"\n",(0,r.jsx)(t.p,{children:"Train a DL detection model with :recording_files:"}),"\n",(0,r.jsx)(t.p,{children:"Params: General parameters: recordings: A list containing the recordings to use for training the detection model. The length recordings must be at least two. Each element can be one of the following:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Path to a recording file in .h5 or .nwb format"}),"\n",(0,r.jsx)(t.li,{children:"Path to a folder containing \u201csorted.npz\u201d and \u201cscaled_traces.npy\u201d. This is used if the recordings have already been sorted, and you do not want to re-sort them."}),"\n",(0,r.jsxs)(t.li,{children:["A recording object loaded with SpikeInterface. See SpikeInterface's Extractor Module (",(0,r.jsx)(t.a,{href:"https://spikeinterface.readthedocs.io/en/latest/modules/extractors.html",children:"https://spikeinterface.readthedocs.io/en/latest/modules/extractors.html"}),") for details dl_folder_name: For each recording that needs to be sorted, the results will be stored in the same folder as the recording in the folder dl_folder_name"]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Dataset parameters: thresh_amp: Only waveforms whose amplitude is at least thresh_amp (microvolts) will be selected to train and test the detection model thresh_std: Only waveforms in which the standard deviation of the trough divided by the amplitude is at most thresh_std will be selected to train and test the detection model sample_size_ms: The size of the input samples fed into the detection model (milliseconds) recording_spike_before_ms: When extracting noise from the recording, do not extract if there was a spike within recording_spike_before_ms milliseconds recording_spike_after_ms: When extracting noise from the recording, do not extract if there is a spike within recording_spike_after_ms milliseconds"}),"\n",(0,r.jsxs)(t.p,{children:["Training parameters: samples_per_waveform: The number of samples in an epoch equals samples_per_waveform * the total number of waveformsrms num_wfs_probs: The ith element refers to the probability (decimal) that i waveforms will appear in a training or validation sample. isi_wf_min_ms: If multiple waveforms are pasted into a sample, they must be at least isi_wf_min_ms milliseconds apart isi_wf_max_ms: If multiple waveforms are pasted into a sample, one waveform will be at most isi_wf_max_ms milliseconds apart from another waveform If None, there is no limit learning_rate: The learning rate to use for training momentum: The momentum value to use for training. See ",(0,r.jsx)(t.a,{href:"https://pytorch.org/docs/stable/generated/torch.optim.SGD.html",children:"https://pytorch.org/docs/stable/generated/torch.optim.SGD.html"})," training_thresh: If the validation loss does not decrease by training_thresh after an epoch, the patience counter increases by 1 If it does, the patience counter resets to 0 learning_rate_decay and learning_rate_patience: If the patience counter reaches learning_rate_patience, the learning rate decreases by a factor of learning_rate_decay epoch_patience: If the patience counter reacehs epoch_patience, training stops for the recording max_num_epochs: Training stops after max_num_epochs even if the validation loss continues to decrease batch_size: The batch size used for training num_workers: The number of workers used to load data. See ",(0,r.jsx)(t.a,{href:"https://pytorch.org/docs/stable/data.html#single-and-multi-process-data-loading",children:"https://pytorch.org/docs/stable/data.html#single-and-multi-process-data-loading"})," shuffle: Whether to randomly shuffle the training and validation data for each epoch training_random_seed The random seed set before trainings starts for reproducibility"]}),"\n",(0,r.jsx)(t.p,{children:"Detection model parameters: input_scale: The recording traces (\u03bcV) are multiplied by input_scale before being inputted into the detection model. If the training process indicates \u201cnan\u201d for the loss, then decrease input_scale because the traces are too large for the detection model. input_scale_decay: If loss is np.nan, reduce input_scale by factor of input_scale_decay"}),"\n",(0,r.jsx)(t.p,{children:'General parameters: device The device to use. "cuda" for GPU and "cpu" for CPU dtype The data type to use'}),"\n",(0,r.jsx)(t.p,{children:"run_kilosort2 parameters See braindance.core.spikesorter.kilosort2.py"}),"\n",(0,r.jsx)(t.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/train.py#L223",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(t.h2,{id:"function-main",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(t.code,{children:"main"})]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"main()\n"})}),"\n",(0,r.jsx)(t.hr,{}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsxs)(t.em,{children:["This file was automatically generated via ",(0,r.jsx)(t.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>o});var r=n(6540);const i={},a=r.createContext(i);function s(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[21],{2718:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>d});var r=n(4848),i=n(8453);const a={},s="module train.py",o={id:"docs/train.py",title:"train.py",description:"---",source:"@site/docs/docs/train.py.mdx",sourceDirName:"docs",slug:"/docs/train.py",permalink:"/braindance/docs/docs/train.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/train.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"spikedetector.py",permalink:"/braindance/docs/docs/spikedetector.py"},next:{title:"trainer.py",permalink:"/braindance/docs/docs/trainer.py"}},c={},d=[{value:"function train_detection_model",id:"function-train_detection_model",level:2},{value:"function main",id:"function-main",level:2}];function l(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/train.py#L0",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsx)(t.header,{children:(0,r.jsxs)(t.h1,{id:"module-trainpy",children:[(0,r.jsx)("kbd",{children:"module"})," ",(0,r.jsx)(t.code,{children:"train.py"})]})}),"\n",(0,r.jsx)(t.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/train.py#L11",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(t.h2,{id:"function-train_detection_model",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(t.code,{children:"train_detection_model"})]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"train_detection_model(\n recordings: list,\n dl_folder_name='dl_folder',\n validation_recording=None,\n thresh_amp=18.88275,\n thresh_std=0.6,\n sample_size_ms=10,\n recording_spike_before_ms=2,\n recording_spike_after_ms=2,\n samples_per_waveform=2,\n num_wfs_probs=[0.5, 0.3, 0.12, 0.06, 0.02],\n isi_wf_min_ms=0.2,\n isi_wf_max_ms=None,\n learning_rate=0.000776,\n momentum=0.85,\n training_thresh=0.01,\n learning_rate_patience=5,\n learning_rate_decay=0.4,\n epoch_patience=10,\n max_num_epochs=200,\n batch_size=1,\n num_workers=0,\n shuffle=True,\n training_random_seed=231,\n input_scale=0.01,\n input_scale_decay=0.1,\n device='cuda',\n dtype=torch.float16,\n **run_kilosort2_kwargs\n)\n"})}),"\n",(0,r.jsx)(t.p,{children:"Train a DL detection model with :recording_files:"}),"\n",(0,r.jsx)(t.p,{children:"Params: General parameters: recordings: A list containing the recordings to use for training the detection model. The length recordings must be at least two. Each element can be one of the following:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Path to a recording file in .h5 or .nwb format"}),"\n",(0,r.jsx)(t.li,{children:"Path to a folder containing \u201csorted.npz\u201d and \u201cscaled_traces.npy\u201d. This is used if the recordings have already been sorted, and you do not want to re-sort them."}),"\n",(0,r.jsxs)(t.li,{children:["A recording object loaded with SpikeInterface. See SpikeInterface's Extractor Module (",(0,r.jsx)(t.a,{href:"https://spikeinterface.readthedocs.io/en/latest/modules/extractors.html",children:"https://spikeinterface.readthedocs.io/en/latest/modules/extractors.html"}),") for details dl_folder_name: For each recording that needs to be sorted, the results will be stored in the same folder as the recording in the folder dl_folder_name"]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Dataset parameters: thresh_amp: Only waveforms whose amplitude is at least thresh_amp (microvolts) will be selected to train and test the detection model thresh_std: Only waveforms in which the standard deviation of the trough divided by the amplitude is at most thresh_std will be selected to train and test the detection model sample_size_ms: The size of the input samples fed into the detection model (milliseconds) recording_spike_before_ms: When extracting noise from the recording, do not extract if there was a spike within recording_spike_before_ms milliseconds recording_spike_after_ms: When extracting noise from the recording, do not extract if there is a spike within recording_spike_after_ms milliseconds"}),"\n",(0,r.jsxs)(t.p,{children:["Training parameters: samples_per_waveform: The number of samples in an epoch equals samples_per_waveform * the total number of waveformsrms num_wfs_probs: The ith element refers to the probability (decimal) that i waveforms will appear in a training or validation sample. isi_wf_min_ms: If multiple waveforms are pasted into a sample, they must be at least isi_wf_min_ms milliseconds apart isi_wf_max_ms: If multiple waveforms are pasted into a sample, one waveform will be at most isi_wf_max_ms milliseconds apart from another waveform If None, there is no limit learning_rate: The learning rate to use for training momentum: The momentum value to use for training. See ",(0,r.jsx)(t.a,{href:"https://pytorch.org/docs/stable/generated/torch.optim.SGD.html",children:"https://pytorch.org/docs/stable/generated/torch.optim.SGD.html"})," training_thresh: If the validation loss does not decrease by training_thresh after an epoch, the patience counter increases by 1 If it does, the patience counter resets to 0 learning_rate_decay and learning_rate_patience: If the patience counter reaches learning_rate_patience, the learning rate decreases by a factor of learning_rate_decay epoch_patience: If the patience counter reacehs epoch_patience, training stops for the recording max_num_epochs: Training stops after max_num_epochs even if the validation loss continues to decrease batch_size: The batch size used for training num_workers: The number of workers used to load data. See ",(0,r.jsx)(t.a,{href:"https://pytorch.org/docs/stable/data.html#single-and-multi-process-data-loading",children:"https://pytorch.org/docs/stable/data.html#single-and-multi-process-data-loading"})," shuffle: Whether to randomly shuffle the training and validation data for each epoch training_random_seed The random seed set before trainings starts for reproducibility"]}),"\n",(0,r.jsx)(t.p,{children:"Detection model parameters: input_scale: The recording traces (\u03bcV) are multiplied by input_scale before being inputted into the detection model. If the training process indicates \u201cnan\u201d for the loss, then decrease input_scale because the traces are too large for the detection model. input_scale_decay: If loss is np.nan, reduce input_scale by factor of input_scale_decay"}),"\n",(0,r.jsx)(t.p,{children:'General parameters: device The device to use. "cuda" for GPU and "cpu" for CPU dtype The data type to use'}),"\n",(0,r.jsx)(t.p,{children:"run_kilosort2 parameters See braindance.core.spikesorter.kilosort2.py"}),"\n",(0,r.jsx)(t.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/train.py#L223",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(t.h2,{id:"function-main",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(t.code,{children:"main"})]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:"main()\n"})}),"\n",(0,r.jsx)(t.hr,{}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsxs)(t.em,{children:["This file was automatically generated via ",(0,r.jsx)(t.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>o});var r=n(6540);const i={},a=r.createContext(i);function s(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0e384e19.536424a5.js b/assets/js/0e384e19.7667218b.js similarity index 97% rename from assets/js/0e384e19.536424a5.js rename to assets/js/0e384e19.7667218b.js index cbd272cc..7af967b5 100644 --- a/assets/js/0e384e19.536424a5.js +++ b/assets/js/0e384e19.7667218b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[976],{619:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>c});var a=r(4848),t=r(8453);const i={title:"BrainDance",description:"Neural stimulation framework for organoids and cultures with micro electrode arrays",slug:"/",sidebar_position:0},s="BrainDance",o={id:"intro",title:"BrainDance",description:"Neural stimulation framework for organoids and cultures with micro electrode arrays",source:"@site/docs/intro.md",sourceDirName:".",slug:"/",permalink:"/BrainDance/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/intro.md",tags:[],version:"current",sidebarPosition:0,frontMatter:{title:"BrainDance",description:"Neural stimulation framework for organoids and cultures with micro electrode arrays",slug:"/",sidebar_position:0},sidebar:"tutorialSidebar",next:{title:"Quick Start Guide",permalink:"/BrainDance/docs/quick-start"}},l={},c=[{value:"Key Features",id:"key-features",level:2},{value:"Getting Started",id:"getting-started",level:2},{value:"Example Experiment",id:"example-experiment",level:2},{value:"Learn More",id:"learn-more",level:2},{value:"Get Involved",id:"get-involved",level:2}];function d(e){const n={a:"a",code:"code",del:"del",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"braindance",children:"BrainDance"})}),"\n",(0,a.jsx)(n.p,{children:"BrainDance is a powerful framework for neural stimulation experiments with live tissue, such as organoids, using electrode arrays. It provides a flexible and intuitive interface for designing, executing, and analyzing complex stimulation experiments."}),"\n",(0,a.jsx)(n.h2,{id:"key-features",children:"Key Features"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"Modular Design"}),": Easily create and combine different experimental phases"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"Real-time Control"}),": Precise control over stimulation parameters and timing"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"Hardware Integration"}),": Seamless integration with MaxWell CMOS HD-MEAs"]}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"getting-started",children:"Getting Started"}),"\n",(0,a.jsxs)(n.p,{children:["Are you ready to start your neural stimulation experiments? Check out our ",(0,a.jsx)(n.a,{href:"quick-start",children:"Quick Start Guide"})," to set up BrainDance and run your first experiment."]}),"\n",(0,a.jsx)(n.h2,{id:"example-experiment",children:"Example Experiment"}),"\n",(0,a.jsx)(n.p,{children:"Here's a glimpse of what a BrainDance experiment looks like:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"from braindance.core.maxwell_env import MaxwellEnv\nfrom braindance.core.params import maxwell_params\nfrom braindance.core.phases import PhaseManager, NeuralSweepPhase, RecordPhase, FrequencyStimPhase\n\n# Set up environment\nparams = maxwell_params\nparams['save_dir'] = './causal_tetanus'\nparams['name'] = 'test'\nparams['max_time_sec'] = 60*60*3 # 3 hours\nenv = MaxwellEnv(**params)\n\n# Define experimental phases\nrecord_phase = RecordPhase(env, duration=60*18)\ncausal_phase = NeuralSweepPhase(env, neuron_list, amp_bounds=400, stim_freq=1, tag=\"Causal\", replicates=30)\ntetanus_phase = FrequencyStimPhase(env, tetanus_command, 10, duration=60*1, tag=\"Tetanus\")\n\n# Build and run the experiment\nphase_manager = PhaseManager(env, verbose=True)\nphase_manager.add_phase_group([record_phase, causal_phase, tetanus_phase])\nphase_manager.run()\n"})}),"\n",(0,a.jsx)(n.h2,{id:"learn-more",children:"Learn More"}),"\n",(0,a.jsx)(n.p,{children:"Explore our documentation to learn about:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"/docs/core-concepts",children:"Core Concepts"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.del,{children:"Experiment Design"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.del,{children:"Data Analysis"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.del,{children:"API Reference"})}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"get-involved",children:"Get Involved"}),"\n",(0,a.jsxs)(n.p,{children:["BrainDance is an open-source project. We welcome contributions and feedback from the scientific community. Check out our ",(0,a.jsx)(n.a,{href:"https://github.com/your-repo-link",children:"GitHub repository"})," to get involved!"]})]})}function u(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>s,x:()=>o});var a=r(6540);const t={},i=a.createContext(t);function s(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[976],{619:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>c});var a=r(4848),t=r(8453);const i={title:"BrainDance",description:"Neural stimulation framework for organoids and cultures with micro electrode arrays",slug:"/",sidebar_position:0},s="BrainDance",o={id:"intro",title:"BrainDance",description:"Neural stimulation framework for organoids and cultures with micro electrode arrays",source:"@site/docs/intro.md",sourceDirName:".",slug:"/",permalink:"/braindance/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/intro.md",tags:[],version:"current",sidebarPosition:0,frontMatter:{title:"BrainDance",description:"Neural stimulation framework for organoids and cultures with micro electrode arrays",slug:"/",sidebar_position:0},sidebar:"tutorialSidebar",next:{title:"Quick Start Guide",permalink:"/braindance/docs/quick-start"}},l={},c=[{value:"Key Features",id:"key-features",level:2},{value:"Getting Started",id:"getting-started",level:2},{value:"Example Experiment",id:"example-experiment",level:2},{value:"Learn More",id:"learn-more",level:2},{value:"Get Involved",id:"get-involved",level:2}];function d(e){const n={a:"a",code:"code",del:"del",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"braindance",children:"BrainDance"})}),"\n",(0,a.jsx)(n.p,{children:"BrainDance is a powerful framework for neural stimulation experiments with live tissue, such as organoids, using electrode arrays. It provides a flexible and intuitive interface for designing, executing, and analyzing complex stimulation experiments."}),"\n",(0,a.jsx)(n.h2,{id:"key-features",children:"Key Features"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"Modular Design"}),": Easily create and combine different experimental phases"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"Real-time Control"}),": Precise control over stimulation parameters and timing"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"Hardware Integration"}),": Seamless integration with MaxWell CMOS HD-MEAs"]}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"getting-started",children:"Getting Started"}),"\n",(0,a.jsxs)(n.p,{children:["Are you ready to start your neural stimulation experiments? Check out our ",(0,a.jsx)(n.a,{href:"quick-start",children:"Quick Start Guide"})," to set up BrainDance and run your first experiment."]}),"\n",(0,a.jsx)(n.h2,{id:"example-experiment",children:"Example Experiment"}),"\n",(0,a.jsx)(n.p,{children:"Here's a glimpse of what a BrainDance experiment looks like:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"from braindance.core.maxwell_env import MaxwellEnv\nfrom braindance.core.params import maxwell_params\nfrom braindance.core.phases import PhaseManager, NeuralSweepPhase, RecordPhase, FrequencyStimPhase\n\n# Set up environment\nparams = maxwell_params\nparams['save_dir'] = './causal_tetanus'\nparams['name'] = 'test'\nparams['max_time_sec'] = 60*60*3 # 3 hours\nenv = MaxwellEnv(**params)\n\n# Define experimental phases\nrecord_phase = RecordPhase(env, duration=60*18)\ncausal_phase = NeuralSweepPhase(env, neuron_list, amp_bounds=400, stim_freq=1, tag=\"Causal\", replicates=30)\ntetanus_phase = FrequencyStimPhase(env, tetanus_command, 10, duration=60*1, tag=\"Tetanus\")\n\n# Build and run the experiment\nphase_manager = PhaseManager(env, verbose=True)\nphase_manager.add_phase_group([record_phase, causal_phase, tetanus_phase])\nphase_manager.run()\n"})}),"\n",(0,a.jsx)(n.h2,{id:"learn-more",children:"Learn More"}),"\n",(0,a.jsx)(n.p,{children:"Explore our documentation to learn about:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"/docs/core-concepts",children:"Core Concepts"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.del,{children:"Experiment Design"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.del,{children:"Data Analysis"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.del,{children:"API Reference"})}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"get-involved",children:"Get Involved"}),"\n",(0,a.jsxs)(n.p,{children:["BrainDance is an open-source project. We welcome contributions and feedback from the scientific community. Check out our ",(0,a.jsx)(n.a,{href:"https://github.com/your-repo-link",children:"GitHub repository"})," to get involved!"]})]})}function u(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>s,x:()=>o});var a=r(6540);const t={},i=a.createContext(t);function s(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1437f731.e4534222.js b/assets/js/1437f731.e4534222.js deleted file mode 100644 index 3256fb7e..00000000 --- a/assets/js/1437f731.e4534222.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[743],{1296:e=>{e.exports=JSON.parse('{"categoryGeneratedIndex":{"title":"usage","description":"Usage of RT-Sort","slug":"/category/usage","permalink":"/BrainDance/docs/category/usage","sidebar":"tutorialSidebar","navigation":{"previous":{"title":"Installation","permalink":"/BrainDance/docs/RT-sort/installation"},"next":{"title":"Loading Detection Models","permalink":"/BrainDance/docs/RT-sort/usage/load-detection-model"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/1f61acc8.2dc5bad2.js b/assets/js/1f61acc8.55c49d3a.js similarity index 96% rename from assets/js/1f61acc8.2dc5bad2.js rename to assets/js/1f61acc8.55c49d3a.js index ef3d5775..a79053a4 100644 --- a/assets/js/1f61acc8.2dc5bad2.js +++ b/assets/js/1f61acc8.55c49d3a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[508],{9520:(e,n,c)=>{c.r(n),c.d(n,{assets:()=>r,contentTitle:()=>d,default:()=>h,frontMatter:()=>a,metadata:()=>l,toc:()=>t});var s=c(4848),i=c(8453);const a={},d="module dummy_maxlab.py",l={id:"docs/dummy_maxlab.py",title:"dummy_maxlab.py",description:"Global Variables",source:"@site/docs/docs/dummy_maxlab.py.mdx",sourceDirName:"docs",slug:"/docs/dummy_maxlab.py",permalink:"/BrainDance/docs/docs/dummy_maxlab.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/dummy_maxlab.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"data_loader.py",permalink:"/BrainDance/docs/docs/data_loader.py"},next:{title:"dummy_zmq_np.py",permalink:"/BrainDance/docs/docs/dummy_zmq_np.py"}},r={},t=[{value:"Global Variables",id:"global-variables",level:2},{value:"function send",id:"function-send",level:2},{value:"function send_raw",id:"function-send_raw",level:2},{value:"class Amplifier",id:"class-amplifier",level:2},{value:"function set_gain",id:"function-set_gain",level:3},{value:"class Core",id:"class-core",level:2},{value:"function enable_stimulation_power",id:"function-enable_stimulation_power",level:3},{value:"class Sequence",id:"class-sequence",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function append",id:"function-append",level:3},{value:"function send",id:"function-send-1",level:3},{value:"class chip",id:"class-chip",level:2},{value:"function DAC",id:"function-dac",level:3},{value:"function DelaySamples",id:"function-delaysamples",level:3},{value:"function StimulationUnit",id:"function-stimulationunit",level:3},{value:"function send",id:"function-send-2",level:3},{value:"function send_raw",id:"function-send_raw-1",level:3},{value:"class saving",id:"class-saving",level:2},{value:"class system",id:"class-system",level:2},{value:"function DelaySamples",id:"function-delaysamples-1",level:3},{value:"function Event",id:"function-event",level:3},{value:"class unit",id:"class-unit",level:2},{value:"function connect",id:"function-connect",level:3},{value:"function dac_source",id:"function-dac_source",level:3},{value:"function power_up",id:"function-power_up",level:3},{value:"function set_voltage_mode",id:"function-set_voltage_mode",level:3},{value:"class util",id:"class-util",level:2},{value:"function hpf",id:"function-hpf",level:3},{value:"function initialize",id:"function-initialize",level:3},{value:"function offset",id:"function-offset",level:3},{value:"function set_gain",id:"function-set_gain-1",level:3}];function o(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L0",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsx)(n.header,{children:(0,s.jsxs)(n.h1,{id:"module-dummy_maxlabpy",children:[(0,s.jsx)("kbd",{children:"module"})," ",(0,s.jsx)(n.code,{children:"dummy_maxlab.py"})]})}),"\n",(0,s.jsx)(n.h2,{id:"global-variables",children:(0,s.jsx)(n.strong,{children:"Global Variables"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.strong,{children:"DEBUG"})}),"\n"]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L219",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-send",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L224",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-send_raw",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send_raw"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send_raw(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-amplifier",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"Amplifier"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L36",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-set_gain",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"set_gain"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"set_gain(gain)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-core",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"Core"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L30",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-enable_stimulation_power",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"enable_stimulation_power"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"enable_stimulation_power(bool_value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-sequence",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"Sequence"})]}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L4",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L9",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-append",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"append"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"append(item)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L24",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-send-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-chip",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"chip"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L63",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-dac",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"DAC"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"DAC(channel, value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L69",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-delaysamples",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"DelaySamples"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"DelaySamples(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L75",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-stimulationunit",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"StimulationUnit"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"StimulationUnit(int_value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L129",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-send-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L135",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-send_raw-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send_raw"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send_raw(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-saving",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"saving"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-system",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"system"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L186",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-delaysamples-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"DelaySamples"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"DelaySamples(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L192",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-event",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"Event"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"Event(*args)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-unit",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"unit"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L47",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-connect",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"connect"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"connect(do_connect)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L57",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-dac_source",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"dac_source"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"dac_source(source)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L42",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-power_up",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"power_up"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"power_up(do_power_up)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L52",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-set_voltage_mode",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"set_voltage_mode"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"set_voltage_mode()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-util",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"util"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L214",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-hpf",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"hpf"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"hpf()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L204",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-initialize",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"initialize"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"initialize()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L199",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-offset",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"offset"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"offset()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L209",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-set_gain-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"set_gain"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"set_gain(gain)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.em,{children:["This file was automatically generated via ",(0,s.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}},8453:(e,n,c)=>{c.d(n,{R:()=>d,x:()=>l});var s=c(6540);const i={},a=s.createContext(i);function d(e){const n=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:d(e.components),s.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[508],{9520:(e,n,c)=>{c.r(n),c.d(n,{assets:()=>r,contentTitle:()=>a,default:()=>h,frontMatter:()=>d,metadata:()=>l,toc:()=>t});var s=c(4848),i=c(8453);const d={},a="module dummy_maxlab.py",l={id:"docs/dummy_maxlab.py",title:"dummy_maxlab.py",description:"Global Variables",source:"@site/docs/docs/dummy_maxlab.py.mdx",sourceDirName:"docs",slug:"/docs/dummy_maxlab.py",permalink:"/braindance/docs/docs/dummy_maxlab.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/dummy_maxlab.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"data_loader.py",permalink:"/braindance/docs/docs/data_loader.py"},next:{title:"dummy_zmq_np.py",permalink:"/braindance/docs/docs/dummy_zmq_np.py"}},r={},t=[{value:"Global Variables",id:"global-variables",level:2},{value:"function send",id:"function-send",level:2},{value:"function send_raw",id:"function-send_raw",level:2},{value:"class Amplifier",id:"class-amplifier",level:2},{value:"function set_gain",id:"function-set_gain",level:3},{value:"class Core",id:"class-core",level:2},{value:"function enable_stimulation_power",id:"function-enable_stimulation_power",level:3},{value:"class Sequence",id:"class-sequence",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function append",id:"function-append",level:3},{value:"function send",id:"function-send-1",level:3},{value:"class chip",id:"class-chip",level:2},{value:"function DAC",id:"function-dac",level:3},{value:"function DelaySamples",id:"function-delaysamples",level:3},{value:"function StimulationUnit",id:"function-stimulationunit",level:3},{value:"function send",id:"function-send-2",level:3},{value:"function send_raw",id:"function-send_raw-1",level:3},{value:"class saving",id:"class-saving",level:2},{value:"class system",id:"class-system",level:2},{value:"function DelaySamples",id:"function-delaysamples-1",level:3},{value:"function Event",id:"function-event",level:3},{value:"class unit",id:"class-unit",level:2},{value:"function connect",id:"function-connect",level:3},{value:"function dac_source",id:"function-dac_source",level:3},{value:"function power_up",id:"function-power_up",level:3},{value:"function set_voltage_mode",id:"function-set_voltage_mode",level:3},{value:"class util",id:"class-util",level:2},{value:"function hpf",id:"function-hpf",level:3},{value:"function initialize",id:"function-initialize",level:3},{value:"function offset",id:"function-offset",level:3},{value:"function set_gain",id:"function-set_gain-1",level:3}];function o(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L0",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsx)(n.header,{children:(0,s.jsxs)(n.h1,{id:"module-dummy_maxlabpy",children:[(0,s.jsx)("kbd",{children:"module"})," ",(0,s.jsx)(n.code,{children:"dummy_maxlab.py"})]})}),"\n",(0,s.jsx)(n.h2,{id:"global-variables",children:(0,s.jsx)(n.strong,{children:"Global Variables"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.strong,{children:"DEBUG"})}),"\n"]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L219",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-send",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L224",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-send_raw",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send_raw"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send_raw(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-amplifier",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"Amplifier"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L36",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-set_gain",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"set_gain"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"set_gain(gain)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-core",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"Core"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L30",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-enable_stimulation_power",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"enable_stimulation_power"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"enable_stimulation_power(bool_value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-sequence",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"Sequence"})]}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L4",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L9",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-append",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"append"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"append(item)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L24",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-send-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-chip",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"chip"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L63",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-dac",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"DAC"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"DAC(channel, value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L69",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-delaysamples",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"DelaySamples"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"DelaySamples(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L75",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-stimulationunit",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"StimulationUnit"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"StimulationUnit(int_value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L129",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-send-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L135",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-send_raw-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"send_raw"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"send_raw(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-saving",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"saving"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-system",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"system"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L186",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-delaysamples-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"DelaySamples"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"DelaySamples(value)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L192",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-event",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"Event"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"Event(*args)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-unit",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"unit"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L47",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-connect",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"connect"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"connect(do_connect)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L57",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-dac_source",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"dac_source"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"dac_source(source)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L42",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-power_up",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"power_up"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"power_up(do_power_up)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L52",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-set_voltage_mode",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"set_voltage_mode"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"set_voltage_mode()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-util",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"util"})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L214",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-hpf",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"hpf"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"hpf()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L204",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-initialize",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"initialize"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"initialize()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L199",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-offset",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"offset"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"offset()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_maxlab.py#L209",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-set_gain-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"set_gain"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"set_gain(gain)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.em,{children:["This file was automatically generated via ",(0,s.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}},8453:(e,n,c)=>{c.d(n,{R:()=>a,x:()=>l});var s=c(6540);const i={},d=s.createContext(i);function a(e){const n=s.useContext(d);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),s.createElement(d.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a49b7d55.2b630ce7.js b/assets/js/235bc87c.1467a832.js similarity index 56% rename from assets/js/a49b7d55.2b630ce7.js rename to assets/js/235bc87c.1467a832.js index b747c7d7..d9edf9dd 100644 --- a/assets/js/a49b7d55.2b630ce7.js +++ b/assets/js/235bc87c.1467a832.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[986],{5014:e=>{e.exports=JSON.parse('{"categoryGeneratedIndex":{"title":"RT-Sort","description":"RT-Sort: Real-time spike detection and sorting with millisecond latencies","slug":"/category/rt-sort","permalink":"/BrainDance/docs/category/rt-sort","sidebar":"tutorialSidebar","navigation":{"previous":{"title":"Core Concepts","permalink":"/BrainDance/docs/core-concepts"},"next":{"title":"Introduction to RT-Sort","permalink":"/BrainDance/docs/RT-sort/introduction"}}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[576],{6490:e=>{e.exports=JSON.parse('{"categoryGeneratedIndex":{"title":"RT-Sort","description":"RT-Sort: Real-time spike detection and sorting with millisecond latencies","slug":"/category/rt-sort","permalink":"/braindance/docs/category/rt-sort","sidebar":"tutorialSidebar","navigation":{"previous":{"title":"Core Concepts","permalink":"/braindance/docs/core-concepts"},"next":{"title":"Introduction to RT-Sort","permalink":"/braindance/docs/RT-sort/introduction"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/288dd688.b5a039de.js b/assets/js/288dd688.3ff6db1f.js similarity index 99% rename from assets/js/288dd688.b5a039de.js rename to assets/js/288dd688.3ff6db1f.js index 0611f79d..6bab4f58 100644 --- a/assets/js/288dd688.b5a039de.js +++ b/assets/js/288dd688.3ff6db1f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[267],{3961:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>h,frontMatter:()=>t,metadata:()=>l,toc:()=>a});var i=s(4848),c=s(8453);const t={},r="module maxwell_env.py",l={id:"docs/maxwell_env.py",title:"maxwell_env.py",description:"Global Variables",source:"@site/docs/docs/maxwell_env.py.mdx",sourceDirName:"docs",slug:"/docs/maxwell_env.py",permalink:"/BrainDance/docs/docs/maxwell_env.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/maxwell_env.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"dummy_zmq_np.py",permalink:"/BrainDance/docs/docs/dummy_zmq_np.py"},next:{title:"maxwell_utils.py",permalink:"/BrainDance/docs/docs/maxwell_utils.py"}},d={},a=[{value:"Global Variables",id:"global-variables",level:2},{value:"function stim_process",id:"function-stim_process",level:2},{value:"function find_process_by_port",id:"function-find_process_by_port",level:2},{value:"function stop_process_using_port",id:"function-stop_process_using_port",level:2},{value:"function init_maxone",id:"function-init_maxone",level:2},{value:"function init_maxone_settings",id:"function-init_maxone_settings",level:2},{value:"function setup_subscribers",id:"function-setup_subscribers",level:2},{value:"function select_electrodes",id:"function-select_electrodes",level:2},{value:"function power_cycle_stim_electrodes",id:"function-power_cycle_stim_electrodes",level:2},{value:"function disconnect_stim_electrodes",id:"function-disconnect_stim_electrodes",level:2},{value:"function connect_stim_electrodes",id:"function-connect_stim_electrodes",level:2},{value:"function parse_events_list",id:"function-parse_events_list",level:2},{value:"function parse_frame",id:"function-parse_frame",level:2},{value:"function receive_packet",id:"function-receive_packet",level:2},{value:"function socket_worker",id:"function-socket_worker",level:2},{value:"function plot_worker",id:"function-plot_worker",level:2},{value:"function ignore_first_packet",id:"function-ignore_first_packet",level:2},{value:"function ignore_remaining_packets",id:"function-ignore_remaining_packets",level:2},{value:"function launch_dummy_server",id:"function-launch_dummy_server",level:2},{value:"class Config",id:"class-config",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function get_channels",id:"function-get_channels",level:3},{value:"function get_channels_for_electrodes",id:"function-get_channels_for_electrodes",level:3},{value:"function get_electrodes",id:"function-get_electrodes",level:3},{value:"function get_num_channels",id:"function-get_num_channels",level:3},{value:"class MaxwellEnv",id:"class-maxwellenv",level:2},{value:"function __init__",id:"function-__init__-1",level:3},{value:"property dt",id:"property-dt",level:4},{value:"property stim_dt",id:"property-stim_dt",level:4},{value:"property stim_dts",id:"property-stim_dts",level:4},{value:"function clear_buffer",id:"function-clear_buffer",level:3},{value:"function close",id:"function-close",level:3},{value:"function connect_units",id:"function-connect_units",level:3},{value:"function disconnect_all",id:"function-disconnect_all",level:3},{value:"function get_observation",id:"function-get_observation",level:3},{value:"function reset",id:"function-reset",level:3},{value:"function start",id:"function-start",level:3},{value:"function step",id:"function-step",level:3},{value:"function time_elapsed",id:"function-time_elapsed",level:3},{value:"class MaxwellStim",id:"class-maxwellstim",level:2},{value:"function __init__",id:"function-__init__-2",level:3},{value:"class SpikeEvent",id:"class-spikeevent",level:2}];function o(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,c.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L0",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsx)(n.header,{children:(0,i.jsxs)(n.h1,{id:"module-maxwell_envpy",children:[(0,i.jsx)("kbd",{children:"module"})," ",(0,i.jsx)(n.code,{children:"maxwell_env.py"})]})}),"\n",(0,i.jsx)(n.h2,{id:"global-variables",children:(0,i.jsx)(n.strong,{children:"Global Variables"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"fs_ms"})}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L756",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-stim_process",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"stim_process"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"stim_process(\n stim_process_ready,\n stim_units,\n stim_ready,\n stim_shm_name,\n env_done,\n stim_amp=400,\n stim_length=100,\n stim_tag='stim'\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Params stim_amp mV of square wave stim_length us for each phase of the square wave"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L810",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-find_process_by_port",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"find_process_by_port"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"find_process_by_port(port)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L819",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-stop_process_using_port",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"stop_process_using_port"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"stop_process_using_port(port)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L834",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-init_maxone",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"init_maxone"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"init_maxone(\n config,\n stim_electrodes,\n filt=True,\n verbose=1,\n gain=512,\n cutoff='1Hz',\n spike_thresh=5,\n dummy=False\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize MaxOne, set electrodes, and setup subscribers."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"config"})})," (str): Path to the config file for the electrodes."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_electrodes"})})," (list): List of electrode numbers to stimulate."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"filt"})})," (bool): Whether to use the high-pass filter."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"verbose"})})," (int): Verbosity level. 0: No print statements, 1: Print initialization statements, 2: Print all statements."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"gain"})})," (int): Gain of the amplifier. Options: 512, 1024, 2048."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"cutoff"})})," (str): Cutoff frequency of the high-pass filter. Options: '1Hz', '300Hz'."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"spike_thresh"})})," (int): Threshold for spike detection, in units of standard deviations."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"dummy"})})," (bool): Whether to use dummy data."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"tuple"})}),": A tuple containing the subscriber, stimulation units, and stimulation electrodes dictionary."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L866",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-init_maxone_settings",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"init_maxone_settings"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"init_maxone_settings(\n gain=512,\n amp_gain=512,\n cutoff='1Hz',\n spike_thresh=5,\n verbose=1\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize MaxOne and set gain and high-pass filter"}),"\n",(0,i.jsxs)(n.p,{children:["Parameters\n---------- gain : int, ",2048]}),"\n",(0,i.jsx)(n.p,{children:"amp_gain : int"}),"\n",(0,i.jsxs)(n.p,{children:["cutoff : str, ","300Hz"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L901",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-setup_subscribers",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"setup_subscribers"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"setup_subscribers(filt, verbose=1)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Setup subscribers for events from MaxOne, this allows us to read the data from the chip."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L920",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-select_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"select_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"select_electrodes(config, stim_electrodes, verbose=1, dummy=False)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L977",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-power_cycle_stim_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"power_cycle_stim_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"power_cycle_stim_electrodes(stim_units)\n"})}),"\n",(0,i.jsx)(n.p,{children:'"Power up and down again all the stimulation units. It appears this is needed to equilibrate the electrodes"'}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"from maxwell code"}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L999",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-disconnect_stim_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"disconnect_stim_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"disconnect_stim_electrodes(stim_units)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Disconnect each stimulation unit in the list."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1006",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-connect_stim_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"connect_stim_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"connect_stim_electrodes(stim_units)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Connect each stimulation unit in the list."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1014",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-parse_events_list",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"parse_events_list"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"parse_events_list(events_data)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Parse the raw binary events data into a list of SpikeEvent objects."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1039",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-parse_frame",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"parse_frame"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"parse_frame(frame_data)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Parse the binary frame data into an array of floating-point voltages."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1046",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-receive_packet",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"receive_packet"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"receive_packet(subscriber, buffer_size=None)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Use the subscriber to capture the frame and event data from the server. Returns an integer frame_number as well as data buffers for the voltage data frame and the spike events. Also sets the current time."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1103",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-socket_worker",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"socket_worker"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"socket_worker(data_queue, event_queue, subscriber_args)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Worker function that reads from the ZeroMQ socket."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1115",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_worker",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_worker"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_worker(queue)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1149",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-ignore_first_packet",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"ignore_first_packet"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"ignore_first_packet(subscriber, verbose=1)\n"})}),"\n",(0,i.jsx)(n.p,{children:"This first loop ignores any partial packets to make sure the real loop gets aligned to an actual frame. First it spins for as long as recv() fails, then it waits for the RCVMORE flag to be False to check that the last partial frame is over."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1172",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-ignore_remaining_packets",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"ignore_remaining_packets"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"ignore_remaining_packets(subscriber, verbose=1)\n"})}),"\n",(0,i.jsx)(n.p,{children:"This function reads and discards all remaining data in the buffer. It uses a non-blocking recv() to ensure that it only reads available data and stops when there are no more packets."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1192",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-launch_dummy_server",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"launch_dummy_server"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"launch_dummy_server(dummy)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-config",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"Config"})]}),"\n",(0,i.jsx)(n.p,{children:"Class to handle configuration file parsing and management."}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1226",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-__init__",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"__init__"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"__init__(filename)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize the Config object."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"filename"})})," (str): Path to the configuration file."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1247",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_channels",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_channels"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_channels()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get all channels from the configuration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"list"})}),": List of channel numbers."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1265",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_channels_for_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_channels_for_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_channels_for_electrodes(electrodes)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get channels corresponding to given electrodes."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"electrodes"})})," (list): List of electrode numbers."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"list"})}),": List of corresponding channel numbers."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1256",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_electrodes()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get all electrodes from the configuration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"list"})}),": List of electrode numbers."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1277",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_num_channels",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_num_channels"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_num_channels()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get the total number of channels in the configuration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"int"})}),": Number of channels."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-maxwellenv",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"MaxwellEnv"})]}),"\n",(0,i.jsx)(n.p,{children:"The MaxwellEnv class extends from the BaseEnv class and implements a specific environment for running experiments on MaxWell's MaxOne system. This class is used to interact with the MaxOne system, receive data, and send stimulation commands."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"config"})})," (str): Stores the config filepath in order to easily reload the array."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"name"})})," (str): Stores the name of the environment instance."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"max_time_sec"})})," (int): Stores the maximum experiment time."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"save_file"})})," (str): The file where the data will be saved."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_electrodes"})})," (list): Stores the list of electrodes for stimulation."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"verbose"})})," (int): Controls the verbosity of the environment's operations."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"array"})})," (None): Initialized as None, to be updated in sub-classes as needed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"subscriber"})})," (None): Initialized as None, to be updated in sub-classes as needed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"save_dir"})})," (str): Stores the directory where the simulation data will be saved."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"is_stimulation"})})," (bool): A flag that indicates whether a stimulation is going to occur."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_log_file"})})," (str or None): The file where the log of the stimulation is saved. If no stimulation is going to occur, this is None."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_units"})})," (None): Initialized as None, to be updated in sub-classes as needed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_electrodes_dict"})})," (None): Initialized as None, to be updated in sub-classes as needed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"start_time"})})," (float): The time when the environment is initialized."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"cur_time"})})," (float): The current time, updated at each step."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"last_stim_time"})})," (float): The time when the last stimulation occurred."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"smoke_test"})})," (bool): A flag that indicates whether the environment is being used for a smoke test."]}),"\n"]}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L69",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-__init__-1",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"__init__"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"__init__(\n config,\n name='',\n stim_electrodes=[],\n max_time_sec=60,\n save_dir='data',\n multiprocess=False,\n render=False,\n filt=False,\n observation_type='spikes',\n verbose=1,\n smoke_test=False,\n dummy=None,\n start=True\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize the Maxwell environment."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"config"})})," (str): A path to the maxwell config file. This is usually made by the Maxwell GUI, and contains the information about the array."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"name"})})," (str): The name of the environment instance. This is used for saving data."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_electrodes"})})," (list): A list of electrodes for stimulation. If no electrodes are specified, no stimulation will occur."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"max_time_sec"})})," (int): The maximum experiment time in seconds."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"save_dir"})})," (str): The directory where the stimulation data will be saved."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"filt"})})," (bool): A flag that indicates whether a filter should be applied to the data. The filter is onboard the chip, and is applied to the data before it is sent to the computer. It adds ~100ms of latency."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"observation_type"})})," (str): A string that indicates the type of observation that the environment should return. 'spikes' returns a list of spike events 'raw' returns the raw datastream frame with shape (ch,1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"verbose"})})," (int): An integer that controls the verbosity of the environment's operations. 0 is silent, 1 is verbose."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"smoke_test"})})," (bool): A flag that indicates whether the environment is being used for a smoke test. If True, the environment will not save any data, will use dummy logic, and no hardware will be used."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"dummy"})})," (str): A flag that will indicate whether to use a dummy maxwell server. 'sine' will use a sine wave for the data ",(0,i.jsx)(n.em,{children:"filepath"})," will use the first 30 seconds of data from the filepath None will use the real maxwell server"]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h4,{id:"property-dt",children:[(0,i.jsx)("kbd",{children:"property"})," dt"]}),"\n",(0,i.jsx)(n.p,{children:"Returns time since the last step."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h4,{id:"property-stim_dt",children:[(0,i.jsx)("kbd",{children:"property"})," stim_dt"]}),"\n",(0,i.jsx)(n.p,{children:"Returns time since last stimulation."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h4,{id:"property-stim_dts",children:[(0,i.jsx)("kbd",{children:"property"})," stim_dts"]}),"\n",(0,i.jsx)(n.p,{children:"Returns time since last stimulation."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L244",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-clear_buffer",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"clear_buffer"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"clear_buffer(\n num_successive_waits=10,\n min_wait_f=0.5,\n buffer_size=10,\n samp_freq_hz=20000\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Clear the ZMQ socket buffer, so self.step() returns latest data."}),"\n",(0,i.jsx)(n.p,{children:"This is done by waiting until the time to receive buffer_size frames is at least to min_wait_f*buffer_size for num_successive_waits successive method calls. There are two buffers: the ZMQ socket buffer and buffer_size used in self.step(buffer_size=buffer_size)."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"num_successive_waits"})})," (int): Number of successive waits before considering the buffer cleared."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"min_wait_f"})})," (float): Minimum wait factor."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"buffer_size"})})," (int): Size of the buffer."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"samp_freq_hz"})})," (int): Sampling frequency in Hz."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L407",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-close",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"close"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"close()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Shuts down the environment and saves the data."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L669",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-connect_units",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"connect_units"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"connect_units(units=None, inds=None)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Connect the specified stimulation units."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L661",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-disconnect_all",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"disconnect_all"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"disconnect_all()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Disconnect all stimulation units."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L282",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_observation",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_observation"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_observation(buffer_size=None)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Create the observation from the electrodes or spike events."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"buffer_size"})})," (int, optional): Size of the buffer for raw data observation."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"list or numpy.ndarray"})}),": Observation data."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L208",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-reset",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"reset"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"reset()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Reset the environment"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L187",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-start",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"start"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"start()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Start the experiment by initializing time management, flushing the buffer, and starting the recording."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L332",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-step",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"step"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"step(action=None, tag=None, buffer_size=None)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Receive events published since last time step() was called. This includes spike events and raw datastream."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"action"})})," (list, optional): A list of stimulation commands. Each command is a tuple of the form (electrode_index, amplitude_mV, phase_length_us)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"tag"})})," (str, optional): A tag for the stimulation log."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"buffer_size"})})," (int, optional): Size of the buffer for observation."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"tuple"})}),": A tuple containing the observation and a boolean indicating if the episode is done."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L403",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-time_elapsed",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Returns time since initialization of the environment."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-maxwellstim",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"MaxwellStim"})]}),"\n",(0,i.jsx)(n.p,{children:"Used for stimulating electrodes in a parallel process"}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L686",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-__init__-2",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"__init__"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"__init__(stim_units)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-spikeevent",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"SpikeEvent"})]}),"\n",(0,i.jsx)(n.p,{children:"SpikeEvent(frame, channel, amplitude)"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["This file was automatically generated via ",(0,i.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>l});var i=s(6540);const c={},t=i.createContext(c);function r(e){const n=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:r(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[267],{3961:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>h,frontMatter:()=>t,metadata:()=>l,toc:()=>a});var i=s(4848),c=s(8453);const t={},r="module maxwell_env.py",l={id:"docs/maxwell_env.py",title:"maxwell_env.py",description:"Global Variables",source:"@site/docs/docs/maxwell_env.py.mdx",sourceDirName:"docs",slug:"/docs/maxwell_env.py",permalink:"/braindance/docs/docs/maxwell_env.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/maxwell_env.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"dummy_zmq_np.py",permalink:"/braindance/docs/docs/dummy_zmq_np.py"},next:{title:"maxwell_utils.py",permalink:"/braindance/docs/docs/maxwell_utils.py"}},d={},a=[{value:"Global Variables",id:"global-variables",level:2},{value:"function stim_process",id:"function-stim_process",level:2},{value:"function find_process_by_port",id:"function-find_process_by_port",level:2},{value:"function stop_process_using_port",id:"function-stop_process_using_port",level:2},{value:"function init_maxone",id:"function-init_maxone",level:2},{value:"function init_maxone_settings",id:"function-init_maxone_settings",level:2},{value:"function setup_subscribers",id:"function-setup_subscribers",level:2},{value:"function select_electrodes",id:"function-select_electrodes",level:2},{value:"function power_cycle_stim_electrodes",id:"function-power_cycle_stim_electrodes",level:2},{value:"function disconnect_stim_electrodes",id:"function-disconnect_stim_electrodes",level:2},{value:"function connect_stim_electrodes",id:"function-connect_stim_electrodes",level:2},{value:"function parse_events_list",id:"function-parse_events_list",level:2},{value:"function parse_frame",id:"function-parse_frame",level:2},{value:"function receive_packet",id:"function-receive_packet",level:2},{value:"function socket_worker",id:"function-socket_worker",level:2},{value:"function plot_worker",id:"function-plot_worker",level:2},{value:"function ignore_first_packet",id:"function-ignore_first_packet",level:2},{value:"function ignore_remaining_packets",id:"function-ignore_remaining_packets",level:2},{value:"function launch_dummy_server",id:"function-launch_dummy_server",level:2},{value:"class Config",id:"class-config",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function get_channels",id:"function-get_channels",level:3},{value:"function get_channels_for_electrodes",id:"function-get_channels_for_electrodes",level:3},{value:"function get_electrodes",id:"function-get_electrodes",level:3},{value:"function get_num_channels",id:"function-get_num_channels",level:3},{value:"class MaxwellEnv",id:"class-maxwellenv",level:2},{value:"function __init__",id:"function-__init__-1",level:3},{value:"property dt",id:"property-dt",level:4},{value:"property stim_dt",id:"property-stim_dt",level:4},{value:"property stim_dts",id:"property-stim_dts",level:4},{value:"function clear_buffer",id:"function-clear_buffer",level:3},{value:"function close",id:"function-close",level:3},{value:"function connect_units",id:"function-connect_units",level:3},{value:"function disconnect_all",id:"function-disconnect_all",level:3},{value:"function get_observation",id:"function-get_observation",level:3},{value:"function reset",id:"function-reset",level:3},{value:"function start",id:"function-start",level:3},{value:"function step",id:"function-step",level:3},{value:"function time_elapsed",id:"function-time_elapsed",level:3},{value:"class MaxwellStim",id:"class-maxwellstim",level:2},{value:"function __init__",id:"function-__init__-2",level:3},{value:"class SpikeEvent",id:"class-spikeevent",level:2}];function o(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,c.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L0",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsx)(n.header,{children:(0,i.jsxs)(n.h1,{id:"module-maxwell_envpy",children:[(0,i.jsx)("kbd",{children:"module"})," ",(0,i.jsx)(n.code,{children:"maxwell_env.py"})]})}),"\n",(0,i.jsx)(n.h2,{id:"global-variables",children:(0,i.jsx)(n.strong,{children:"Global Variables"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"fs_ms"})}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L756",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-stim_process",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"stim_process"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"stim_process(\n stim_process_ready,\n stim_units,\n stim_ready,\n stim_shm_name,\n env_done,\n stim_amp=400,\n stim_length=100,\n stim_tag='stim'\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Params stim_amp mV of square wave stim_length us for each phase of the square wave"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L810",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-find_process_by_port",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"find_process_by_port"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"find_process_by_port(port)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L819",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-stop_process_using_port",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"stop_process_using_port"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"stop_process_using_port(port)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L834",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-init_maxone",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"init_maxone"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"init_maxone(\n config,\n stim_electrodes,\n filt=True,\n verbose=1,\n gain=512,\n cutoff='1Hz',\n spike_thresh=5,\n dummy=False\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize MaxOne, set electrodes, and setup subscribers."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"config"})})," (str): Path to the config file for the electrodes."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_electrodes"})})," (list): List of electrode numbers to stimulate."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"filt"})})," (bool): Whether to use the high-pass filter."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"verbose"})})," (int): Verbosity level. 0: No print statements, 1: Print initialization statements, 2: Print all statements."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"gain"})})," (int): Gain of the amplifier. Options: 512, 1024, 2048."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"cutoff"})})," (str): Cutoff frequency of the high-pass filter. Options: '1Hz', '300Hz'."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"spike_thresh"})})," (int): Threshold for spike detection, in units of standard deviations."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"dummy"})})," (bool): Whether to use dummy data."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"tuple"})}),": A tuple containing the subscriber, stimulation units, and stimulation electrodes dictionary."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L866",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-init_maxone_settings",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"init_maxone_settings"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"init_maxone_settings(\n gain=512,\n amp_gain=512,\n cutoff='1Hz',\n spike_thresh=5,\n verbose=1\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize MaxOne and set gain and high-pass filter"}),"\n",(0,i.jsxs)(n.p,{children:["Parameters\n---------- gain : int, ",2048]}),"\n",(0,i.jsx)(n.p,{children:"amp_gain : int"}),"\n",(0,i.jsxs)(n.p,{children:["cutoff : str, ","300Hz"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L901",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-setup_subscribers",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"setup_subscribers"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"setup_subscribers(filt, verbose=1)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Setup subscribers for events from MaxOne, this allows us to read the data from the chip."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L920",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-select_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"select_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"select_electrodes(config, stim_electrodes, verbose=1, dummy=False)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L977",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-power_cycle_stim_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"power_cycle_stim_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"power_cycle_stim_electrodes(stim_units)\n"})}),"\n",(0,i.jsx)(n.p,{children:'"Power up and down again all the stimulation units. It appears this is needed to equilibrate the electrodes"'}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"from maxwell code"}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L999",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-disconnect_stim_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"disconnect_stim_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"disconnect_stim_electrodes(stim_units)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Disconnect each stimulation unit in the list."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1006",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-connect_stim_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"connect_stim_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"connect_stim_electrodes(stim_units)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Connect each stimulation unit in the list."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1014",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-parse_events_list",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"parse_events_list"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"parse_events_list(events_data)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Parse the raw binary events data into a list of SpikeEvent objects."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1039",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-parse_frame",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"parse_frame"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"parse_frame(frame_data)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Parse the binary frame data into an array of floating-point voltages."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1046",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-receive_packet",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"receive_packet"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"receive_packet(subscriber, buffer_size=None)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Use the subscriber to capture the frame and event data from the server. Returns an integer frame_number as well as data buffers for the voltage data frame and the spike events. Also sets the current time."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1103",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-socket_worker",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"socket_worker"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"socket_worker(data_queue, event_queue, subscriber_args)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Worker function that reads from the ZeroMQ socket."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1115",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_worker",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_worker"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_worker(queue)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1149",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-ignore_first_packet",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"ignore_first_packet"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"ignore_first_packet(subscriber, verbose=1)\n"})}),"\n",(0,i.jsx)(n.p,{children:"This first loop ignores any partial packets to make sure the real loop gets aligned to an actual frame. First it spins for as long as recv() fails, then it waits for the RCVMORE flag to be False to check that the last partial frame is over."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1172",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-ignore_remaining_packets",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"ignore_remaining_packets"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"ignore_remaining_packets(subscriber, verbose=1)\n"})}),"\n",(0,i.jsx)(n.p,{children:"This function reads and discards all remaining data in the buffer. It uses a non-blocking recv() to ensure that it only reads available data and stops when there are no more packets."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1192",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-launch_dummy_server",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"launch_dummy_server"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"launch_dummy_server(dummy)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-config",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"Config"})]}),"\n",(0,i.jsx)(n.p,{children:"Class to handle configuration file parsing and management."}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1226",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-__init__",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"__init__"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"__init__(filename)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize the Config object."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"filename"})})," (str): Path to the configuration file."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1247",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_channels",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_channels"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_channels()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get all channels from the configuration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"list"})}),": List of channel numbers."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1265",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_channels_for_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_channels_for_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_channels_for_electrodes(electrodes)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get channels corresponding to given electrodes."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"electrodes"})})," (list): List of electrode numbers."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"list"})}),": List of corresponding channel numbers."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1256",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_electrodes",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_electrodes"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_electrodes()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get all electrodes from the configuration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"list"})}),": List of electrode numbers."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L1277",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_num_channels",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_num_channels"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_num_channels()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get the total number of channels in the configuration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"int"})}),": Number of channels."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-maxwellenv",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"MaxwellEnv"})]}),"\n",(0,i.jsx)(n.p,{children:"The MaxwellEnv class extends from the BaseEnv class and implements a specific environment for running experiments on MaxWell's MaxOne system. This class is used to interact with the MaxOne system, receive data, and send stimulation commands."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Attributes:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"config"})})," (str): Stores the config filepath in order to easily reload the array."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"name"})})," (str): Stores the name of the environment instance."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"max_time_sec"})})," (int): Stores the maximum experiment time."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"save_file"})})," (str): The file where the data will be saved."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_electrodes"})})," (list): Stores the list of electrodes for stimulation."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"verbose"})})," (int): Controls the verbosity of the environment's operations."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"array"})})," (None): Initialized as None, to be updated in sub-classes as needed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"subscriber"})})," (None): Initialized as None, to be updated in sub-classes as needed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"save_dir"})})," (str): Stores the directory where the simulation data will be saved."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"is_stimulation"})})," (bool): A flag that indicates whether a stimulation is going to occur."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_log_file"})})," (str or None): The file where the log of the stimulation is saved. If no stimulation is going to occur, this is None."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_units"})})," (None): Initialized as None, to be updated in sub-classes as needed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_electrodes_dict"})})," (None): Initialized as None, to be updated in sub-classes as needed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"start_time"})})," (float): The time when the environment is initialized."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"cur_time"})})," (float): The current time, updated at each step."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"last_stim_time"})})," (float): The time when the last stimulation occurred."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"smoke_test"})})," (bool): A flag that indicates whether the environment is being used for a smoke test."]}),"\n"]}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L69",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-__init__-1",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"__init__"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"__init__(\n config,\n name='',\n stim_electrodes=[],\n max_time_sec=60,\n save_dir='data',\n multiprocess=False,\n render=False,\n filt=False,\n observation_type='spikes',\n verbose=1,\n smoke_test=False,\n dummy=None,\n start=True\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize the Maxwell environment."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"config"})})," (str): A path to the maxwell config file. This is usually made by the Maxwell GUI, and contains the information about the array."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"name"})})," (str): The name of the environment instance. This is used for saving data."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"stim_electrodes"})})," (list): A list of electrodes for stimulation. If no electrodes are specified, no stimulation will occur."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"max_time_sec"})})," (int): The maximum experiment time in seconds."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"save_dir"})})," (str): The directory where the stimulation data will be saved."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"filt"})})," (bool): A flag that indicates whether a filter should be applied to the data. The filter is onboard the chip, and is applied to the data before it is sent to the computer. It adds ~100ms of latency."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"observation_type"})})," (str): A string that indicates the type of observation that the environment should return. 'spikes' returns a list of spike events 'raw' returns the raw datastream frame with shape (ch,1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"verbose"})})," (int): An integer that controls the verbosity of the environment's operations. 0 is silent, 1 is verbose."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"smoke_test"})})," (bool): A flag that indicates whether the environment is being used for a smoke test. If True, the environment will not save any data, will use dummy logic, and no hardware will be used."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"dummy"})})," (str): A flag that will indicate whether to use a dummy maxwell server. 'sine' will use a sine wave for the data ",(0,i.jsx)(n.em,{children:"filepath"})," will use the first 30 seconds of data from the filepath None will use the real maxwell server"]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h4,{id:"property-dt",children:[(0,i.jsx)("kbd",{children:"property"})," dt"]}),"\n",(0,i.jsx)(n.p,{children:"Returns time since the last step."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h4,{id:"property-stim_dt",children:[(0,i.jsx)("kbd",{children:"property"})," stim_dt"]}),"\n",(0,i.jsx)(n.p,{children:"Returns time since last stimulation."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h4,{id:"property-stim_dts",children:[(0,i.jsx)("kbd",{children:"property"})," stim_dts"]}),"\n",(0,i.jsx)(n.p,{children:"Returns time since last stimulation."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L244",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-clear_buffer",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"clear_buffer"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"clear_buffer(\n num_successive_waits=10,\n min_wait_f=0.5,\n buffer_size=10,\n samp_freq_hz=20000\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Clear the ZMQ socket buffer, so self.step() returns latest data."}),"\n",(0,i.jsx)(n.p,{children:"This is done by waiting until the time to receive buffer_size frames is at least to min_wait_f*buffer_size for num_successive_waits successive method calls. There are two buffers: the ZMQ socket buffer and buffer_size used in self.step(buffer_size=buffer_size)."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"num_successive_waits"})})," (int): Number of successive waits before considering the buffer cleared."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"min_wait_f"})})," (float): Minimum wait factor."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"buffer_size"})})," (int): Size of the buffer."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"samp_freq_hz"})})," (int): Sampling frequency in Hz."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L407",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-close",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"close"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"close()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Shuts down the environment and saves the data."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L669",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-connect_units",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"connect_units"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"connect_units(units=None, inds=None)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Connect the specified stimulation units."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L661",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-disconnect_all",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"disconnect_all"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"disconnect_all()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Disconnect all stimulation units."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L282",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-get_observation",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_observation"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_observation(buffer_size=None)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Create the observation from the electrodes or spike events."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"buffer_size"})})," (int, optional): Size of the buffer for raw data observation."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"list or numpy.ndarray"})}),": Observation data."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L208",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-reset",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"reset"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"reset()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Reset the environment"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L187",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-start",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"start"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"start()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Start the experiment by initializing time management, flushing the buffer, and starting the recording."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L332",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-step",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"step"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"step(action=None, tag=None, buffer_size=None)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Receive events published since last time step() was called. This includes spike events and raw datastream."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"action"})})," (list, optional): A list of stimulation commands. Each command is a tuple of the form (electrode_index, amplitude_mV, phase_length_us)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"tag"})})," (str, optional): A tag for the stimulation log."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"buffer_size"})})," (int, optional): Size of the buffer for observation."]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"tuple"})}),": A tuple containing the observation and a boolean indicating if the episode is done."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L403",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-time_elapsed",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Returns time since initialization of the environment."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-maxwellstim",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"MaxwellStim"})]}),"\n",(0,i.jsx)(n.p,{children:"Used for stimulating electrodes in a parallel process"}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell_env.py#L686",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-__init__-2",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"__init__"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"__init__(stim_units)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-spikeevent",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"SpikeEvent"})]}),"\n",(0,i.jsx)(n.p,{children:"SpikeEvent(frame, channel, amplitude)"}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["This file was automatically generated via ",(0,i.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>l});var i=s(6540);const c={},t=i.createContext(c);function r(e){const n=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:r(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/323168e2.eb88699e.js b/assets/js/323168e2.d8a28722.js similarity index 92% rename from assets/js/323168e2.eb88699e.js rename to assets/js/323168e2.d8a28722.js index 86212fd0..ba84025b 100644 --- a/assets/js/323168e2.eb88699e.js +++ b/assets/js/323168e2.d8a28722.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[187],{8194:(e,s,a)=>{a.r(s),a.d(s,{assets:()=>i,contentTitle:()=>c,default:()=>p,frontMatter:()=>t,metadata:()=>o,toc:()=>l});var n=a(4848),r=a(8453);const t={},c="module params.py",o={id:"docs/params.py",title:"params.py",description:"Global Variables",source:"@site/docs/docs/params.py.mdx",sourceDirName:"docs",slug:"/docs/params.py",permalink:"/BrainDance/docs/docs/params.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/params.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"maxwell_utils.py",permalink:"/BrainDance/docs/docs/maxwell_utils.py"},next:{title:"phases.py",permalink:"/BrainDance/docs/docs/phases.py"}},i={},l=[{value:"Global Variables",id:"global-variables",level:2}];function d(e){const s={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/params.py#L0",children:(0,n.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,n.jsx)(s.header,{children:(0,n.jsxs)(s.h1,{id:"module-paramspy",children:[(0,n.jsx)("kbd",{children:"module"})," ",(0,n.jsx)(s.code,{children:"params.py"})]})}),"\n",(0,n.jsx)(s.h2,{id:"global-variables",children:(0,n.jsx)(s.strong,{children:"Global Variables"})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.strong,{children:"maxwell_params"})}),"\n"]}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsxs)(s.em,{children:["This file was automatically generated via ",(0,n.jsx)(s.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,s,a)=>{a.d(s,{R:()=>c,x:()=>o});var n=a(6540);const r={},t=n.createContext(r);function c(e){const s=n.useContext(t);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[187],{8194:(e,s,a)=>{a.r(s),a.d(s,{assets:()=>i,contentTitle:()=>c,default:()=>p,frontMatter:()=>t,metadata:()=>o,toc:()=>l});var n=a(4848),r=a(8453);const t={},c="module params.py",o={id:"docs/params.py",title:"params.py",description:"Global Variables",source:"@site/docs/docs/params.py.mdx",sourceDirName:"docs",slug:"/docs/params.py",permalink:"/braindance/docs/docs/params.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/params.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"maxwell_utils.py",permalink:"/braindance/docs/docs/maxwell_utils.py"},next:{title:"phases.py",permalink:"/braindance/docs/docs/phases.py"}},i={},l=[{value:"Global Variables",id:"global-variables",level:2}];function d(e){const s={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/params.py#L0",children:(0,n.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,n.jsx)(s.header,{children:(0,n.jsxs)(s.h1,{id:"module-paramspy",children:[(0,n.jsx)("kbd",{children:"module"})," ",(0,n.jsx)(s.code,{children:"params.py"})]})}),"\n",(0,n.jsx)(s.h2,{id:"global-variables",children:(0,n.jsx)(s.strong,{children:"Global Variables"})}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.strong,{children:"maxwell_params"})}),"\n"]}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsxs)(s.em,{children:["This file was automatically generated via ",(0,n.jsx)(s.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,s,a)=>{a.d(s,{R:()=>c,x:()=>o});var n=a(6540);const r={},t=n.createContext(r);function c(e){const s=n.useContext(t);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/32cca411.92bf7702.js b/assets/js/32cca411.19afdd11.js similarity index 97% rename from assets/js/32cca411.92bf7702.js rename to assets/js/32cca411.19afdd11.js index cd452fad..ecdc7ad6 100644 --- a/assets/js/32cca411.92bf7702.js +++ b/assets/js/32cca411.19afdd11.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[815],{5398:(e,a,n)=>{n.r(a),n.d(a,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>s,metadata:()=>d,toc:()=>o});var t=n(4848),i=n(8453);const s={},l="module data_loader.py",d={id:"docs/data_loader.py",title:"data_loader.py",description:"---",source:"@site/docs/docs/data_loader.py.mdx",sourceDirName:"docs",slug:"/docs/data_loader.py",permalink:"/BrainDance/docs/docs/data_loader.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/data_loader.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"base_env.py",permalink:"/BrainDance/docs/docs/base_env.py"},next:{title:"dummy_maxlab.py",permalink:"/BrainDance/docs/docs/dummy_maxlab.py"}},r={},o=[{value:"function load_info_maxwell",id:"function-load_info_maxwell",level:2},{value:"function load_mapping_maxwell",id:"function-load_mapping_maxwell",level:2},{value:"function load_data_maxwell",id:"function-load_data_maxwell",level:2},{value:"function convert_uint16_maxwell",id:"function-convert_uint16_maxwell",level:2},{value:"function load_windows_maxwell",id:"function-load_windows_maxwell",level:2},{value:"function load_stim_log",id:"function-load_stim_log",level:2},{value:"function apply_literal_eval_stim_log",id:"function-apply_literal_eval_stim_log",level:2},{value:"function get_stim_electrodes",id:"function-get_stim_electrodes",level:2},{value:"function load_windows",id:"function-load_windows",level:2}];function c(e){const a={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L0",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsx)(a.header,{children:(0,t.jsxs)(a.h1,{id:"module-data_loaderpy",children:[(0,t.jsx)("kbd",{children:"module"})," ",(0,t.jsx)(a.code,{children:"data_loader.py"})]})}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L9",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_info_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_info_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_info_maxwell(filepath)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Loads metadata from a maxwell file"}),"\n",(0,t.jsx)(a.p,{children:"Parameters\n---------- filepath : str path to maxwell file"}),"\n",(0,t.jsx)(a.p,{children:"Returns\n------- metadata : dict metadata dictionary"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L49",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_mapping_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_mapping_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_mapping_maxwell(filepath, channels=None)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Loads mapping from a maxwell file"}),"\n",(0,t.jsx)(a.p,{children:"Parameters\n---------- filepath : str path to maxwell file channels : list of int channels of interest"}),"\n",(0,t.jsx)(a.p,{children:"Returns\n------- mapping : dict mapping dictionary"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L93",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_data_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_data_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_data_maxwell(\n filepath,\n channels=None,\n start=0,\n length=-1,\n spikes=False,\n dtype=,\n suffix=None,\n verbose=False\n)\n"})}),"\n",(0,t.jsxs)(a.p,{children:["Loads specified amount of data from a maxwell file ",":param"," filepath: Path to filename.raw.h5 file ",":param"," channels: list of int Channels of interest ",":param"," start: int Starting frame (offset) of the datapoints to use ",":param"," length: int Length of datapoints to take ",":param"," spikes: bool Whether to only thresholded spikes or raw data ",":param"," dtype: np.dtype Data type to load ",":param"," suffix: str Suffix to add to filepath ",":param"," verbose: bool Whether to print errors"]}),"\n",(0,t.jsx)(a.p,{children:":return: dataset: nparray Dataset of datapoints."}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L215",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-convert_uint16_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"convert_uint16_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"convert_uint16_maxwell(data)\n"})}),"\n",(0,t.jsxs)(a.p,{children:["Converts uint16 data to float32 ",":param"," data: nparray Data to convert :return: data: nparray Converted data"]}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L231",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_windows_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_windows_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_windows_maxwell(filepath, starts, window_sz=2000, channels=None)\n"})}),"\n",(0,t.jsxs)(a.p,{children:["Loads a fixed window size from the list of starts ",":param"," filepath: Path to filename.raw.h5 file ",":param"," starts: list of int List of start frames ",":param"," window_sz: int Window size in frames ",":param"," channels: list of int"]}),"\n",(0,t.jsx)(a.p,{children:":return: dataset: nparray Dataset of datapoints."}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L263",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_stim_log",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_stim_log"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_stim_log(filepath, adjust=False, suffix='_log.csv')\n"})}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L288",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-apply_literal_eval_stim_log",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"apply_literal_eval_stim_log"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"apply_literal_eval_stim_log(stim_log)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Applies ast.literal_eval to the stim electrodes and stim pattern columns of the stim log needed because the columns are read as strings"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L297",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-get_stim_electrodes",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"get_stim_electrodes"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"get_stim_electrodes(stim_log)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Get the unique stim electrodes from the stim log"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L308",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_windows",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_windows"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_windows(\n metadata,\n exp,\n window_centers,\n window_sz,\n dtype=,\n channels=None\n)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Loads a window of data from an experiment window is in frames Parameters\n---------- metadata : dict metadata dictionary exp : str experiment name window_centers : list list of window centers in frames window_sz : int window size in frames dtype : np.dtype data type to load"}),"\n",(0,t.jsx)(a.p,{children:"Returns\n------- data : np.array (n_windows, n_channels, window_sz)"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)(a.p,{children:(0,t.jsxs)(a.em,{children:["This file was automatically generated via ",(0,t.jsx)(a.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:a}={...(0,i.R)(),...e.components};return a?(0,t.jsx)(a,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},8453:(e,a,n)=>{n.d(a,{R:()=>l,x:()=>d});var t=n(6540);const i={},s=t.createContext(i);function l(e){const a=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(a):{...a,...e}}),[a,e])}function d(e){let a;return a=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),t.createElement(s.Provider,{value:a},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[815],{5398:(e,a,n)=>{n.r(a),n.d(a,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>s,metadata:()=>d,toc:()=>o});var t=n(4848),i=n(8453);const s={},l="module data_loader.py",d={id:"docs/data_loader.py",title:"data_loader.py",description:"---",source:"@site/docs/docs/data_loader.py.mdx",sourceDirName:"docs",slug:"/docs/data_loader.py",permalink:"/braindance/docs/docs/data_loader.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/data_loader.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"base_env.py",permalink:"/braindance/docs/docs/base_env.py"},next:{title:"dummy_maxlab.py",permalink:"/braindance/docs/docs/dummy_maxlab.py"}},r={},o=[{value:"function load_info_maxwell",id:"function-load_info_maxwell",level:2},{value:"function load_mapping_maxwell",id:"function-load_mapping_maxwell",level:2},{value:"function load_data_maxwell",id:"function-load_data_maxwell",level:2},{value:"function convert_uint16_maxwell",id:"function-convert_uint16_maxwell",level:2},{value:"function load_windows_maxwell",id:"function-load_windows_maxwell",level:2},{value:"function load_stim_log",id:"function-load_stim_log",level:2},{value:"function apply_literal_eval_stim_log",id:"function-apply_literal_eval_stim_log",level:2},{value:"function get_stim_electrodes",id:"function-get_stim_electrodes",level:2},{value:"function load_windows",id:"function-load_windows",level:2}];function c(e){const a={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L0",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsx)(a.header,{children:(0,t.jsxs)(a.h1,{id:"module-data_loaderpy",children:[(0,t.jsx)("kbd",{children:"module"})," ",(0,t.jsx)(a.code,{children:"data_loader.py"})]})}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L9",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_info_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_info_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_info_maxwell(filepath)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Loads metadata from a maxwell file"}),"\n",(0,t.jsx)(a.p,{children:"Parameters\n---------- filepath : str path to maxwell file"}),"\n",(0,t.jsx)(a.p,{children:"Returns\n------- metadata : dict metadata dictionary"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L49",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_mapping_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_mapping_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_mapping_maxwell(filepath, channels=None)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Loads mapping from a maxwell file"}),"\n",(0,t.jsx)(a.p,{children:"Parameters\n---------- filepath : str path to maxwell file channels : list of int channels of interest"}),"\n",(0,t.jsx)(a.p,{children:"Returns\n------- mapping : dict mapping dictionary"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L93",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_data_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_data_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_data_maxwell(\n filepath,\n channels=None,\n start=0,\n length=-1,\n spikes=False,\n dtype=,\n suffix=None,\n verbose=False\n)\n"})}),"\n",(0,t.jsxs)(a.p,{children:["Loads specified amount of data from a maxwell file ",":param"," filepath: Path to filename.raw.h5 file ",":param"," channels: list of int Channels of interest ",":param"," start: int Starting frame (offset) of the datapoints to use ",":param"," length: int Length of datapoints to take ",":param"," spikes: bool Whether to only thresholded spikes or raw data ",":param"," dtype: np.dtype Data type to load ",":param"," suffix: str Suffix to add to filepath ",":param"," verbose: bool Whether to print errors"]}),"\n",(0,t.jsx)(a.p,{children:":return: dataset: nparray Dataset of datapoints."}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L215",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-convert_uint16_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"convert_uint16_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"convert_uint16_maxwell(data)\n"})}),"\n",(0,t.jsxs)(a.p,{children:["Converts uint16 data to float32 ",":param"," data: nparray Data to convert :return: data: nparray Converted data"]}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L231",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_windows_maxwell",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_windows_maxwell"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_windows_maxwell(filepath, starts, window_sz=2000, channels=None)\n"})}),"\n",(0,t.jsxs)(a.p,{children:["Loads a fixed window size from the list of starts ",":param"," filepath: Path to filename.raw.h5 file ",":param"," starts: list of int List of start frames ",":param"," window_sz: int Window size in frames ",":param"," channels: list of int"]}),"\n",(0,t.jsx)(a.p,{children:":return: dataset: nparray Dataset of datapoints."}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L263",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_stim_log",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_stim_log"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_stim_log(filepath, adjust=False, suffix='_log.csv')\n"})}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L288",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-apply_literal_eval_stim_log",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"apply_literal_eval_stim_log"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"apply_literal_eval_stim_log(stim_log)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Applies ast.literal_eval to the stim electrodes and stim pattern columns of the stim log needed because the columns are read as strings"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L297",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-get_stim_electrodes",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"get_stim_electrodes"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"get_stim_electrodes(stim_log)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Get the unique stim electrodes from the stim log"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/analysis/data_loader.py#L308",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(a.h2,{id:"function-load_windows",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(a.code,{children:"load_windows"})]}),"\n",(0,t.jsx)(a.pre,{children:(0,t.jsx)(a.code,{className:"language-python",children:"load_windows(\n metadata,\n exp,\n window_centers,\n window_sz,\n dtype=,\n channels=None\n)\n"})}),"\n",(0,t.jsx)(a.p,{children:"Loads a window of data from an experiment window is in frames Parameters\n---------- metadata : dict metadata dictionary exp : str experiment name window_centers : list list of window centers in frames window_sz : int window size in frames dtype : np.dtype data type to load"}),"\n",(0,t.jsx)(a.p,{children:"Returns\n------- data : np.array (n_windows, n_channels, window_sz)"}),"\n",(0,t.jsx)(a.hr,{}),"\n",(0,t.jsx)(a.p,{children:(0,t.jsxs)(a.em,{children:["This file was automatically generated via ",(0,t.jsx)(a.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:a}={...(0,i.R)(),...e.components};return a?(0,t.jsx)(a,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},8453:(e,a,n)=>{n.d(a,{R:()=>l,x:()=>d});var t=n(6540);const i={},s=t.createContext(i);function l(e){const a=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(a):{...a,...e}}),[a,e])}function d(e){let a;return a=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),t.createElement(s.Provider,{value:a},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3f9c0f90.a360e136.js b/assets/js/3f9c0f90.88e127bb.js similarity index 99% rename from assets/js/3f9c0f90.a360e136.js rename to assets/js/3f9c0f90.88e127bb.js index 8b780da6..78f2e8d9 100644 --- a/assets/js/3f9c0f90.a360e136.js +++ b/assets/js/3f9c0f90.88e127bb.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[573],{2160:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>h,frontMatter:()=>t,metadata:()=>r,toc:()=>l});var s=i(4848),c=i(8453);const t={},a="module phases.py",r={id:"docs/phases.py",title:"phases.py",description:"Experiment phases",source:"@site/docs/docs/phases.py.mdx",sourceDirName:"docs",slug:"/docs/phases.py",permalink:"/BrainDance/docs/docs/phases.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/phases.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"params.py",permalink:"/BrainDance/docs/docs/params.py"},next:{title:"plot.py",permalink:"/BrainDance/docs/docs/plot.py"}},d={},l=[{value:"class FrequencyStimPhase",id:"class-frequencystimphase",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function info",id:"function-info",level:3},{value:"function predicted_time",id:"function-predicted_time",level:3},{value:"function run",id:"function-run",level:3},{value:"function time_elapsed",id:"function-time_elapsed",level:3},{value:"class NeuralSweepPhase",id:"class-neuralsweepphase",level:2},{value:"function __init__",id:"function-__init__-1",level:3},{value:"function generate_stim_commands",id:"function-generate_stim_commands",level:3},{value:"function info",id:"function-info-1",level:3},{value:"function predicted_time",id:"function-predicted_time-1",level:3},{value:"function run",id:"function-run-1",level:3},{value:"function time_elapsed",id:"function-time_elapsed-1",level:3},{value:"class Phase",id:"class-phase",level:2},{value:"function __init__",id:"function-__init__-2",level:3},{value:"function info",id:"function-info-2",level:3},{value:"function predicted_time",id:"function-predicted_time-2",level:3},{value:"function run",id:"function-run-2",level:3},{value:"function time_elapsed",id:"function-time_elapsed-2",level:3},{value:"class PhaseManager",id:"class-phasemanager",level:2},{value:"function __init__",id:"function-__init__-3",level:3},{value:"function add_phase",id:"function-add_phase",level:3},{value:"function add_phase_group",id:"function-add_phase_group",level:3},{value:"function log_phase",id:"function-log_phase",level:3},{value:"function log_summary",id:"function-log_summary",level:3},{value:"function run",id:"function-run-3",level:3},{value:"function summary",id:"function-summary",level:3},{value:"class RecordPhase",id:"class-recordphase",level:2},{value:"function __init__",id:"function-__init__-4",level:3},{value:"function info",id:"function-info-3",level:3},{value:"function predicted_time",id:"function-predicted_time-3",level:3},{value:"function run",id:"function-run-4",level:3},{value:"function time_elapsed",id:"function-time_elapsed-3",level:3}];function o(e){const n={a:"a",br:"br",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L0",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsx)(n.header,{children:(0,s.jsxs)(n.h1,{id:"module-phasespy",children:[(0,s.jsx)("kbd",{children:"module"})," ",(0,s.jsx)(n.code,{children:"phases.py"})]})}),"\n",(0,s.jsx)(n.p,{children:"Experiment phases\n----------------- Phases act as parts of experiments which have a specific purpose, such as"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"spontaneous recording"}),"\n",(0,s.jsx)(n.li,{children:"amplitude sweep\n--- over a neuron to find the stimulus amplitude that elicits a spike"}),"\n",(0,s.jsxs)(n.li,{children:["frequency stimulation",(0,s.jsx)(n.br,{}),"\n","---to stimulate one or more neurons at a certain frequency"]}),"\n",(0,s.jsx)(n.li,{children:"custom\n---where users can build exact logic for stimulation"}),"\n"]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-frequencystimphase",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"FrequencyStimPhase"})]}),"\n",(0,s.jsx)(n.p,{children:"Phase for stimulating a command at a certain frequency"}),"\n",(0,s.jsx)(n.p,{children:"Parameters\n---------- env : base_env.BaseEnv The environment to run the phase in stim_command : stim command or list of stim commands If a single stim command, it will be repeated at the given frequency If a list of stim commands, each stim command will be run sequentially stim_freq : float, optional The frequency of the stimulation, by default 1 duration : int, optional The duration of the stimulation in seconds, by default 10 tag : str, list of str, optional The tag to use for the stimulation, by default 'frequency_stim' If a list of strings, each tag will be used for the corresponding stim command\n--- Must be the same length as stim_command verbose : bool, optional Whether to print out information about the stimulation, by default False connect_units : list, optional The units to connect to the stimulation electrodes, by default None, leaves as is If a list is input, the stimulation units of the corresponding indexes in the environmen will be connected."}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L438",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(\n env: BaseEnv,\n stim_command: list,\n stim_freq: float = 1,\n duration: int = 10,\n tag='frequency_stim',\n verbose=False,\n connect_units=None\n)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L506",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-info",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"info"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"info()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L37",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-predicted_time",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"predicted_time"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"predicted_time()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns the predicted time for the phase to run in seconds"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L464",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L34",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-time_elapsed",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-neuralsweepphase",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"NeuralSweepPhase"})]}),"\n",(0,s.jsx)(n.p,{children:"Sweep the amplitude of a stimulation to find the minimum amplitude that elicits a spike"}),"\n",(0,s.jsx)(n.p,{children:"Parameters\n---------- env : base_env.BaseEnv The environment to run the phase in neuron_list : list The neurons to stimulate amp_bounds : tuple The bounds of the amplitude sweep The step size defaults to 10% of the range, but if a third element is provided, it will be used as the number of steps (start, end, n_step) stim_freq : float, optional The frequency of the stimulation, by default 1 replicates : int The number of times to repeat the stimulation, by default 30 phase_length : int, optional The length of one of the phases in the stimulation pulse, by default 100 type : str, optional The type of amplitude sweep to perform, by default 'ran', determined by the order of the following characters"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"'r': Iterate through replicates"}),"\n",(0,s.jsx)(n.li,{children:"'a': Iterate through the amplitudes"}),"\n",(0,s.jsx)(n.li,{children:"'s': Iterate through the neurons If you put 'random', it will randomly iterate through everything Options:"}),"\n",(0,s.jsx)(n.li,{children:"'ran': First iterate through the replicates, then the amplitudes, then the neurons\n--- ex: (r1, a1, n1), (r2, a1, n1),...,(r1, a2, n1), (r2, a2, n1),..."}),"\n",(0,s.jsx)(n.li,{children:"'rna': First iterate through the replicates, then the neurons, then the amplitudes\n--- ex: (r1, a1, n1), (r2, a1, n1),...,(r1, a1, n2), (r2, a1, n2),..."}),"\n",(0,s.jsx)(n.li,{children:"'arn': First iterate through the amplitudes, then the replicates, then the neurons\n--- ex: (r1, a1, n1), (r1, a2, n1),...,(r2, a1, n1), (r2, a2, n1),..."}),"\n",(0,s.jsx)(n.li,{children:"etc."}),"\n"]}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L261",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(\n env: BaseEnv,\n neuron_list: list,\n amp_bounds=[150, 150, 1],\n stim_freq: float = 1,\n replicates=30,\n phase_length: int = 100,\n order='ran',\n single_connect=False,\n verbose=False,\n tag='neural_sweep'\n)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L301",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-generate_stim_commands",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"generate_stim_commands"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"generate_stim_commands()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Generates the stimulation commands for the amplitude sweep"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L397",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-info-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"info"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"info()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L37",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-predicted_time-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"predicted_time"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"predicted_time()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns the predicted time for the phase to run in seconds"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L350",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L34",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-time_elapsed-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-phase",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"Phase"})]}),"\n",(0,s.jsx)(n.p,{children:"Base class for all phases"}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L27",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(env: BaseEnv)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L41",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-info-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"info"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"info()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns a dictionary of information about the phase"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L37",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-predicted_time-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"predicted_time"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"predicted_time()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns the predicted time for the phase to run in seconds"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L31",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L34",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-time_elapsed-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-phasemanager",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"PhaseManager"})]}),"\n",(0,s.jsx)(n.p,{children:"Manages phases of an experiment"}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L50",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(env: BaseEnv, verbose=False)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L61",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-add_phase",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"add_phase"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"add_phase(phase: Phase)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L64",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-add_phase_group",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"add_phase_group"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"add_phase_group(phase_group: list)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Adds a group of phases to the manager, each group will belong to the same save file"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L79",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-log_phase",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"log_phase"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"log_phase(phase)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Appends the phase and filename to the log file"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L71",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-log_summary",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"log_summary"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"log_summary()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Logs the summary of the experiment to a text file"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L92",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L151",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-summary",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"summary"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"summary()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns a summary of the experiment as a string"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-recordphase",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"RecordPhase"})]}),"\n",(0,s.jsx)(n.p,{children:"Phase for recording spontaneous activity"}),"\n",(0,s.jsx)(n.p,{children:"Parameters\n---------- env : base_env.BaseEnv The environment to run the phase in duration : int The duration of the recording in seconds, by default 10"}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L201",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__-4",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(env: BaseEnv = None, duration: int = 10)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L217",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-info-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"info"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"info()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L37",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-predicted_time-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"predicted_time"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"predicted_time()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns the predicted time for the phase to run in seconds"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L206",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run-4",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run(env=None)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L34",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-time_elapsed-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.em,{children:["This file was automatically generated via ",(0,s.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>a,x:()=>r});var s=i(6540);const c={},t=s.createContext(c);function a(e){const n=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:a(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[573],{2160:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>h,frontMatter:()=>t,metadata:()=>r,toc:()=>l});var s=i(4848),c=i(8453);const t={},a="module phases.py",r={id:"docs/phases.py",title:"phases.py",description:"Experiment phases",source:"@site/docs/docs/phases.py.mdx",sourceDirName:"docs",slug:"/docs/phases.py",permalink:"/braindance/docs/docs/phases.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/phases.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"params.py",permalink:"/braindance/docs/docs/params.py"},next:{title:"plot.py",permalink:"/braindance/docs/docs/plot.py"}},d={},l=[{value:"class FrequencyStimPhase",id:"class-frequencystimphase",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function info",id:"function-info",level:3},{value:"function predicted_time",id:"function-predicted_time",level:3},{value:"function run",id:"function-run",level:3},{value:"function time_elapsed",id:"function-time_elapsed",level:3},{value:"class NeuralSweepPhase",id:"class-neuralsweepphase",level:2},{value:"function __init__",id:"function-__init__-1",level:3},{value:"function generate_stim_commands",id:"function-generate_stim_commands",level:3},{value:"function info",id:"function-info-1",level:3},{value:"function predicted_time",id:"function-predicted_time-1",level:3},{value:"function run",id:"function-run-1",level:3},{value:"function time_elapsed",id:"function-time_elapsed-1",level:3},{value:"class Phase",id:"class-phase",level:2},{value:"function __init__",id:"function-__init__-2",level:3},{value:"function info",id:"function-info-2",level:3},{value:"function predicted_time",id:"function-predicted_time-2",level:3},{value:"function run",id:"function-run-2",level:3},{value:"function time_elapsed",id:"function-time_elapsed-2",level:3},{value:"class PhaseManager",id:"class-phasemanager",level:2},{value:"function __init__",id:"function-__init__-3",level:3},{value:"function add_phase",id:"function-add_phase",level:3},{value:"function add_phase_group",id:"function-add_phase_group",level:3},{value:"function log_phase",id:"function-log_phase",level:3},{value:"function log_summary",id:"function-log_summary",level:3},{value:"function run",id:"function-run-3",level:3},{value:"function summary",id:"function-summary",level:3},{value:"class RecordPhase",id:"class-recordphase",level:2},{value:"function __init__",id:"function-__init__-4",level:3},{value:"function info",id:"function-info-3",level:3},{value:"function predicted_time",id:"function-predicted_time-3",level:3},{value:"function run",id:"function-run-4",level:3},{value:"function time_elapsed",id:"function-time_elapsed-3",level:3}];function o(e){const n={a:"a",br:"br",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L0",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsx)(n.header,{children:(0,s.jsxs)(n.h1,{id:"module-phasespy",children:[(0,s.jsx)("kbd",{children:"module"})," ",(0,s.jsx)(n.code,{children:"phases.py"})]})}),"\n",(0,s.jsx)(n.p,{children:"Experiment phases\n----------------- Phases act as parts of experiments which have a specific purpose, such as"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"spontaneous recording"}),"\n",(0,s.jsx)(n.li,{children:"amplitude sweep\n--- over a neuron to find the stimulus amplitude that elicits a spike"}),"\n",(0,s.jsxs)(n.li,{children:["frequency stimulation",(0,s.jsx)(n.br,{}),"\n","---to stimulate one or more neurons at a certain frequency"]}),"\n",(0,s.jsx)(n.li,{children:"custom\n---where users can build exact logic for stimulation"}),"\n"]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-frequencystimphase",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"FrequencyStimPhase"})]}),"\n",(0,s.jsx)(n.p,{children:"Phase for stimulating a command at a certain frequency"}),"\n",(0,s.jsx)(n.p,{children:"Parameters\n---------- env : base_env.BaseEnv The environment to run the phase in stim_command : stim command or list of stim commands If a single stim command, it will be repeated at the given frequency If a list of stim commands, each stim command will be run sequentially stim_freq : float, optional The frequency of the stimulation, by default 1 duration : int, optional The duration of the stimulation in seconds, by default 10 tag : str, list of str, optional The tag to use for the stimulation, by default 'frequency_stim' If a list of strings, each tag will be used for the corresponding stim command\n--- Must be the same length as stim_command verbose : bool, optional Whether to print out information about the stimulation, by default False connect_units : list, optional The units to connect to the stimulation electrodes, by default None, leaves as is If a list is input, the stimulation units of the corresponding indexes in the environmen will be connected."}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L438",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(\n env: BaseEnv,\n stim_command: list,\n stim_freq: float = 1,\n duration: int = 10,\n tag='frequency_stim',\n verbose=False,\n connect_units=None\n)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L506",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-info",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"info"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"info()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L37",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-predicted_time",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"predicted_time"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"predicted_time()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns the predicted time for the phase to run in seconds"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L464",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L34",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-time_elapsed",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-neuralsweepphase",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"NeuralSweepPhase"})]}),"\n",(0,s.jsx)(n.p,{children:"Sweep the amplitude of a stimulation to find the minimum amplitude that elicits a spike"}),"\n",(0,s.jsx)(n.p,{children:"Parameters\n---------- env : base_env.BaseEnv The environment to run the phase in neuron_list : list The neurons to stimulate amp_bounds : tuple The bounds of the amplitude sweep The step size defaults to 10% of the range, but if a third element is provided, it will be used as the number of steps (start, end, n_step) stim_freq : float, optional The frequency of the stimulation, by default 1 replicates : int The number of times to repeat the stimulation, by default 30 phase_length : int, optional The length of one of the phases in the stimulation pulse, by default 100 type : str, optional The type of amplitude sweep to perform, by default 'ran', determined by the order of the following characters"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"'r': Iterate through replicates"}),"\n",(0,s.jsx)(n.li,{children:"'a': Iterate through the amplitudes"}),"\n",(0,s.jsx)(n.li,{children:"'s': Iterate through the neurons If you put 'random', it will randomly iterate through everything Options:"}),"\n",(0,s.jsx)(n.li,{children:"'ran': First iterate through the replicates, then the amplitudes, then the neurons\n--- ex: (r1, a1, n1), (r2, a1, n1),...,(r1, a2, n1), (r2, a2, n1),..."}),"\n",(0,s.jsx)(n.li,{children:"'rna': First iterate through the replicates, then the neurons, then the amplitudes\n--- ex: (r1, a1, n1), (r2, a1, n1),...,(r1, a1, n2), (r2, a1, n2),..."}),"\n",(0,s.jsx)(n.li,{children:"'arn': First iterate through the amplitudes, then the replicates, then the neurons\n--- ex: (r1, a1, n1), (r1, a2, n1),...,(r2, a1, n1), (r2, a2, n1),..."}),"\n",(0,s.jsx)(n.li,{children:"etc."}),"\n"]}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L261",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(\n env: BaseEnv,\n neuron_list: list,\n amp_bounds=[150, 150, 1],\n stim_freq: float = 1,\n replicates=30,\n phase_length: int = 100,\n order='ran',\n single_connect=False,\n verbose=False,\n tag='neural_sweep'\n)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L301",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-generate_stim_commands",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"generate_stim_commands"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"generate_stim_commands()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Generates the stimulation commands for the amplitude sweep"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L397",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-info-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"info"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"info()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L37",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-predicted_time-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"predicted_time"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"predicted_time()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns the predicted time for the phase to run in seconds"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L350",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L34",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-time_elapsed-1",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-phase",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"Phase"})]}),"\n",(0,s.jsx)(n.p,{children:"Base class for all phases"}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L27",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(env: BaseEnv)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L41",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-info-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"info"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"info()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns a dictionary of information about the phase"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L37",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-predicted_time-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"predicted_time"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"predicted_time()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns the predicted time for the phase to run in seconds"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L31",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L34",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-time_elapsed-2",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-phasemanager",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"PhaseManager"})]}),"\n",(0,s.jsx)(n.p,{children:"Manages phases of an experiment"}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L50",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(env: BaseEnv, verbose=False)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L61",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-add_phase",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"add_phase"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"add_phase(phase: Phase)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L64",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-add_phase_group",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"add_phase_group"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"add_phase_group(phase_group: list)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Adds a group of phases to the manager, each group will belong to the same save file"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L79",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-log_phase",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"log_phase"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"log_phase(phase)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Appends the phase and filename to the log file"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L71",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-log_summary",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"log_summary"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"log_summary()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Logs the summary of the experiment to a text file"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L92",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L151",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-summary",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"summary"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"summary()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns a summary of the experiment as a string"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.h2,{id:"class-recordphase",children:[(0,s.jsx)("kbd",{children:"class"})," ",(0,s.jsx)(n.code,{children:"RecordPhase"})]}),"\n",(0,s.jsx)(n.p,{children:"Phase for recording spontaneous activity"}),"\n",(0,s.jsx)(n.p,{children:"Parameters\n---------- env : base_env.BaseEnv The environment to run the phase in duration : int The duration of the recording in seconds, by default 10"}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L201",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-__init__-4",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"__init__"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"__init__(env: BaseEnv = None, duration: int = 10)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L217",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-info-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"info"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"info()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L37",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-predicted_time-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"predicted_time"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"predicted_time()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Returns the predicted time for the phase to run in seconds"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L206",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-run-4",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"run"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"run(env=None)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/phases.py#L34",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h3,{id:"function-time_elapsed-3",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"time_elapsed"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"time_elapsed()\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.em,{children:["This file was automatically generated via ",(0,s.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>a,x:()=>r});var s=i(6540);const c={},t=s.createContext(c);function a(e){const n=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:a(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3ffd729a.e9fbd655.js b/assets/js/3ffd729a.7995d2b1.js similarity index 93% rename from assets/js/3ffd729a.e9fbd655.js rename to assets/js/3ffd729a.7995d2b1.js index fe13e911..1d3c8e18 100644 --- a/assets/js/3ffd729a.e9fbd655.js +++ b/assets/js/3ffd729a.7995d2b1.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[615],{7223:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>i,metadata:()=>a,toc:()=>c});var o=t(4848),s=t(8453);const i={sidebar_position:2},r="Installation",a={id:"RT-sort/installation",title:"Installation",description:"To install RT-Sort, follow these steps:",source:"@site/docs/RT-sort/installation.md",sourceDirName:"RT-sort",slug:"/RT-sort/installation",permalink:"/BrainDance/docs/RT-sort/installation",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/installation.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Introduction to RT-Sort",permalink:"/BrainDance/docs/RT-sort/introduction"},next:{title:"usage",permalink:"/BrainDance/docs/category/usage"}},l={},c=[];function d(e){const n={a:"a",code:"code",h1:"h1",header:"header",li:"li",ol:"ol",p:"p",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"installation",children:"Installation"})}),"\n",(0,o.jsx)(n.p,{children:"To install RT-Sort, follow these steps:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Visit the RT-Sort GitHub repository: ",(0,o.jsx)(n.a,{href:"https://github.com/braingeneers/BrainDance",children:"https://github.com/braingeneers/BrainDance"})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Follow the installation instructions provided in the repository's README file."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Ensure you have the necessary dependencies installed, including PyTorch and Torch-TensorRT."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["If you plan to use Kilosort2 for offline sorting, make sure to set up the ",(0,o.jsx)(n.code,{children:"KILOSORT_PATH"})," environment variable or be prepared to provide the path when calling relevant functions."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"After installation, you're ready to start using RT-Sort. Proceed to the usage guides to learn how to load detection models, perform sequence detection, and more."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var o=t(6540);const s={},i=o.createContext(s);function r(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[615],{7223:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>i,metadata:()=>a,toc:()=>c});var o=t(4848),s=t(8453);const i={sidebar_position:2},r="Installation",a={id:"RT-sort/installation",title:"Installation",description:"To install RT-Sort, follow these steps:",source:"@site/docs/RT-sort/installation.md",sourceDirName:"RT-sort",slug:"/RT-sort/installation",permalink:"/braindance/docs/RT-sort/installation",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/installation.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Introduction to RT-Sort",permalink:"/braindance/docs/RT-sort/introduction"},next:{title:"usage",permalink:"/braindance/docs/category/usage"}},l={},c=[];function d(e){const n={a:"a",code:"code",h1:"h1",header:"header",li:"li",ol:"ol",p:"p",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"installation",children:"Installation"})}),"\n",(0,o.jsx)(n.p,{children:"To install RT-Sort, follow these steps:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Visit the RT-Sort GitHub repository: ",(0,o.jsx)(n.a,{href:"https://github.com/braingeneers/BrainDance",children:"https://github.com/braingeneers/BrainDance"})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Follow the installation instructions provided in the repository's README file."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Ensure you have the necessary dependencies installed, including PyTorch and Torch-TensorRT."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["If you plan to use Kilosort2 for offline sorting, make sure to set up the ",(0,o.jsx)(n.code,{children:"KILOSORT_PATH"})," environment variable or be prepared to provide the path when calling relevant functions."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"After installation, you're ready to start using RT-Sort. Proceed to the usage guides to learn how to load detection models, perform sequence detection, and more."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var o=t(6540);const s={},i=o.createContext(s);function r(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/43cd4838.0a4ff310.js b/assets/js/43cd4838.42563a2a.js similarity index 96% rename from assets/js/43cd4838.0a4ff310.js rename to assets/js/43cd4838.42563a2a.js index a7b16417..8339dcd3 100644 --- a/assets/js/43cd4838.0a4ff310.js +++ b/assets/js/43cd4838.42563a2a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[184],{5146:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>t,toc:()=>l});var a=r(4848),s=r(8453);const i={sidebar_position:2},c="Core Concepts",t={id:"core-concepts",title:"Core Concepts",description:"Understanding the core concepts of BrainDance will help you design and execute more complex experiments.",source:"@site/docs/core-concepts.md",sourceDirName:".",slug:"/core-concepts",permalink:"/BrainDance/docs/core-concepts",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/core-concepts.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Quick Start Guide",permalink:"/BrainDance/docs/quick-start"},next:{title:"RT-Sort",permalink:"/BrainDance/docs/category/rt-sort"}},o={},l=[{value:"Maxwell Environment",id:"maxwell-environment",level:2},{value:"Phases",id:"phases",level:2},{value:"Phase Manager",id:"phase-manager",level:2}];function d(e){const n={code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"core-concepts",children:"Core Concepts"})}),"\n",(0,a.jsx)(n.p,{children:"Understanding the core concepts of BrainDance will help you design and execute more complex experiments."}),"\n",(0,a.jsx)(n.h2,{id:"maxwell-environment",children:"Maxwell Environment"}),"\n",(0,a.jsxs)(n.p,{children:["The ",(0,a.jsx)(n.code,{children:"MaxwellEnv"})," class is the central component that interfaces with the micro electrode array hardware. It handles:"]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Initialization of the hardware"}),"\n",(0,a.jsx)(n.li,{children:"Data acquisition"}),"\n",(0,a.jsx)(n.li,{children:"Stimulation control"}),"\n",(0,a.jsx)(n.li,{children:"Data saving"}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"Example usage:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"from braindance.core.maxwell_env import MaxwellEnv\nfrom braindance.core.params import maxwell_params\n\nparams = maxwell_params\nparams['save_dir'] = './experiment_data'\nparams['name'] = 'my_experiment'\nenv = MaxwellEnv(**params)\n"})}),"\n",(0,a.jsx)(n.h2,{id:"phases",children:"Phases"}),"\n",(0,a.jsx)(n.p,{children:"Phases are the building blocks of experiments in BrainDance. Each phase represents a specific experimental action or protocol. Common phase types include:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"RecordPhase"}),": Simple recording of neural activity"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"NeuralSweepPhase"}),": Systematic stimulation of specified electrodes"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"FrequencyStimPhase"}),": Stimulation at a specified frequency"]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"Example of creating a phase:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"from braindance.core.phases import RecordPhase\n\nrecord_phase = RecordPhase(env, duration=60*5) # 5-minute recording phase\n"})}),"\n",(0,a.jsx)(n.h2,{id:"phase-manager",children:"Phase Manager"}),"\n",(0,a.jsxs)(n.p,{children:["The ",(0,a.jsx)(n.code,{children:"PhaseManager"})," class orchestrates the execution of multiple phases in an experiment. It allows you to:"]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Add phases to the experiment"}),"\n",(0,a.jsx)(n.li,{children:"Specify the order of phase execution"}),"\n",(0,a.jsx)(n.li,{children:"Run the entire experiment"}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"Example usage:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"from braindance.core.phases import PhaseManager\n\nphase_manager = PhaseManager(env, verbose=True)\nphase_manager.add_phase_group([record_phase, stim_phase, record_phase])\nphase_manager.run()\n"})}),"\n",(0,a.jsx)(n.p,{children:"By combining these core concepts, you can create complex, multi-stage experiments with precise control over stimulation and recording parameters."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>c,x:()=>t});var a=r(6540);const s={},i=a.createContext(s);function c(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[184],{5146:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>t,toc:()=>l});var a=r(4848),s=r(8453);const i={sidebar_position:2},c="Core Concepts",t={id:"core-concepts",title:"Core Concepts",description:"Understanding the core concepts of BrainDance will help you design and execute more complex experiments.",source:"@site/docs/core-concepts.md",sourceDirName:".",slug:"/core-concepts",permalink:"/braindance/docs/core-concepts",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/core-concepts.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Quick Start Guide",permalink:"/braindance/docs/quick-start"},next:{title:"RT-Sort",permalink:"/braindance/docs/category/rt-sort"}},o={},l=[{value:"Maxwell Environment",id:"maxwell-environment",level:2},{value:"Phases",id:"phases",level:2},{value:"Phase Manager",id:"phase-manager",level:2}];function d(e){const n={code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"core-concepts",children:"Core Concepts"})}),"\n",(0,a.jsx)(n.p,{children:"Understanding the core concepts of BrainDance will help you design and execute more complex experiments."}),"\n",(0,a.jsx)(n.h2,{id:"maxwell-environment",children:"Maxwell Environment"}),"\n",(0,a.jsxs)(n.p,{children:["The ",(0,a.jsx)(n.code,{children:"MaxwellEnv"})," class is the central component that interfaces with the micro electrode array hardware. It handles:"]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Initialization of the hardware"}),"\n",(0,a.jsx)(n.li,{children:"Data acquisition"}),"\n",(0,a.jsx)(n.li,{children:"Stimulation control"}),"\n",(0,a.jsx)(n.li,{children:"Data saving"}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"Example usage:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"from braindance.core.maxwell_env import MaxwellEnv\nfrom braindance.core.params import maxwell_params\n\nparams = maxwell_params\nparams['save_dir'] = './experiment_data'\nparams['name'] = 'my_experiment'\nenv = MaxwellEnv(**params)\n"})}),"\n",(0,a.jsx)(n.h2,{id:"phases",children:"Phases"}),"\n",(0,a.jsx)(n.p,{children:"Phases are the building blocks of experiments in BrainDance. Each phase represents a specific experimental action or protocol. Common phase types include:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"RecordPhase"}),": Simple recording of neural activity"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"NeuralSweepPhase"}),": Systematic stimulation of specified electrodes"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"FrequencyStimPhase"}),": Stimulation at a specified frequency"]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"Example of creating a phase:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"from braindance.core.phases import RecordPhase\n\nrecord_phase = RecordPhase(env, duration=60*5) # 5-minute recording phase\n"})}),"\n",(0,a.jsx)(n.h2,{id:"phase-manager",children:"Phase Manager"}),"\n",(0,a.jsxs)(n.p,{children:["The ",(0,a.jsx)(n.code,{children:"PhaseManager"})," class orchestrates the execution of multiple phases in an experiment. It allows you to:"]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Add phases to the experiment"}),"\n",(0,a.jsx)(n.li,{children:"Specify the order of phase execution"}),"\n",(0,a.jsx)(n.li,{children:"Run the entire experiment"}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"Example usage:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"from braindance.core.phases import PhaseManager\n\nphase_manager = PhaseManager(env, verbose=True)\nphase_manager.add_phase_group([record_phase, stim_phase, record_phase])\nphase_manager.run()\n"})}),"\n",(0,a.jsx)(n.p,{children:"By combining these core concepts, you can create complex, multi-stage experiments with precise control over stimulation and recording parameters."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>c,x:()=>t});var a=r(6540);const s={},i=a.createContext(s);function c(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/496af695.65f8f330.js b/assets/js/496af695.263ebbdb.js similarity index 93% rename from assets/js/496af695.65f8f330.js rename to assets/js/496af695.263ebbdb.js index 1e256088..7e0fd279 100644 --- a/assets/js/496af695.65f8f330.js +++ b/assets/js/496af695.263ebbdb.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[315],{7188:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>r,contentTitle:()=>c,default:()=>u,frontMatter:()=>a,metadata:()=>i,toc:()=>o});var n=s(4848),l=s(8453);const a={},c="module maxwell_utils.py",i={id:"docs/maxwell_utils.py",title:"maxwell_utils.py",description:"---",source:"@site/docs/docs/maxwell_utils.py.mdx",sourceDirName:"docs",slug:"/docs/maxwell_utils.py",permalink:"/BrainDance/docs/docs/maxwell_utils.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/maxwell_utils.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"maxwell_env.py",permalink:"/BrainDance/docs/docs/maxwell_env.py"},next:{title:"params.py",permalink:"/BrainDance/docs/docs/params.py"}},r={},o=[{value:"function get_maxwell_status",id:"function-get_maxwell_status",level:2}];function d(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",...(0,l.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/maxwell_utils.py#L0",children:(0,n.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,n.jsx)(t.header,{children:(0,n.jsxs)(t.h1,{id:"module-maxwell_utilspy",children:[(0,n.jsx)("kbd",{children:"module"})," ",(0,n.jsx)(t.code,{children:"maxwell_utils.py"})]})}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/maxwell_utils.py#L8",children:(0,n.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,n.jsxs)(t.h2,{id:"function-get_maxwell_status",children:[(0,n.jsx)("kbd",{children:"function"})," ",(0,n.jsx)(t.code,{children:"get_maxwell_status"})]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-python",children:"get_maxwell_status()\n"})}),"\n",(0,n.jsx)(t.p,{children:"Get the status of the maxwell system. True if initialized, False otherwise."}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsxs)(t.em,{children:["This file was automatically generated via ",(0,n.jsx)(t.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function u(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>c,x:()=>i});var n=s(6540);const l={},a=n.createContext(l);function c(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:c(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[315],{7188:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>r,contentTitle:()=>c,default:()=>u,frontMatter:()=>a,metadata:()=>i,toc:()=>o});var n=s(4848),l=s(8453);const a={},c="module maxwell_utils.py",i={id:"docs/maxwell_utils.py",title:"maxwell_utils.py",description:"---",source:"@site/docs/docs/maxwell_utils.py.mdx",sourceDirName:"docs",slug:"/docs/maxwell_utils.py",permalink:"/braindance/docs/docs/maxwell_utils.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/maxwell_utils.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"maxwell_env.py",permalink:"/braindance/docs/docs/maxwell_env.py"},next:{title:"params.py",permalink:"/braindance/docs/docs/params.py"}},r={},o=[{value:"function get_maxwell_status",id:"function-get_maxwell_status",level:2}];function d(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",...(0,l.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/maxwell_utils.py#L0",children:(0,n.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,n.jsx)(t.header,{children:(0,n.jsxs)(t.h1,{id:"module-maxwell_utilspy",children:[(0,n.jsx)("kbd",{children:"module"})," ",(0,n.jsx)(t.code,{children:"maxwell_utils.py"})]})}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/maxwell_utils.py#L8",children:(0,n.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,n.jsxs)(t.h2,{id:"function-get_maxwell_status",children:[(0,n.jsx)("kbd",{children:"function"})," ",(0,n.jsx)(t.code,{children:"get_maxwell_status"})]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-python",children:"get_maxwell_status()\n"})}),"\n",(0,n.jsx)(t.p,{children:"Get the status of the maxwell system. True if initialized, False otherwise."}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsxs)(t.em,{children:["This file was automatically generated via ",(0,n.jsx)(t.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function u(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>c,x:()=>i});var n=s(6540);const l={},a=n.createContext(l);function c(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:c(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4ad60338.9cde0b8b.js b/assets/js/4ad60338.282a9685.js similarity index 96% rename from assets/js/4ad60338.9cde0b8b.js rename to assets/js/4ad60338.282a9685.js index 4797b08e..14cf1d4a 100644 --- a/assets/js/4ad60338.9cde0b8b.js +++ b/assets/js/4ad60338.282a9685.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[326],{2958:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>a,toc:()=>c});var s=t(4848),r=t(8453);const i={sidebar_position:3},o="Real-time Application (Online Use)",a={id:"RT-sort/usage/real-time-application",title:"Real-time Application (Online Use)",description:"Once you have detected sequences, you can use RT-Sort for real-time applications. Here's how to do it:",source:"@site/docs/RT-sort/usage/real-time-application.md",sourceDirName:"RT-sort/usage",slug:"/RT-sort/usage/real-time-application",permalink:"/BrainDance/docs/RT-sort/usage/real-time-application",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/usage/real-time-application.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Sequence Detection (Offline Use)",permalink:"/BrainDance/docs/RT-sort/usage/sequence-detection"},next:{title:"Training Your Own Detection Models",permalink:"/BrainDance/docs/RT-sort/usage/training-models"}},l={},c=[{value:"Reset the RTSort Object",id:"reset-the-rtsort-object",level:2},{value:"Continuous Sorting",id:"continuous-sorting",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Notes",id:"notes",level:3},{value:"Example with Maxwell MEA",id:"example-with-maxwell-mea",level:2},{value:"Next Steps",id:"next-steps",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"real-time-application-online-use",children:"Real-time Application (Online Use)"})}),"\n",(0,s.jsx)(n.p,{children:"Once you have detected sequences, you can use RT-Sort for real-time applications. Here's how to do it:"}),"\n",(0,s.jsx)(n.h2,{id:"reset-the-rtsort-object",children:"Reset the RTSort Object"}),"\n",(0,s.jsx)(n.p,{children:"Before online use, reset the RTSort object:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"rt_sort.reset()\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Note"}),": For optimal performance, call ",(0,s.jsx)(n.code,{children:"rt_sort.reset()"})," if more than 50ms have passed since the last ",(0,s.jsx)(n.code,{children:"rt_sort.running_sort(obs)"})," method call."]}),"\n",(0,s.jsx)(n.h2,{id:"continuous-sorting",children:"Continuous Sorting"}),"\n",(0,s.jsx)(n.p,{children:"During online use, continuously call the following method to sort a stream of data:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"sequence_detections = rt_sort.running_sort(obs)\n"})}),"\n",(0,s.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"obs"}),": NumPy array with shape (num_frames, num_electrodes). This should contain only the most recent frames of data."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,s.jsxs)(n.p,{children:["A list where each element is a tuple of length 2 containing the data for a sorted spike in the ",(0,s.jsx)(n.code,{children:"obs"})," recording chunk:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"0th element: ID number of the sequence that the spike was assigned to"}),"\n",(0,s.jsx)(n.li,{children:"1st element: Time the spike occurred (in milliseconds)"}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"notes",children:"Notes"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["The first 50ms of data passed as ",(0,s.jsx)(n.code,{children:"obs"})," to ",(0,s.jsx)(n.code,{children:"running_sort"})," is needed to initialize the RTSort object after the last ",(0,s.jsx)(n.code,{children:"rt_sort.reset()"}),", so no spikes will be sorted during this time."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"num_frames"})," must be at least 1 and can be different for each ",(0,s.jsx)(n.code,{children:"running_sort"})," call."]}),"\n",(0,s.jsxs)(n.li,{children:["To minimize sorting latency, ",(0,s.jsx)(n.code,{children:"num_frames"})," should ideally change and be equal to the amount of time that has passed since the last ",(0,s.jsx)(n.code,{children:"running_sort"})," call."]}),"\n",(0,s.jsx)(n.li,{children:"To align with the RT-Sort Methods, use 100 frames for 20kHz MEAs and 150 frames for 30kHz Neuropixels."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"example-with-maxwell-mea",children:"Example with Maxwell MEA"}),"\n",(0,s.jsx)(n.p,{children:"Here's an example of how to use RT-Sort with a Maxwell MEA:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"from braindance.core.maxwell_env import MaxwellEnv\n\nenv = MaxwellEnv(**params)\ndone = False\nwhile not done:\n obs, done = env.step()\n sequence_detections = rt_sort.running_sort(obs)\n # Process sequence_detections\n"})}),"\n",(0,s.jsx)(n.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,s.jsxs)(n.p,{children:["If you want to customize RT-Sort further, you might be interested in ",(0,s.jsx)(n.a,{href:"training-models",children:"training your own models"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>a});var s=t(6540);const r={},i=s.createContext(r);function o(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[326],{2958:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>a,toc:()=>c});var s=t(4848),r=t(8453);const i={sidebar_position:3},o="Real-time Application (Online Use)",a={id:"RT-sort/usage/real-time-application",title:"Real-time Application (Online Use)",description:"Once you have detected sequences, you can use RT-Sort for real-time applications. Here's how to do it:",source:"@site/docs/RT-sort/usage/real-time-application.md",sourceDirName:"RT-sort/usage",slug:"/RT-sort/usage/real-time-application",permalink:"/braindance/docs/RT-sort/usage/real-time-application",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/usage/real-time-application.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Sequence Detection (Offline Use)",permalink:"/braindance/docs/RT-sort/usage/sequence-detection"},next:{title:"Training Your Own Detection Models",permalink:"/braindance/docs/RT-sort/usage/training-models"}},l={},c=[{value:"Reset the RTSort Object",id:"reset-the-rtsort-object",level:2},{value:"Continuous Sorting",id:"continuous-sorting",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Notes",id:"notes",level:3},{value:"Example with Maxwell MEA",id:"example-with-maxwell-mea",level:2},{value:"Next Steps",id:"next-steps",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"real-time-application-online-use",children:"Real-time Application (Online Use)"})}),"\n",(0,s.jsx)(n.p,{children:"Once you have detected sequences, you can use RT-Sort for real-time applications. Here's how to do it:"}),"\n",(0,s.jsx)(n.h2,{id:"reset-the-rtsort-object",children:"Reset the RTSort Object"}),"\n",(0,s.jsx)(n.p,{children:"Before online use, reset the RTSort object:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"rt_sort.reset()\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Note"}),": For optimal performance, call ",(0,s.jsx)(n.code,{children:"rt_sort.reset()"})," if more than 50ms have passed since the last ",(0,s.jsx)(n.code,{children:"rt_sort.running_sort(obs)"})," method call."]}),"\n",(0,s.jsx)(n.h2,{id:"continuous-sorting",children:"Continuous Sorting"}),"\n",(0,s.jsx)(n.p,{children:"During online use, continuously call the following method to sort a stream of data:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"sequence_detections = rt_sort.running_sort(obs)\n"})}),"\n",(0,s.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"obs"}),": NumPy array with shape (num_frames, num_electrodes). This should contain only the most recent frames of data."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,s.jsxs)(n.p,{children:["A list where each element is a tuple of length 2 containing the data for a sorted spike in the ",(0,s.jsx)(n.code,{children:"obs"})," recording chunk:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"0th element: ID number of the sequence that the spike was assigned to"}),"\n",(0,s.jsx)(n.li,{children:"1st element: Time the spike occurred (in milliseconds)"}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"notes",children:"Notes"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["The first 50ms of data passed as ",(0,s.jsx)(n.code,{children:"obs"})," to ",(0,s.jsx)(n.code,{children:"running_sort"})," is needed to initialize the RTSort object after the last ",(0,s.jsx)(n.code,{children:"rt_sort.reset()"}),", so no spikes will be sorted during this time."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"num_frames"})," must be at least 1 and can be different for each ",(0,s.jsx)(n.code,{children:"running_sort"})," call."]}),"\n",(0,s.jsxs)(n.li,{children:["To minimize sorting latency, ",(0,s.jsx)(n.code,{children:"num_frames"})," should ideally change and be equal to the amount of time that has passed since the last ",(0,s.jsx)(n.code,{children:"running_sort"})," call."]}),"\n",(0,s.jsx)(n.li,{children:"To align with the RT-Sort Methods, use 100 frames for 20kHz MEAs and 150 frames for 30kHz Neuropixels."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"example-with-maxwell-mea",children:"Example with Maxwell MEA"}),"\n",(0,s.jsx)(n.p,{children:"Here's an example of how to use RT-Sort with a Maxwell MEA:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"from braindance.core.maxwell_env import MaxwellEnv\n\nenv = MaxwellEnv(**params)\ndone = False\nwhile not done:\n obs, done = env.step()\n sequence_detections = rt_sort.running_sort(obs)\n # Process sequence_detections\n"})}),"\n",(0,s.jsx)(n.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,s.jsxs)(n.p,{children:["If you want to customize RT-Sort further, you might be interested in ",(0,s.jsx)(n.a,{href:"training-models",children:"training your own models"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>a});var s=t(6540);const r={},i=s.createContext(r);function o(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4c7309ee.27d138a2.js b/assets/js/4c7309ee.1d2de06f.js similarity index 91% rename from assets/js/4c7309ee.27d138a2.js rename to assets/js/4c7309ee.1d2de06f.js index c53c96a1..96db73e9 100644 --- a/assets/js/4c7309ee.27d138a2.js +++ b/assets/js/4c7309ee.1d2de06f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[845],{4973:(e,t,c)=>{c.r(t),c.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>n,metadata:()=>d,toc:()=>i});var s=c(4848),r=c(8453);const n={},o="module select_electrodes.py",d={id:"docs/select_electrodes.py",title:"select_electrodes.py",description:"---",source:"@site/docs/docs/select_electrodes.py.mdx",sourceDirName:"docs",slug:"/docs/select_electrodes.py",permalink:"/BrainDance/docs/docs/select_electrodes.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/select_electrodes.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"query_electrodes.py",permalink:"/BrainDance/docs/docs/query_electrodes.py"},next:{title:"spikedetector.py",permalink:"/BrainDance/docs/docs/spikedetector.py"}},l={},i=[];function a(e){const t={a:"a",code:"code",em:"em",h1:"h1",header:"header",hr:"hr",p:"p",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/select_electrodes.py#L0",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsx)(t.header,{children:(0,s.jsxs)(t.h1,{id:"module-select_electrodespy",children:[(0,s.jsx)("kbd",{children:"module"})," ",(0,s.jsx)(t.code,{children:"select_electrodes.py"})]})}),"\n",(0,s.jsx)(t.hr,{}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsxs)(t.em,{children:["This file was automatically generated via ",(0,s.jsx)(t.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},8453:(e,t,c)=>{c.d(t,{R:()=>o,x:()=>d});var s=c(6540);const r={},n=s.createContext(r);function o(e){const t=s.useContext(n);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[845],{4973:(e,t,c)=>{c.r(t),c.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>n,metadata:()=>d,toc:()=>i});var s=c(4848),r=c(8453);const n={},o="module select_electrodes.py",d={id:"docs/select_electrodes.py",title:"select_electrodes.py",description:"---",source:"@site/docs/docs/select_electrodes.py.mdx",sourceDirName:"docs",slug:"/docs/select_electrodes.py",permalink:"/braindance/docs/docs/select_electrodes.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/select_electrodes.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"query_electrodes.py",permalink:"/braindance/docs/docs/query_electrodes.py"},next:{title:"spikedetector.py",permalink:"/braindance/docs/docs/spikedetector.py"}},l={},i=[];function a(e){const t={a:"a",code:"code",em:"em",h1:"h1",header:"header",hr:"hr",p:"p",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/select_electrodes.py#L0",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsx)(t.header,{children:(0,s.jsxs)(t.h1,{id:"module-select_electrodespy",children:[(0,s.jsx)("kbd",{children:"module"})," ",(0,s.jsx)(t.code,{children:"select_electrodes.py"})]})}),"\n",(0,s.jsx)(t.hr,{}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsxs)(t.em,{children:["This file was automatically generated via ",(0,s.jsx)(t.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},8453:(e,t,c)=>{c.d(t,{R:()=>o,x:()=>d});var s=c(6540);const r={},n=s.createContext(r);function o(e){const t=s.useContext(n);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/50015d8e.b1fe8f6e.js b/assets/js/50015d8e.de77fba8.js similarity index 90% rename from assets/js/50015d8e.b1fe8f6e.js rename to assets/js/50015d8e.de77fba8.js index c4f35ebb..7f354f94 100644 --- a/assets/js/50015d8e.b1fe8f6e.js +++ b/assets/js/50015d8e.de77fba8.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[587],{2330:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>h,frontMatter:()=>i,metadata:()=>c,toc:()=>l});var r=s(4848),t=s(8453);const i={},a="module dummy_zmq_np.py",c={id:"docs/dummy_zmq_np.py",title:"dummy_zmq_np.py",description:"ZMQ Publisher for streaming simulated or real neural data.",source:"@site/docs/docs/dummy_zmq_np.py.mdx",sourceDirName:"docs",slug:"/docs/dummy_zmq_np.py",permalink:"/BrainDance/docs/docs/dummy_zmq_np.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/dummy_zmq_np.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"dummy_maxlab.py",permalink:"/BrainDance/docs/docs/dummy_maxlab.py"},next:{title:"maxwell_env.py",permalink:"/BrainDance/docs/docs/maxwell_env.py"}},d={},l=[{value:"function get_sine_wave",id:"function-get_sine_wave",level:2},{value:"function run",id:"function-run",level:2}];function o(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_zmq_np.py#L0",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsx)(n.header,{children:(0,r.jsxs)(n.h1,{id:"module-dummy_zmq_nppy",children:[(0,r.jsx)("kbd",{children:"module"})," ",(0,r.jsx)(n.code,{children:"dummy_zmq_np.py"})]})}),"\n",(0,r.jsx)(n.p,{children:"ZMQ Publisher for streaming simulated or real neural data."}),"\n",(0,r.jsx)(n.p,{children:"This script sets up ZMQ publishers to stream neural data and spike events. It can generate sine wave data, use manually created data, or load data from files."}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_zmq_np.py#L18",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-get_sine_wave",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"get_sine_wave"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"get_sine_wave(n_channels=1024, fs=20000, total_time_steps=600000)\n"})}),"\n",(0,r.jsx)(n.p,{children:"Generate a sine wave dataset."}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"n_channels"})})," (int): Number of channels. Default is 1024."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"fs"})})," (int): Sampling frequency in Hz. Default is 20000."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"total_time_steps"})})," (int): Total number of time steps. Default is 20000*30 (30 seconds)."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"numpy.ndarray"})}),": 2D array of sine wave data with shape (n_channels, total_time_steps)."]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_zmq_np.py#L41",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-run",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"run"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"run(data_path, random_events=True)\n"})}),"\n",(0,r.jsx)(n.p,{children:"Run the ZMQ publisher to stream neural data and spike events."}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"data_path"})})," (str): Path to the data file or 'sine' for generated sine wave or 'manual' for manually created data."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"random_events"})})," (bool): Whether to generate random spike events. Default is True."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"NotImplementedError"})}),": If the data file type is not supported."]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.em,{children:["This file was automatically generated via ",(0,r.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>c});var r=s(6540);const t={},i=r.createContext(t);function a(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[587],{2330:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var r=s(4848),t=s(8453);const i={},a="module dummy_zmq_np.py",d={id:"docs/dummy_zmq_np.py",title:"dummy_zmq_np.py",description:"ZMQ Publisher for streaming simulated or real neural data.",source:"@site/docs/docs/dummy_zmq_np.py.mdx",sourceDirName:"docs",slug:"/docs/dummy_zmq_np.py",permalink:"/braindance/docs/docs/dummy_zmq_np.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/dummy_zmq_np.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"dummy_maxlab.py",permalink:"/braindance/docs/docs/dummy_maxlab.py"},next:{title:"maxwell_env.py",permalink:"/braindance/docs/docs/maxwell_env.py"}},c={},l=[{value:"function get_sine_wave",id:"function-get_sine_wave",level:2},{value:"function run",id:"function-run",level:2}];function o(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_zmq_np.py#L0",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsx)(n.header,{children:(0,r.jsxs)(n.h1,{id:"module-dummy_zmq_nppy",children:[(0,r.jsx)("kbd",{children:"module"})," ",(0,r.jsx)(n.code,{children:"dummy_zmq_np.py"})]})}),"\n",(0,r.jsx)(n.p,{children:"ZMQ Publisher for streaming simulated or real neural data."}),"\n",(0,r.jsx)(n.p,{children:"This script sets up ZMQ publishers to stream neural data and spike events. It can generate sine wave data, use manually created data, or load data from files."}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_zmq_np.py#L18",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-get_sine_wave",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"get_sine_wave"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"get_sine_wave(n_channels=1024, fs=20000, total_time_steps=600000)\n"})}),"\n",(0,r.jsx)(n.p,{children:"Generate a sine wave dataset."}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"n_channels"})})," (int): Number of channels. Default is 1024."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"fs"})})," (int): Sampling frequency in Hz. Default is 20000."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"total_time_steps"})})," (int): Total number of time steps. Default is 20000*30 (30 seconds)."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"numpy.ndarray"})}),": 2D array of sine wave data with shape (n_channels, total_time_steps)."]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/dummy_zmq_np.py#L41",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-run",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"run"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"run(data_path, random_events=True)\n"})}),"\n",(0,r.jsx)(n.p,{children:"Run the ZMQ publisher to stream neural data and spike events."}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"data_path"})})," (str): Path to the data file or 'sine' for generated sine wave or 'manual' for manually created data."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"random_events"})})," (bool): Whether to generate random spike events. Default is True."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(n.code,{children:"NotImplementedError"})}),": If the data file type is not supported."]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.em,{children:["This file was automatically generated via ",(0,r.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>d});var r=s(6540);const t={},i=r.createContext(t);function a(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6231b20d.0359c4a1.js b/assets/js/6231b20d.fcb289ea.js similarity index 89% rename from assets/js/6231b20d.0359c4a1.js rename to assets/js/6231b20d.fcb289ea.js index bff09dde..e1c7eb72 100644 --- a/assets/js/6231b20d.0359c4a1.js +++ b/assets/js/6231b20d.fcb289ea.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[648],{3171:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>c});var i=n(4848),r=n(8453);const o={sidebar_position:1},s="Introduction to RT-Sort",a={id:"RT-sort/introduction",title:"Introduction to RT-Sort",description:"RT-Sort is a powerful tool for real-time spike detection and sorting with millisecond latencies. This user manual will guide you through the installation, usage, and advanced features of RT-Sort.",source:"@site/docs/RT-sort/introduction.md",sourceDirName:"RT-sort",slug:"/RT-sort/introduction",permalink:"/BrainDance/docs/RT-sort/introduction",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/introduction.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"RT-Sort",permalink:"/BrainDance/docs/category/rt-sort"},next:{title:"Installation",permalink:"/BrainDance/docs/RT-sort/installation"}},l={},c=[{value:"Hardware Requirements",id:"hardware-requirements",level:2},{value:"What's Next?",id:"whats-next",level:2}];function d(e){const t={a:"a",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"introduction-to-rt-sort",children:"Introduction to RT-Sort"})}),"\n",(0,i.jsx)(t.p,{children:"RT-Sort is a powerful tool for real-time spike detection and sorting with millisecond latencies. This user manual will guide you through the installation, usage, and advanced features of RT-Sort."}),"\n",(0,i.jsx)(t.h2,{id:"hardware-requirements",children:"Hardware Requirements"}),"\n",(0,i.jsx)(t.p,{children:"RT-Sort requires a GPU to be installed on the computer that runs the software. Here are the key requirements:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Any NVIDIA GPU compatible with PyTorch and Torch-TensorRT"}),"\n",(0,i.jsx)(t.li,{children:"In the RT-Sort manuscript, an NVIDIA RTX A5000 was used"}),"\n",(0,i.jsx)(t.li,{children:"RT-Sort automatically adjusts its settings for different GPU specs"}),"\n",(0,i.jsx)(t.li,{children:"Less powerful GPUs might yield larger computation times and detection latencies"}),"\n",(0,i.jsx)(t.li,{children:"Recommended: At least 8GB of RAM (allows for online detections on ~50 sequences with 1020 electrodes)"}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"whats-next",children:"What's Next?"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"installation",children:"Installation Guide"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"usage/load-detection-model",children:"Loading Detection Models"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"usage/sequence-detection",children:"Sequence Detection"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"usage/real-time-application",children:"Real-time Application"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"usage/training-models",children:"Training Your Own Models"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"api-reference",children:"API Reference"})}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>a});var i=n(6540);const r={},o=i.createContext(r);function s(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[648],{3171:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var i=n(4848),r=n(8453);const o={sidebar_position:1},s="Introduction to RT-Sort",a={id:"RT-sort/introduction",title:"Introduction to RT-Sort",description:"RT-Sort is a powerful tool for real-time spike detection and sorting with millisecond latencies. This user manual will guide you through the installation, usage, and advanced features of RT-Sort.",source:"@site/docs/RT-sort/introduction.md",sourceDirName:"RT-sort",slug:"/RT-sort/introduction",permalink:"/braindance/docs/RT-sort/introduction",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/introduction.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"RT-Sort",permalink:"/braindance/docs/category/rt-sort"},next:{title:"Installation",permalink:"/braindance/docs/RT-sort/installation"}},l={},d=[{value:"Hardware Requirements",id:"hardware-requirements",level:2},{value:"What's Next?",id:"whats-next",level:2}];function c(e){const t={a:"a",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"introduction-to-rt-sort",children:"Introduction to RT-Sort"})}),"\n",(0,i.jsx)(t.p,{children:"RT-Sort is a powerful tool for real-time spike detection and sorting with millisecond latencies. This user manual will guide you through the installation, usage, and advanced features of RT-Sort."}),"\n",(0,i.jsx)(t.h2,{id:"hardware-requirements",children:"Hardware Requirements"}),"\n",(0,i.jsx)(t.p,{children:"RT-Sort requires a GPU to be installed on the computer that runs the software. Here are the key requirements:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Any NVIDIA GPU compatible with PyTorch and Torch-TensorRT"}),"\n",(0,i.jsx)(t.li,{children:"In the RT-Sort manuscript, an NVIDIA RTX A5000 was used"}),"\n",(0,i.jsx)(t.li,{children:"RT-Sort automatically adjusts its settings for different GPU specs"}),"\n",(0,i.jsx)(t.li,{children:"Less powerful GPUs might yield larger computation times and detection latencies"}),"\n",(0,i.jsx)(t.li,{children:"Recommended: At least 8GB of RAM (allows for online detections on ~50 sequences with 1020 electrodes)"}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"whats-next",children:"What's Next?"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"installation",children:"Installation Guide"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"usage/load-detection-model",children:"Loading Detection Models"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"usage/sequence-detection",children:"Sequence Detection"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"usage/real-time-application",children:"Real-time Application"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"usage/training-models",children:"Training Your Own Models"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"api-reference",children:"API Reference"})}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>a});var i=n(6540);const r={},o=i.createContext(r);function s(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6484fcfc.71a5bca9.js b/assets/js/6484fcfc.e41f0eb8.js similarity index 81% rename from assets/js/6484fcfc.71a5bca9.js rename to assets/js/6484fcfc.e41f0eb8.js index 2296d301..2c56dce0 100644 --- a/assets/js/6484fcfc.71a5bca9.js +++ b/assets/js/6484fcfc.e41f0eb8.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[925],{2949:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>i,default:()=>u,frontMatter:()=>d,metadata:()=>s,toc:()=>c});var o=n(4848),r=n(8453);const d={sidebar_position:1},i="Loading Detection Models",s={id:"RT-sort/usage/load-detection-model",title:"Loading Detection Models",description:"To use RT-Sort, you first need to load a detection model. Here's how to do it:",source:"@site/docs/RT-sort/usage/load-detection-model.md",sourceDirName:"RT-sort/usage",slug:"/RT-sort/usage/load-detection-model",permalink:"/BrainDance/docs/RT-sort/usage/load-detection-model",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/usage/load-detection-model.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"usage",permalink:"/BrainDance/docs/category/usage"},next:{title:"Sequence Detection (Offline Use)",permalink:"/BrainDance/docs/RT-sort/usage/sequence-detection"}},a={},c=[{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Pre-trained Models",id:"pre-trained-models",level:2},{value:"Next Steps",id:"next-steps",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"loading-detection-models",children:"Loading Detection Models"})}),"\n",(0,o.jsx)(t.p,{children:"To use RT-Sort, you first need to load a detection model. Here's how to do it:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-python",children:"from braindance.core.spikedetector.model2 import ModelSpikeSorter\n\ndetection_model = ModelSpikeSorter.load(detection_model_path)\n"})}),"\n",(0,o.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"detection_model_path"}),": Path to a folder containing a ModelSpikeSorter object's ",(0,o.jsx)(t.code,{children:"init_dict.json"})," and ",(0,o.jsx)(t.code,{children:"state_dict.pt"}),"."]}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"returns",children:"Returns"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"ModelSpikeSorter"}),": Represents the loaded detection model."]}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"pre-trained-models",children:"Pre-trained Models"}),"\n",(0,o.jsx)(t.p,{children:"Pre-trained ModelSpikeSorter objects for Maxwell MEAs and Neuropixels used in the RT-Sort manuscript can be found in the BrainDance GitHub repository:"}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.code,{children:"BrainDance/braindance/core/spikedetector/detection_models"})}),"\n",(0,o.jsx)(t.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,o.jsxs)(t.p,{children:["Once you've loaded a detection model, you can proceed to ",(0,o.jsx)(t.a,{href:"sequence-detection",children:"sequence detection"})," or ",(0,o.jsx)(t.a,{href:"real-time-application",children:"real-time application"}),"."]})]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>s});var o=n(6540);const r={},d=o.createContext(r);function i(e){const t=o.useContext(d);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(d.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[925],{2949:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>i,default:()=>u,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var o=n(4848),d=n(8453);const r={sidebar_position:1},i="Loading Detection Models",s={id:"RT-sort/usage/load-detection-model",title:"Loading Detection Models",description:"To use RT-Sort, you first need to load a detection model. Here's how to do it:",source:"@site/docs/RT-sort/usage/load-detection-model.md",sourceDirName:"RT-sort/usage",slug:"/RT-sort/usage/load-detection-model",permalink:"/braindance/docs/RT-sort/usage/load-detection-model",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/usage/load-detection-model.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"usage",permalink:"/braindance/docs/category/usage"},next:{title:"Sequence Detection (Offline Use)",permalink:"/braindance/docs/RT-sort/usage/sequence-detection"}},a={},c=[{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Pre-trained Models",id:"pre-trained-models",level:2},{value:"Next Steps",id:"next-steps",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,d.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"loading-detection-models",children:"Loading Detection Models"})}),"\n",(0,o.jsx)(t.p,{children:"To use RT-Sort, you first need to load a detection model. Here's how to do it:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-python",children:"from braindance.core.spikedetector.model2 import ModelSpikeSorter\n\ndetection_model = ModelSpikeSorter.load(detection_model_path)\n"})}),"\n",(0,o.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"detection_model_path"}),": Path to a folder containing a ModelSpikeSorter object's ",(0,o.jsx)(t.code,{children:"init_dict.json"})," and ",(0,o.jsx)(t.code,{children:"state_dict.pt"}),"."]}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"returns",children:"Returns"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"ModelSpikeSorter"}),": Represents the loaded detection model."]}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"pre-trained-models",children:"Pre-trained Models"}),"\n",(0,o.jsx)(t.p,{children:"Pre-trained ModelSpikeSorter objects for Maxwell MEAs and Neuropixels used in the RT-Sort manuscript can be found in the BrainDance GitHub repository:"}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.code,{children:"BrainDance/braindance/core/spikedetector/detection_models"})}),"\n",(0,o.jsx)(t.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,o.jsxs)(t.p,{children:["Once you've loaded a detection model, you can proceed to ",(0,o.jsx)(t.a,{href:"sequence-detection",children:"sequence detection"})," or ",(0,o.jsx)(t.a,{href:"real-time-application",children:"real-time application"}),"."]})]})}function u(e={}){const{wrapper:t}={...(0,d.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>s});var o=n(6540);const d={},r=o.createContext(d);function i(e){const t=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:i(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/66de5925.b7b0ded6.js b/assets/js/66de5925.dcd6dded.js similarity index 97% rename from assets/js/66de5925.b7b0ded6.js rename to assets/js/66de5925.dcd6dded.js index e6894892..2cb768f0 100644 --- a/assets/js/66de5925.b7b0ded6.js +++ b/assets/js/66de5925.dcd6dded.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[255],{5601:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>t,default:()=>h,frontMatter:()=>r,metadata:()=>d,toc:()=>o});var i=s(4848),c=s(8453);const r={},t="module base_env.py",d={id:"docs/base_env.py",title:"base_env.py",description:"---",source:"@site/docs/docs/base_env.py.mdx",sourceDirName:"docs",slug:"/docs/base_env.py",permalink:"/BrainDance/docs/docs/base_env.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/base_env.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"artifact_removal.py",permalink:"/BrainDance/docs/docs/artifact_removal.py"},next:{title:"data_loader.py",permalink:"/BrainDance/docs/docs/data_loader.py"}},l={},o=[{value:"class BaseEnv",id:"class-baseenv",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function close",id:"function-close",level:3},{value:"function render",id:"function-render",level:3},{value:"function reset",id:"function-reset",level:3},{value:"function step",id:"function-step",level:3}];function a(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,c.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L0",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsx)(n.header,{children:(0,i.jsxs)(n.h1,{id:"module-base_envpy",children:[(0,i.jsx)("kbd",{children:"module"})," ",(0,i.jsx)(n.code,{children:"base_env.py"})]})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-baseenv",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"BaseEnv"})]}),"\n",(0,i.jsx)(n.p,{children:"A base class for environment implementations."}),"\n",(0,i.jsx)(n.p,{children:"This class defines the basic interface for environments. All specific environment implementations should inherit from this class and implement its methods."}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L10",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-__init__",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"__init__"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"__init__()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize the environment."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"NotImplementedError"})}),": This method should be implemented by subclasses."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L54",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-close",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"close"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"close()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Close the environment and perform any necessary cleanup."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"NotImplementedError"})}),": This method should be implemented by subclasses."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L46",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-render",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"render"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"render()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Render the current state of the environment."}),"\n",(0,i.jsx)(n.p,{children:"This method is typically used for visualization purposes."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L34",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-reset",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"reset"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"reset()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Reset the environment to an initial state."}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Returns:"}),"\nThis method should return the initial state of the environment."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"NotImplementedError"})}),": This method should be implemented by subclasses."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L19",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-step",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"step"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"step(action)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Take a step in the environment."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"action"})}),": The action to be executed in the environment."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Returns:"}),"\nThis method should return the observation"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"NotImplementedError"})}),": This method should be implemented by subclasses."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["This file was automatically generated via ",(0,i.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>t,x:()=>d});var i=s(6540);const c={},r=i.createContext(c);function t(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:t(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[255],{5601:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>t,default:()=>h,frontMatter:()=>r,metadata:()=>d,toc:()=>o});var i=s(4848),c=s(8453);const r={},t="module base_env.py",d={id:"docs/base_env.py",title:"base_env.py",description:"---",source:"@site/docs/docs/base_env.py.mdx",sourceDirName:"docs",slug:"/docs/base_env.py",permalink:"/braindance/docs/docs/base_env.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/base_env.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"artifact_removal.py",permalink:"/braindance/docs/docs/artifact_removal.py"},next:{title:"data_loader.py",permalink:"/braindance/docs/docs/data_loader.py"}},l={},o=[{value:"class BaseEnv",id:"class-baseenv",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function close",id:"function-close",level:3},{value:"function render",id:"function-render",level:3},{value:"function reset",id:"function-reset",level:3},{value:"function step",id:"function-step",level:3}];function a(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,c.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L0",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsx)(n.header,{children:(0,i.jsxs)(n.h1,{id:"module-base_envpy",children:[(0,i.jsx)("kbd",{children:"module"})," ",(0,i.jsx)(n.code,{children:"base_env.py"})]})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"class-baseenv",children:[(0,i.jsx)("kbd",{children:"class"})," ",(0,i.jsx)(n.code,{children:"BaseEnv"})]}),"\n",(0,i.jsx)(n.p,{children:"A base class for environment implementations."}),"\n",(0,i.jsx)(n.p,{children:"This class defines the basic interface for environments. All specific environment implementations should inherit from this class and implement its methods."}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L10",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-__init__",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"__init__"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"__init__()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Initialize the environment."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"NotImplementedError"})}),": This method should be implemented by subclasses."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L54",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-close",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"close"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"close()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Close the environment and perform any necessary cleanup."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"NotImplementedError"})}),": This method should be implemented by subclasses."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L46",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-render",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"render"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"render()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Render the current state of the environment."}),"\n",(0,i.jsx)(n.p,{children:"This method is typically used for visualization purposes."}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L34",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-reset",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"reset"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"reset()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Reset the environment to an initial state."}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Returns:"}),"\nThis method should return the initial state of the environment."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"NotImplementedError"})}),": This method should be implemented by subclasses."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/base_env.py#L19",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h3,{id:"function-step",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"step"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"step(action)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Take a step in the environment."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"action"})}),": The action to be executed in the environment."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Returns:"}),"\nThis method should return the observation"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Raises:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(n.code,{children:"NotImplementedError"})}),": This method should be implemented by subclasses."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["This file was automatically generated via ",(0,i.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>t,x:()=>d});var i=s(6540);const c={},r=i.createContext(c);function t(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:t(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6b4d9966.13185d70.js b/assets/js/6b4d9966.13185d70.js deleted file mode 100644 index fd346e1e..00000000 --- a/assets/js/6b4d9966.13185d70.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[281],{261:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"BrainDance","href":"/BrainDance/docs/","docId":"intro","unlisted":false},{"type":"link","label":"Quick Start Guide","href":"/BrainDance/docs/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Core Concepts","href":"/BrainDance/docs/core-concepts","docId":"core-concepts","unlisted":false},{"type":"category","label":"RT-Sort","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Introduction to RT-Sort","href":"/BrainDance/docs/RT-sort/introduction","docId":"RT-sort/introduction","unlisted":false},{"type":"link","label":"Installation","href":"/BrainDance/docs/RT-sort/installation","docId":"RT-sort/installation","unlisted":false},{"type":"category","label":"usage","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Loading Detection Models","href":"/BrainDance/docs/RT-sort/usage/load-detection-model","docId":"RT-sort/usage/load-detection-model","unlisted":false},{"type":"link","label":"Sequence Detection (Offline Use)","href":"/BrainDance/docs/RT-sort/usage/sequence-detection","docId":"RT-sort/usage/sequence-detection","unlisted":false},{"type":"link","label":"Real-time Application (Online Use)","href":"/BrainDance/docs/RT-sort/usage/real-time-application","docId":"RT-sort/usage/real-time-application","unlisted":false},{"type":"link","label":"Training Your Own Detection Models","href":"/BrainDance/docs/RT-sort/usage/training-models","docId":"RT-sort/usage/training-models","unlisted":false}],"href":"/BrainDance/docs/category/usage"},{"type":"link","label":"API Reference","href":"/BrainDance/docs/RT-sort/api-reference","docId":"RT-sort/api-reference","unlisted":false}],"href":"/BrainDance/docs/category/rt-sort"},{"type":"category","label":"Documentation","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"artifact_removal.py","href":"/BrainDance/docs/docs/artifact_removal.py","docId":"docs/artifact_removal.py","unlisted":false},{"type":"link","label":"base_env.py","href":"/BrainDance/docs/docs/base_env.py","docId":"docs/base_env.py","unlisted":false},{"type":"link","label":"data_loader.py","href":"/BrainDance/docs/docs/data_loader.py","docId":"docs/data_loader.py","unlisted":false},{"type":"link","label":"dummy_maxlab.py","href":"/BrainDance/docs/docs/dummy_maxlab.py","docId":"docs/dummy_maxlab.py","unlisted":false},{"type":"link","label":"dummy_zmq_np.py","href":"/BrainDance/docs/docs/dummy_zmq_np.py","docId":"docs/dummy_zmq_np.py","unlisted":false},{"type":"link","label":"maxwell_env.py","href":"/BrainDance/docs/docs/maxwell_env.py","docId":"docs/maxwell_env.py","unlisted":false},{"type":"link","label":"maxwell_utils.py","href":"/BrainDance/docs/docs/maxwell_utils.py","docId":"docs/maxwell_utils.py","unlisted":false},{"type":"link","label":"params.py","href":"/BrainDance/docs/docs/params.py","docId":"docs/params.py","unlisted":false},{"type":"link","label":"phases.py","href":"/BrainDance/docs/docs/phases.py","docId":"docs/phases.py","unlisted":false},{"type":"link","label":"plot.py","href":"/BrainDance/docs/docs/plot.py","docId":"docs/plot.py","unlisted":false},{"type":"link","label":"query_electrodes.py","href":"/BrainDance/docs/docs/query_electrodes.py","docId":"docs/query_electrodes.py","unlisted":false},{"type":"link","label":"select_electrodes.py","href":"/BrainDance/docs/docs/select_electrodes.py","docId":"docs/select_electrodes.py","unlisted":false},{"type":"link","label":"spikedetector.py","href":"/BrainDance/docs/docs/spikedetector.py","docId":"docs/spikedetector.py","unlisted":false},{"type":"link","label":"train.py","href":"/BrainDance/docs/docs/train.py","docId":"docs/train.py","unlisted":false},{"type":"link","label":"trainer.py","href":"/BrainDance/docs/docs/trainer.py","docId":"docs/trainer.py","unlisted":false},{"type":"link","label":"utils.py","href":"/BrainDance/docs/docs/utils.py","docId":"docs/utils.py","unlisted":false}],"href":"/BrainDance/docs/category/documentation"}]},"docs":{"core-concepts":{"id":"core-concepts","title":"Core Concepts","description":"Understanding the core concepts of BrainDance will help you design and execute more complex experiments.","sidebar":"tutorialSidebar"},"docs/artifact_removal.py":{"id":"docs/artifact_removal.py","title":"artifact_removal.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/base_env.py":{"id":"docs/base_env.py","title":"base_env.py","description":"---","sidebar":"tutorialSidebar"},"docs/data_loader.py":{"id":"docs/data_loader.py","title":"data_loader.py","description":"---","sidebar":"tutorialSidebar"},"docs/dummy_maxlab.py":{"id":"docs/dummy_maxlab.py","title":"dummy_maxlab.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/dummy_zmq_np.py":{"id":"docs/dummy_zmq_np.py","title":"dummy_zmq_np.py","description":"ZMQ Publisher for streaming simulated or real neural data.","sidebar":"tutorialSidebar"},"docs/maxwell_env.py":{"id":"docs/maxwell_env.py","title":"maxwell_env.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/maxwell_utils.py":{"id":"docs/maxwell_utils.py","title":"maxwell_utils.py","description":"---","sidebar":"tutorialSidebar"},"docs/params.py":{"id":"docs/params.py","title":"params.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/phases.py":{"id":"docs/phases.py","title":"phases.py","description":"Experiment phases","sidebar":"tutorialSidebar"},"docs/plot.py":{"id":"docs/plot.py","title":"plot.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/query_electrodes.py":{"id":"docs/query_electrodes.py","title":"query_electrodes.py","description":"---","sidebar":"tutorialSidebar"},"docs/select_electrodes.py":{"id":"docs/select_electrodes.py","title":"select_electrodes.py","description":"---","sidebar":"tutorialSidebar"},"docs/spikedetector.py":{"id":"docs/spikedetector.py","title":"spikedetector.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/train.py":{"id":"docs/train.py","title":"train.py","description":"---","sidebar":"tutorialSidebar"},"docs/trainer.py":{"id":"docs/trainer.py","title":"trainer.py","description":"---","sidebar":"tutorialSidebar"},"docs/utils.py":{"id":"docs/utils.py","title":"utils.py","description":"---","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"BrainDance","description":"Neural stimulation framework for organoids and cultures with micro electrode arrays","sidebar":"tutorialSidebar"},"quick-start":{"id":"quick-start","title":"Quick Start Guide","description":"Get up and running with BrainDance in just a few minutes!","sidebar":"tutorialSidebar"},"RT-sort/api-reference":{"id":"RT-sort/api-reference","title":"API Reference","description":"This page provides a detailed reference for the main classes and functions in RT-Sort.","sidebar":"tutorialSidebar"},"RT-sort/installation":{"id":"RT-sort/installation","title":"Installation","description":"To install RT-Sort, follow these steps:","sidebar":"tutorialSidebar"},"RT-sort/introduction":{"id":"RT-sort/introduction","title":"Introduction to RT-Sort","description":"RT-Sort is a powerful tool for real-time spike detection and sorting with millisecond latencies. This user manual will guide you through the installation, usage, and advanced features of RT-Sort.","sidebar":"tutorialSidebar"},"RT-sort/usage/load-detection-model":{"id":"RT-sort/usage/load-detection-model","title":"Loading Detection Models","description":"To use RT-Sort, you first need to load a detection model. Here\'s how to do it:","sidebar":"tutorialSidebar"},"RT-sort/usage/real-time-application":{"id":"RT-sort/usage/real-time-application","title":"Real-time Application (Online Use)","description":"Once you have detected sequences, you can use RT-Sort for real-time applications. Here\'s how to do it:","sidebar":"tutorialSidebar"},"RT-sort/usage/sequence-detection":{"id":"RT-sort/usage/sequence-detection","title":"Sequence Detection (Offline Use)","description":"RT-Sort can be used for offline sequence detection with a pre-trained detection model. Here\'s how to do it for both Maxwell MEAs and Neuropixels.","sidebar":"tutorialSidebar"},"RT-sort/usage/training-models":{"id":"RT-sort/usage/training-models","title":"Training Your Own Detection Models","description":"RT-Sort allows you to train your own detection models using leave-one-out cross-validation. Here\'s how to do it:","sidebar":"tutorialSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/72e14192.354a3fd8.js b/assets/js/72e14192.4903326a.js similarity index 95% rename from assets/js/72e14192.354a3fd8.js rename to assets/js/72e14192.4903326a.js index 077b7ef7..e4e89fc5 100644 --- a/assets/js/72e14192.354a3fd8.js +++ b/assets/js/72e14192.4903326a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[814],{6711:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>o,contentTitle:()=>s,default:()=>p,frontMatter:()=>a,metadata:()=>c,toc:()=>l});var i=r(4848),t=r(8453);const a={sidebar_position:1},s="Quick Start Guide",c={id:"quick-start",title:"Quick Start Guide",description:"Get up and running with BrainDance in just a few minutes!",source:"@site/docs/quick-start.md",sourceDirName:".",slug:"/quick-start",permalink:"/BrainDance/docs/quick-start",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/quick-start.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"BrainDance",permalink:"/BrainDance/docs/"},next:{title:"Core Concepts",permalink:"/BrainDance/docs/core-concepts"}},o={},l=[{value:"Installation",id:"installation",level:2},{value:"Your First Experiment",id:"your-first-experiment",level:2},{value:"Next Steps",id:"next-steps",level:2}];function d(e){const n={a:"a",code:"code",del:"del",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"quick-start-guide",children:"Quick Start Guide"})}),"\n",(0,i.jsx)(n.p,{children:"Get up and running with BrainDance in just a few minutes!"}),"\n",(0,i.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,i.jsxs)(n.ol,{start:"0",children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Create a virtual environment"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"conda create -n brain python=3.11\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Clone the BrainDance repository:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"pip install git+https://github.com/braingeneers/braindance.git\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"your-first-experiment",children:"Your First Experiment"}),"\n",(0,i.jsx)(n.p,{children:"Here's a simple experiment to get you started:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"from braindance.core.maxwell_env import MaxwellEnv\nfrom braindance.core.params import maxwell_params\nfrom braindance.core.phases import PhaseManager, RecordPhase, NeuralSweepPhase\n\n# Set up the environment\nparams = maxwell_params\nparams['save_dir'] = './my_first_experiment'\nparams['name'] = 'quick_start'\nparams['max_time_sec'] = 60*5 # 5 minutes\nparams['stim_electrodes'] = [20421, 1925] # electrodes in your current config\nparams['config'] = 'config.cfg' # this is the path to your config file for Maxwell\nenv = MaxwellEnv(**params)\n\n# Create phases\nrecord_phase = RecordPhase(env, duration=60)\nsweep_phase = NeuralSweepPhase(env, neuron_list=[0, 1], amp_bounds=300, stim_freq=1, tag=\"QuickSweep\", replicates=3)\n\n# Build and run the experiment\nphase_manager = PhaseManager(env, verbose=True)\nphase_manager.add_phase_group([record_phase, sweep_phase, record_phase])\n\nprint(phase_manger.summary())\n\nphase_manager.run()\n"})}),"\n",(0,i.jsx)(n.p,{children:"This experiment will:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Record baseline activity for 1 minute"}),"\n",(0,i.jsx)(n.li,{children:"Perform a neural sweep on two electrodes"}),"\n",(0,i.jsx)(n.li,{children:"Record post-stimulation activity for 1 minute"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Learn about ",(0,i.jsx)(n.a,{href:"core-concepts",children:"Core Concepts"})," in BrainDance"]}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.del,{children:"Explore more complex Experiment Designs"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.del,{children:"Dive into Data Analysis techniques"})}),"\n"]})]})}function p(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>s,x:()=>c});var i=r(6540);const t={},a=i.createContext(t);function s(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[814],{6711:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>o,contentTitle:()=>s,default:()=>p,frontMatter:()=>a,metadata:()=>c,toc:()=>l});var i=r(4848),t=r(8453);const a={sidebar_position:1},s="Quick Start Guide",c={id:"quick-start",title:"Quick Start Guide",description:"Get up and running with BrainDance in just a few minutes!",source:"@site/docs/quick-start.md",sourceDirName:".",slug:"/quick-start",permalink:"/braindance/docs/quick-start",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/quick-start.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"BrainDance",permalink:"/braindance/docs/"},next:{title:"Core Concepts",permalink:"/braindance/docs/core-concepts"}},o={},l=[{value:"Installation",id:"installation",level:2},{value:"Your First Experiment",id:"your-first-experiment",level:2},{value:"Next Steps",id:"next-steps",level:2}];function d(e){const n={a:"a",code:"code",del:"del",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"quick-start-guide",children:"Quick Start Guide"})}),"\n",(0,i.jsx)(n.p,{children:"Get up and running with BrainDance in just a few minutes!"}),"\n",(0,i.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,i.jsxs)(n.ol,{start:"0",children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Create a virtual environment"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"conda create -n brain python=3.11\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Clone the BrainDance repository:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"pip install git+https://github.com/braingeneers/braindance.git\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"your-first-experiment",children:"Your First Experiment"}),"\n",(0,i.jsx)(n.p,{children:"Here's a simple experiment to get you started:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"from braindance.core.maxwell_env import MaxwellEnv\nfrom braindance.core.params import maxwell_params\nfrom braindance.core.phases import PhaseManager, RecordPhase, NeuralSweepPhase\n\n# Set up the environment\nparams = maxwell_params\nparams['save_dir'] = './my_first_experiment'\nparams['name'] = 'quick_start'\nparams['max_time_sec'] = 60*5 # 5 minutes\nparams['stim_electrodes'] = [20421, 1925] # electrodes in your current config\nparams['config'] = 'config.cfg' # this is the path to your config file for Maxwell\nenv = MaxwellEnv(**params)\n\n# Create phases\nrecord_phase = RecordPhase(env, duration=60)\nsweep_phase = NeuralSweepPhase(env, neuron_list=[0, 1], amp_bounds=300, stim_freq=1, tag=\"QuickSweep\", replicates=3)\n\n# Build and run the experiment\nphase_manager = PhaseManager(env, verbose=True)\nphase_manager.add_phase_group([record_phase, sweep_phase, record_phase])\n\nprint(phase_manger.summary())\n\nphase_manager.run()\n"})}),"\n",(0,i.jsx)(n.p,{children:"This experiment will:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Record baseline activity for 1 minute"}),"\n",(0,i.jsx)(n.li,{children:"Perform a neural sweep on two electrodes"}),"\n",(0,i.jsx)(n.li,{children:"Record post-stimulation activity for 1 minute"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Learn about ",(0,i.jsx)(n.a,{href:"core-concepts",children:"Core Concepts"})," in BrainDance"]}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.del,{children:"Explore more complex Experiment Designs"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.del,{children:"Dive into Data Analysis techniques"})}),"\n"]})]})}function p(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>s,x:()=>c});var i=r(6540);const t={},a=i.createContext(t);function s(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ff104f3b.8793c409.js b/assets/js/8321f17a.f9c2049c.js similarity index 52% rename from assets/js/ff104f3b.8793c409.js rename to assets/js/8321f17a.f9c2049c.js index 77436158..9e2ad1a5 100644 --- a/assets/js/ff104f3b.8793c409.js +++ b/assets/js/8321f17a.f9c2049c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[393],{5419:e=>{e.exports=JSON.parse('{"categoryGeneratedIndex":{"title":"Documentation","description":"General documentation","slug":"/category/documentation","permalink":"/BrainDance/docs/category/documentation","sidebar":"tutorialSidebar","navigation":{"previous":{"title":"API Reference","permalink":"/BrainDance/docs/RT-sort/api-reference"},"next":{"title":"artifact_removal.py","permalink":"/BrainDance/docs/docs/artifact_removal.py"}}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[480],{7992:e=>{e.exports=JSON.parse('{"categoryGeneratedIndex":{"title":"Documentation","description":"General documentation","slug":"/category/documentation","permalink":"/braindance/docs/category/documentation","sidebar":"tutorialSidebar","navigation":{"previous":{"title":"API Reference","permalink":"/braindance/docs/RT-sort/api-reference"},"next":{"title":"artifact_removal.py","permalink":"/braindance/docs/docs/artifact_removal.py"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/83686c74.410ae755.js b/assets/js/83686c74.d1c37efa.js similarity index 98% rename from assets/js/83686c74.410ae755.js rename to assets/js/83686c74.d1c37efa.js index fed734f5..a442b590 100644 --- a/assets/js/83686c74.410ae755.js +++ b/assets/js/83686c74.d1c37efa.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[474],{31:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>s,metadata:()=>l,toc:()=>o});var i=t(4848),c=t(8453);const s={},r="module plot.py",l={id:"docs/plot.py",title:"plot.py",description:"Global Variables",source:"@site/docs/docs/plot.py.mdx",sourceDirName:"docs",slug:"/docs/plot.py",permalink:"/BrainDance/docs/docs/plot.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/plot.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"phases.py",permalink:"/BrainDance/docs/docs/phases.py"},next:{title:"query_electrodes.py",permalink:"/BrainDance/docs/docs/query_electrodes.py"}},a={},o=[{value:"Global Variables",id:"global-variables",level:2},{value:"function plot_waveform",id:"function-plot_waveform",level:2},{value:"function plot_hist_loc_mad",id:"function-plot_hist_loc_mad",level:2},{value:"function plot_hist_percent_abs_error",id:"function-plot_hist_percent_abs_error",level:2},{value:"function get_yticks_lim",id:"function-get_yticks_lim",level:2},{value:"function set_ticks",id:"function-set_ticks",level:2},{value:"function set_dpi",id:"function-set_dpi",level:2},{value:"function get_empty_line",id:"function-get_empty_line",level:2},{value:"function display_prob_spike",id:"function-display_prob_spike",level:2},{value:"function unscaled_ticks_to_uv",id:"function-unscaled_ticks_to_uv",level:2},{value:"function plot_hist_percents",id:"function-plot_hist_percents",level:2}];function d(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,c.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L0",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsx)(n.header,{children:(0,i.jsxs)(n.h1,{id:"module-plotpy",children:[(0,i.jsx)("kbd",{children:"module"})," ",(0,i.jsx)(n.code,{children:"plot.py"})]})}),"\n",(0,i.jsx)(n.h2,{id:"global-variables",children:(0,i.jsx)(n.strong,{children:"Global Variables"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"TRACE_X_LABEL"})}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L14",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_waveform",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_waveform"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_waveform(\n waveform,\n peak_idx,\n wf_len,\n wf_alpha,\n wf_trace_loc,\n axis,\n xlim=None,\n ylim_diff=None,\n title='Waveform',\n **wf_line_kwargs\n)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L38",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_hist_loc_mad",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_hist_loc_mad"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_hist_loc_mad(loc_deviations, n_bins=15)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L55",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_hist_percent_abs_error",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_hist_percent_abs_error"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_hist_percent_abs_error(percent_abs_errors, n_bins=10)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L71",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-get_yticks_lim",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_yticks_lim"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_yticks_lim(trace, anchor=0, increment=5, buffer_min=5, buffer_max=3)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get lim and ticks for y-axis when trace is plotted"}),"\n",(0,i.jsxs)(n.p,{children:[":param"," trace: np.array Trace that will be plotted using the returned lim and ticks ",":param"," anchor: int or float The ticks will show anchor ",":param"," increment: int or float Increment between ticks ",":param"," buffer_min: Ticks will be within [min(trace) - buffer_min, max(trace) + buffer_max)] ",":param"," buffer_max: [min(trace) - buffer_min, max(trace) + buffer_max)]"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L99",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-set_ticks",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"set_ticks"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"set_ticks(\n subplots: Tuple[Axes],\n trace: ,\n increment=10,\n buffer_min=10,\n buffer_max=10,\n center_xticks=False\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Set x and y ticks for subplots"}),"\n",(0,i.jsxs)(n.p,{children:[":param"," subplots Each element is a subplot ",":param"," trace The trace to calculate the appropatiate ticks for ",":param"," increment ",":param"," center_xticks Whether to set center of xticks to 0 (left is negative time and right is positive)"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L136",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-set_dpi",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"set_dpi"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"set_dpi(dpi)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L141",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-get_empty_line",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_empty_line"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_empty_line(label)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L146",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-display_prob_spike",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"display_prob_spike"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"display_prob_spike(spike_output, axis)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L157",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-unscaled_ticks_to_uv",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"unscaled_ticks_to_uv"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"unscaled_ticks_to_uv(subplot)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L163",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_hist_percents",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_hist_percents"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_hist_percents(data, ax=None, **hist_kwargs)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["This file was automatically generated via ",(0,i.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>l});var i=t(6540);const c={},s=i.createContext(c);function r(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[474],{31:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>s,metadata:()=>l,toc:()=>o});var i=t(4848),c=t(8453);const s={},r="module plot.py",l={id:"docs/plot.py",title:"plot.py",description:"Global Variables",source:"@site/docs/docs/plot.py.mdx",sourceDirName:"docs",slug:"/docs/plot.py",permalink:"/braindance/docs/docs/plot.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/plot.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"phases.py",permalink:"/braindance/docs/docs/phases.py"},next:{title:"query_electrodes.py",permalink:"/braindance/docs/docs/query_electrodes.py"}},a={},o=[{value:"Global Variables",id:"global-variables",level:2},{value:"function plot_waveform",id:"function-plot_waveform",level:2},{value:"function plot_hist_loc_mad",id:"function-plot_hist_loc_mad",level:2},{value:"function plot_hist_percent_abs_error",id:"function-plot_hist_percent_abs_error",level:2},{value:"function get_yticks_lim",id:"function-get_yticks_lim",level:2},{value:"function set_ticks",id:"function-set_ticks",level:2},{value:"function set_dpi",id:"function-set_dpi",level:2},{value:"function get_empty_line",id:"function-get_empty_line",level:2},{value:"function display_prob_spike",id:"function-display_prob_spike",level:2},{value:"function unscaled_ticks_to_uv",id:"function-unscaled_ticks_to_uv",level:2},{value:"function plot_hist_percents",id:"function-plot_hist_percents",level:2}];function d(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,c.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L0",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsx)(n.header,{children:(0,i.jsxs)(n.h1,{id:"module-plotpy",children:[(0,i.jsx)("kbd",{children:"module"})," ",(0,i.jsx)(n.code,{children:"plot.py"})]})}),"\n",(0,i.jsx)(n.h2,{id:"global-variables",children:(0,i.jsx)(n.strong,{children:"Global Variables"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"TRACE_X_LABEL"})}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L14",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_waveform",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_waveform"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_waveform(\n waveform,\n peak_idx,\n wf_len,\n wf_alpha,\n wf_trace_loc,\n axis,\n xlim=None,\n ylim_diff=None,\n title='Waveform',\n **wf_line_kwargs\n)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L38",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_hist_loc_mad",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_hist_loc_mad"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_hist_loc_mad(loc_deviations, n_bins=15)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L55",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_hist_percent_abs_error",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_hist_percent_abs_error"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_hist_percent_abs_error(percent_abs_errors, n_bins=10)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L71",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-get_yticks_lim",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_yticks_lim"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_yticks_lim(trace, anchor=0, increment=5, buffer_min=5, buffer_max=3)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Get lim and ticks for y-axis when trace is plotted"}),"\n",(0,i.jsxs)(n.p,{children:[":param"," trace: np.array Trace that will be plotted using the returned lim and ticks ",":param"," anchor: int or float The ticks will show anchor ",":param"," increment: int or float Increment between ticks ",":param"," buffer_min: Ticks will be within [min(trace) - buffer_min, max(trace) + buffer_max)] ",":param"," buffer_max: [min(trace) - buffer_min, max(trace) + buffer_max)]"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L99",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-set_ticks",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"set_ticks"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"set_ticks(\n subplots: Tuple[Axes],\n trace: ,\n increment=10,\n buffer_min=10,\n buffer_max=10,\n center_xticks=False\n)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Set x and y ticks for subplots"}),"\n",(0,i.jsxs)(n.p,{children:[":param"," subplots Each element is a subplot ",":param"," trace The trace to calculate the appropatiate ticks for ",":param"," increment ",":param"," center_xticks Whether to set center of xticks to 0 (left is negative time and right is positive)"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L136",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-set_dpi",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"set_dpi"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"set_dpi(dpi)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L141",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-get_empty_line",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"get_empty_line"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"get_empty_line(label)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L146",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-display_prob_spike",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"display_prob_spike"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"display_prob_spike(spike_output, axis)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L157",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-unscaled_ticks_to_uv",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"unscaled_ticks_to_uv"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"unscaled_ticks_to_uv(subplot)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/plot.py#L163",children:(0,i.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,i.jsxs)(n.h2,{id:"function-plot_hist_percents",children:[(0,i.jsx)("kbd",{children:"function"})," ",(0,i.jsx)(n.code,{children:"plot_hist_percents"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"plot_hist_percents(data, ax=None, **hist_kwargs)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["This file was automatically generated via ",(0,i.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>l});var i=t(6540);const c={},s=i.createContext(c);function r(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9025e78b.1bcc08e3.js b/assets/js/9025e78b.23e49f6a.js similarity index 96% rename from assets/js/9025e78b.1bcc08e3.js rename to assets/js/9025e78b.23e49f6a.js index 2417d5d7..21deec4d 100644 --- a/assets/js/9025e78b.1bcc08e3.js +++ b/assets/js/9025e78b.23e49f6a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[237],{541:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>l});var s=t(4848),i=t(8453);const r={},a="module trainer.py",c={id:"docs/trainer.py",title:"trainer.py",description:"---",source:"@site/docs/docs/trainer.py.mdx",sourceDirName:"docs",slug:"/docs/trainer.py",permalink:"/BrainDance/docs/docs/trainer.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/trainer.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"train.py",permalink:"/BrainDance/docs/docs/train.py"},next:{title:"utils.py",permalink:"/BrainDance/docs/docs/utils.py"}},o={},l=[{value:"function generate_tetanus_pattern",id:"function-generate_tetanus_pattern",level:2},{value:"function generate_permutations",id:"function-generate_permutations",level:2},{value:"function generate_stimulations",id:"function-generate_stimulations",level:2}];function d(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/trainer.py#L0",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsx)(n.header,{children:(0,s.jsxs)(n.h1,{id:"module-trainerpy",children:[(0,s.jsx)("kbd",{children:"module"})," ",(0,s.jsx)(n.code,{children:"trainer.py"})]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/trainer.py#L5",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-generate_tetanus_pattern",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"generate_tetanus_pattern"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"generate_tetanus_pattern(\n neurons,\n stim_count=5,\n delay_ms=5,\n amp_mv=400,\n pulse_width=100,\n random=False,\n replace=False\n)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Generates a tetanus pattern for neuron stimulation."}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Args:"}),"\nneurons (list): List of neurons. stim_count (int): Number of stimulations at most to use. delay_ms (int): Delay between stimulations in milliseconds. amp_mv (int): Amplitude in millivolts. pulse_width (int): Pulse width. replace (bool): Whether to replace selections."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Returns:"}),"\nlist: A sequence of stimulation and delay actions."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/trainer.py#L33",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-generate_permutations",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"generate_permutations"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"generate_permutations(\n neurons,\n stim_count=5,\n delay_ms=5,\n amp_mv=400,\n pulse_width=100\n)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Generates a list of tetanus patterns for all permutations of the given neurons."}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Args:"}),"\nneurons (list): List of neurons. stim_count (int): Number of stimulations. delay_ms (int): Delay between stimulations in milliseconds. amp_mv (int): Amplitude in millivolts. pulse_width (int): Pulse width."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Returns:"}),"\nlist: A list of sequences, each a unique permutation of stimulation and delay actions."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/trainer.py#L62",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-generate_stimulations",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"generate_stimulations"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"generate_stimulations(electrode_inds, amp=400, phase_width=200)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Creates a list of stimulation commands for the given electrodes with the given amplitude and phase width"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.em,{children:["This file was automatically generated via ",(0,s.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function u(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var s=t(6540);const i={},r=s.createContext(i);function a(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[237],{541:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>l});var s=t(4848),i=t(8453);const r={},a="module trainer.py",c={id:"docs/trainer.py",title:"trainer.py",description:"---",source:"@site/docs/docs/trainer.py.mdx",sourceDirName:"docs",slug:"/docs/trainer.py",permalink:"/braindance/docs/docs/trainer.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/trainer.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"train.py",permalink:"/braindance/docs/docs/train.py"},next:{title:"utils.py",permalink:"/braindance/docs/docs/utils.py"}},o={},l=[{value:"function generate_tetanus_pattern",id:"function-generate_tetanus_pattern",level:2},{value:"function generate_permutations",id:"function-generate_permutations",level:2},{value:"function generate_stimulations",id:"function-generate_stimulations",level:2}];function d(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/trainer.py#L0",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsx)(n.header,{children:(0,s.jsxs)(n.h1,{id:"module-trainerpy",children:[(0,s.jsx)("kbd",{children:"module"})," ",(0,s.jsx)(n.code,{children:"trainer.py"})]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/trainer.py#L5",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-generate_tetanus_pattern",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"generate_tetanus_pattern"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"generate_tetanus_pattern(\n neurons,\n stim_count=5,\n delay_ms=5,\n amp_mv=400,\n pulse_width=100,\n random=False,\n replace=False\n)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Generates a tetanus pattern for neuron stimulation."}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Args:"}),"\nneurons (list): List of neurons. stim_count (int): Number of stimulations at most to use. delay_ms (int): Delay between stimulations in milliseconds. amp_mv (int): Amplitude in millivolts. pulse_width (int): Pulse width. replace (bool): Whether to replace selections."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Returns:"}),"\nlist: A sequence of stimulation and delay actions."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/trainer.py#L33",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-generate_permutations",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"generate_permutations"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"generate_permutations(\n neurons,\n stim_count=5,\n delay_ms=5,\n amp_mv=400,\n pulse_width=100\n)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Generates a list of tetanus patterns for all permutations of the given neurons."}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Args:"}),"\nneurons (list): List of neurons. stim_count (int): Number of stimulations. delay_ms (int): Delay between stimulations in milliseconds. amp_mv (int): Amplitude in millivolts. pulse_width (int): Pulse width."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Returns:"}),"\nlist: A list of sequences, each a unique permutation of stimulation and delay actions."]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/trainer.py#L62",children:(0,s.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,s.jsxs)(n.h2,{id:"function-generate_stimulations",children:[(0,s.jsx)("kbd",{children:"function"})," ",(0,s.jsx)(n.code,{children:"generate_stimulations"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"generate_stimulations(electrode_inds, amp=400, phase_width=200)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Creates a list of stimulation commands for the given electrodes with the given amplitude and phase width"}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.em,{children:["This file was automatically generated via ",(0,s.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function u(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var s=t(6540);const i={},r=s.createContext(i);function a(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9d27e319.7cdddf88.js b/assets/js/9d27e319.22347ebc.js similarity index 96% rename from assets/js/9d27e319.7cdddf88.js rename to assets/js/9d27e319.22347ebc.js index f356a61e..0b97428e 100644 --- a/assets/js/9d27e319.7cdddf88.js +++ b/assets/js/9d27e319.22347ebc.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[143],{196:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>h,frontMatter:()=>r,metadata:()=>a,toc:()=>o});var c=t(4848),s=t(8453);const r={},i="module spikedetector.py",a={id:"docs/spikedetector.py",title:"spikedetector.py",description:"Global Variables",source:"@site/docs/docs/spikedetector.py.mdx",sourceDirName:"docs",slug:"/docs/spikedetector.py",permalink:"/BrainDance/docs/docs/spikedetector.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/spikedetector.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"select_electrodes.py",permalink:"/BrainDance/docs/docs/select_electrodes.py"},next:{title:"train.py",permalink:"/BrainDance/docs/docs/train.py"}},d={},o=[{value:"Global Variables",id:"global-variables",level:2},{value:"class SpikeDetector",id:"class-spikedetector",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function detect",id:"function-detect",level:3},{value:"function detect_chunk",id:"function-detect_chunk",level:3},{value:"function reset",id:"function-reset",level:3}];function l(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L0",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsx)(n.header,{children:(0,c.jsxs)(n.h1,{id:"module-spikedetectorpy",children:[(0,c.jsx)("kbd",{children:"module"})," ",(0,c.jsx)(n.code,{children:"spikedetector.py"})]})}),"\n",(0,c.jsx)(n.h2,{id:"global-variables",children:(0,c.jsx)(n.strong,{children:"Global Variables"})}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsx)(n.li,{children:(0,c.jsx)(n.strong,{children:"model_path"})}),"\n",(0,c.jsx)(n.li,{children:(0,c.jsx)(n.strong,{children:"map_location"})}),"\n"]}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsxs)(n.h2,{id:"class-spikedetector",children:[(0,c.jsx)("kbd",{children:"class"})," ",(0,c.jsx)(n.code,{children:"SpikeDetector"})]}),"\n",(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L18",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsxs)(n.h3,{id:"function-__init__",children:[(0,c.jsx)("kbd",{children:"function"})," ",(0,c.jsx)(n.code,{children:"__init__"})]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-python",children:"__init__(model_path, n_channels=256, n_frames=200, device='cuda')\n"})}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L28",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsxs)(n.h3,{id:"function-detect",children:[(0,c.jsx)("kbd",{children:"function"})," ",(0,c.jsx)(n.code,{children:"detect"})]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-python",children:"detect(data_frame)\n"})}),"\n",(0,c.jsx)(n.p,{children:"Takes in the current frame of data, adds it to the data slice, and returns the spike predictions"}),"\n",(0,c.jsx)(n.p,{children:"Parameters\n---------- data_frame : np.array of shape (n_channels, 1) The current frame of data Returns\n------- spike_preds : np.array of shape (n_channels, 120) The spike predictions for each channel, for the previous 6ms, or 120 frames"}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L63",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsxs)(n.h3,{id:"function-detect_chunk",children:[(0,c.jsx)("kbd",{children:"function"})," ",(0,c.jsx)(n.code,{children:"detect_chunk"})]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-python",children:"detect_chunk(data_chunk)\n"})}),"\n",(0,c.jsx)(n.p,{children:"Takes in a chunk of data, and returns the spike predictions for each channel for the last 6ms of data"}),"\n",(0,c.jsx)(n.p,{children:"Parameters\n---------- data_chunk : np.array of shape (n_channels, n_frames) The chunk of data to be processed Returns\n------- spike_preds : np.array of shape (n_channels, 120) The spike predictions for each channel, for the previous 6ms, or 120 frames"}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L104",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsxs)(n.h3,{id:"function-reset",children:[(0,c.jsx)("kbd",{children:"function"})," ",(0,c.jsx)(n.code,{children:"reset"})]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-python",children:"reset()\n"})}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsx)(n.p,{children:(0,c.jsxs)(n.em,{children:["This file was automatically generated via ",(0,c.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var c=t(6540);const s={},r=c.createContext(s);function i(e){const n=c.useContext(r);return c.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),c.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[143],{196:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>h,frontMatter:()=>r,metadata:()=>a,toc:()=>o});var c=t(4848),s=t(8453);const r={},i="module spikedetector.py",a={id:"docs/spikedetector.py",title:"spikedetector.py",description:"Global Variables",source:"@site/docs/docs/spikedetector.py.mdx",sourceDirName:"docs",slug:"/docs/spikedetector.py",permalink:"/braindance/docs/docs/spikedetector.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/spikedetector.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"select_electrodes.py",permalink:"/braindance/docs/docs/select_electrodes.py"},next:{title:"train.py",permalink:"/braindance/docs/docs/train.py"}},d={},o=[{value:"Global Variables",id:"global-variables",level:2},{value:"class SpikeDetector",id:"class-spikedetector",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"function detect",id:"function-detect",level:3},{value:"function detect_chunk",id:"function-detect_chunk",level:3},{value:"function reset",id:"function-reset",level:3}];function l(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L0",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsx)(n.header,{children:(0,c.jsxs)(n.h1,{id:"module-spikedetectorpy",children:[(0,c.jsx)("kbd",{children:"module"})," ",(0,c.jsx)(n.code,{children:"spikedetector.py"})]})}),"\n",(0,c.jsx)(n.h2,{id:"global-variables",children:(0,c.jsx)(n.strong,{children:"Global Variables"})}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsx)(n.li,{children:(0,c.jsx)(n.strong,{children:"model_path"})}),"\n",(0,c.jsx)(n.li,{children:(0,c.jsx)(n.strong,{children:"map_location"})}),"\n"]}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsxs)(n.h2,{id:"class-spikedetector",children:[(0,c.jsx)("kbd",{children:"class"})," ",(0,c.jsx)(n.code,{children:"SpikeDetector"})]}),"\n",(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L18",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsxs)(n.h3,{id:"function-__init__",children:[(0,c.jsx)("kbd",{children:"function"})," ",(0,c.jsx)(n.code,{children:"__init__"})]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-python",children:"__init__(model_path, n_channels=256, n_frames=200, device='cuda')\n"})}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L28",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsxs)(n.h3,{id:"function-detect",children:[(0,c.jsx)("kbd",{children:"function"})," ",(0,c.jsx)(n.code,{children:"detect"})]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-python",children:"detect(data_frame)\n"})}),"\n",(0,c.jsx)(n.p,{children:"Takes in the current frame of data, adds it to the data slice, and returns the spike predictions"}),"\n",(0,c.jsx)(n.p,{children:"Parameters\n---------- data_frame : np.array of shape (n_channels, 1) The current frame of data Returns\n------- spike_preds : np.array of shape (n_channels, 120) The spike predictions for each channel, for the previous 6ms, or 120 frames"}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L63",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsxs)(n.h3,{id:"function-detect_chunk",children:[(0,c.jsx)("kbd",{children:"function"})," ",(0,c.jsx)(n.code,{children:"detect_chunk"})]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-python",children:"detect_chunk(data_chunk)\n"})}),"\n",(0,c.jsx)(n.p,{children:"Takes in a chunk of data, and returns the spike predictions for each channel for the last 6ms of data"}),"\n",(0,c.jsx)(n.p,{children:"Parameters\n---------- data_chunk : np.array of shape (n_channels, n_frames) The chunk of data to be processed Returns\n------- spike_preds : np.array of shape (n_channels, 120) The spike predictions for each channel, for the previous 6ms, or 120 frames"}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/spikedetector.py#L104",children:(0,c.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,c.jsxs)(n.h3,{id:"function-reset",children:[(0,c.jsx)("kbd",{children:"function"})," ",(0,c.jsx)(n.code,{children:"reset"})]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-python",children:"reset()\n"})}),"\n",(0,c.jsx)(n.hr,{}),"\n",(0,c.jsx)(n.p,{children:(0,c.jsxs)(n.em,{children:["This file was automatically generated via ",(0,c.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var c=t(6540);const s={},r=c.createContext(s);function i(e){const n=c.useContext(r);return c.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),c.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/cd7db571.c2eab464.js b/assets/js/cd7db571.213c6305.js similarity index 98% rename from assets/js/cd7db571.c2eab464.js rename to assets/js/cd7db571.213c6305.js index aa89a6df..799d1c5e 100644 --- a/assets/js/cd7db571.c2eab464.js +++ b/assets/js/cd7db571.213c6305.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[736],{1105:(n,e,i)=>{i.r(e),i.d(e,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>s,metadata:()=>t,toc:()=>d});var r=i(4848),c=i(8453);const s={},a="module artifact_removal.py",t={id:"docs/artifact_removal.py",title:"artifact_removal.py",description:"Global Variables",source:"@site/docs/docs/artifact_removal.py.mdx",sourceDirName:"docs",slug:"/docs/artifact_removal.py",permalink:"/BrainDance/docs/docs/artifact_removal.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/artifact_removal.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Documentation",permalink:"/BrainDance/docs/category/documentation"},next:{title:"base_env.py",permalink:"/BrainDance/docs/docs/base_env.py"}},l={},d=[{value:"Global Variables",id:"global-variables",level:2},{value:"function docstring_wrapper",id:"function-docstring_wrapper",level:2},{value:"function cubic_fit5",id:"function-cubic_fit5",level:2},{value:"function mean_numba",id:"function-mean_numba",level:2},{value:"function cubic_fit2d",id:"function-cubic_fit2d",level:2},{value:"function fast_factorial",id:"function-fast_factorial",level:2},{value:"function fast_median",id:"function-fast_median",level:2},{value:"function fast_mmean",id:"function-fast_mmean",level:2},{value:"class ArtifactRemoval",id:"class-artifactremoval",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"handler shift_ind",id:"handler-shift_ind",level:4},{value:"function fit",id:"function-fit",level:3},{value:"function fit_step",id:"function-fit_step",level:3},{value:"function run",id:"function-run",level:3}];function o(n){const e={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,c.R)(),...n.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L0",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsx)(e.header,{children:(0,r.jsxs)(e.h1,{id:"module-artifact_removalpy",children:[(0,r.jsx)("kbd",{children:"module"})," ",(0,r.jsx)(e.code,{children:"artifact_removal.py"})]})}),"\n",(0,r.jsx)(e.h2,{id:"global-variables",children:(0,r.jsx)(e.strong,{children:"Global Variables"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:(0,r.jsx)(e.strong,{children:"LOOKUP_TABLE"})}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L5",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-docstring_wrapper",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"docstring_wrapper"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"docstring_wrapper(func)\n"})}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L11",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-cubic_fit5",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"cubic_fit5"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"cubic_fit5(\n v,\n N=60,\n nc_start=60,\n mean_arr=None,\n mean_std=None,\n artifact_width=50,\n remove_frames_before=8\n)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Perform cubic fitting on the input data."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"v"})})," (numpy.ndarray): Input data array."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"N"})})," (int): Window size for fitting. Default is 60."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"nc_start"})})," (int): Starting point for fitting. Default is 60."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"mean_arr"})})," (numpy.ndarray, optional): Array of mean values. Default is None."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"mean_std"})})," (float, optional): Standard deviation of mean values. Default is None."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"artifact_width"})})," (int): Width of artifact to remove. Default is 50."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"remove_frames_before"})})," (int): Number of frames to remove before artifact. Default is 8."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"tuple"})}),": A tuple containing:","\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"v_cleaned (numpy.ndarray): Cleaned data array."}),"\n",(0,r.jsx)(e.li,{children:"art (numpy.ndarray): Artifact array."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L33",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-mean_numba",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"mean_numba"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"mean_numba(a)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Compute mean of 2D array along axis 0 using Numba."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"a"})})," (numpy.ndarray): Input 2D array."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"numpy.ndarray"})}),": Array of mean values."]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L51",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-cubic_fit2d",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"cubic_fit2d"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"cubic_fit2d(\n data,\n N=60,\n nc_start=60,\n return_artifacts=False,\n artifact_width=50,\n remove_frames_before=8,\n n_stds=2\n)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Perform 2D cubic fitting on the input data."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"data"})})," (numpy.ndarray): Input 2D data array."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"N"})})," (int): Window size for fitting. Default is 60."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"nc_start"})})," (int): Starting point for fitting. Default is 60."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"return_artifacts"})})," (bool): Whether to return artifacts. Default is False."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"artifact_width"})})," (int): Width of artifact to remove. Default is 50."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"remove_frames_before"})})," (int): Number of frames to remove before artifact. Default is 8."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"n_stds"})})," (int): Number of standard deviations for threshold. Default is 2."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"tuple"})}),": A tuple containing:","\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"v_cleaned (numpy.ndarray): Cleaned 2D data array."}),"\n",(0,r.jsx)(e.li,{children:"art (numpy.ndarray or None): Artifact 2D array if return_artifacts is True, else None."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L81",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-fast_factorial",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fast_factorial"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fast_factorial(n)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Compute factorial using a lookup table for faster computation."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"n"})})," (int): Input number."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"int"})}),": Factorial of n."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Raises:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"ValueError"})}),": If n is greater than 20."]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L100",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-fast_median",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fast_median"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fast_median(a)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Compute median of an array using Numba for faster computation."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"a"})})," (numpy.ndarray): Input array."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"float"})}),": Median of the input array."]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L114",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-fast_mmean",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fast_mmean"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fast_mmean(q, frame)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Compute moving mean."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"q"})})," (float): Current moving mean."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"frame"})})," (float): New value."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"float"})}),": Updated moving mean."]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsxs)(e.h2,{id:"class-artifactremoval",children:[(0,r.jsx)("kbd",{children:"class"})," ",(0,r.jsx)(e.code,{children:"ArtifactRemoval"})]}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L136",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h3,{id:"function-__init__",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"__init__"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"__init__(N, nc_start=0, min_val=-100, max_val=100, spike_thresh=[-3.5, -20])\n"})}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsxs)(e.h4,{id:"handler-shift_ind",children:[(0,r.jsx)("kbd",{children:"handler"})," shift_ind"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L233",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h3,{id:"function-fit",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fit"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fit(v, T, S)\n"})}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L269",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h3,{id:"function-fit_step",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fit_step"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fit_step(frame)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Recursively computes the new W then solves for the artifact of the center frame when the new frame is added"}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L358",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h3,{id:"function-run",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"run"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"run(\n data,\n return_artifacts=False,\n return_spikes=False,\n progress_bar=False,\n n_workers=1\n)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Runs the process for the whole data input. If data is a 1D array, it will return the cleaned data If data is a 2D array, it will run for each row"}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsxs)(e.em,{children:["This file was automatically generated via ",(0,r.jsx)(e.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(n={}){const{wrapper:e}={...(0,c.R)(),...n.components};return e?(0,r.jsx)(e,{...n,children:(0,r.jsx)(o,{...n})}):o(n)}},8453:(n,e,i)=>{i.d(e,{R:()=>a,x:()=>t});var r=i(6540);const c={},s=r.createContext(c);function a(n){const e=r.useContext(s);return r.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function t(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(c):n.components||c:a(n.components),r.createElement(s.Provider,{value:e},n.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[736],{1105:(n,e,i)=>{i.r(e),i.d(e,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>s,metadata:()=>t,toc:()=>d});var r=i(4848),c=i(8453);const s={},a="module artifact_removal.py",t={id:"docs/artifact_removal.py",title:"artifact_removal.py",description:"Global Variables",source:"@site/docs/docs/artifact_removal.py.mdx",sourceDirName:"docs",slug:"/docs/artifact_removal.py",permalink:"/braindance/docs/docs/artifact_removal.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/artifact_removal.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Documentation",permalink:"/braindance/docs/category/documentation"},next:{title:"base_env.py",permalink:"/braindance/docs/docs/base_env.py"}},l={},d=[{value:"Global Variables",id:"global-variables",level:2},{value:"function docstring_wrapper",id:"function-docstring_wrapper",level:2},{value:"function cubic_fit5",id:"function-cubic_fit5",level:2},{value:"function mean_numba",id:"function-mean_numba",level:2},{value:"function cubic_fit2d",id:"function-cubic_fit2d",level:2},{value:"function fast_factorial",id:"function-fast_factorial",level:2},{value:"function fast_median",id:"function-fast_median",level:2},{value:"function fast_mmean",id:"function-fast_mmean",level:2},{value:"class ArtifactRemoval",id:"class-artifactremoval",level:2},{value:"function __init__",id:"function-__init__",level:3},{value:"handler shift_ind",id:"handler-shift_ind",level:4},{value:"function fit",id:"function-fit",level:3},{value:"function fit_step",id:"function-fit_step",level:3},{value:"function run",id:"function-run",level:3}];function o(n){const e={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,c.R)(),...n.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L0",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsx)(e.header,{children:(0,r.jsxs)(e.h1,{id:"module-artifact_removalpy",children:[(0,r.jsx)("kbd",{children:"module"})," ",(0,r.jsx)(e.code,{children:"artifact_removal.py"})]})}),"\n",(0,r.jsx)(e.h2,{id:"global-variables",children:(0,r.jsx)(e.strong,{children:"Global Variables"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:(0,r.jsx)(e.strong,{children:"LOOKUP_TABLE"})}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L5",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-docstring_wrapper",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"docstring_wrapper"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"docstring_wrapper(func)\n"})}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L11",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-cubic_fit5",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"cubic_fit5"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"cubic_fit5(\n v,\n N=60,\n nc_start=60,\n mean_arr=None,\n mean_std=None,\n artifact_width=50,\n remove_frames_before=8\n)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Perform cubic fitting on the input data."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"v"})})," (numpy.ndarray): Input data array."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"N"})})," (int): Window size for fitting. Default is 60."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"nc_start"})})," (int): Starting point for fitting. Default is 60."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"mean_arr"})})," (numpy.ndarray, optional): Array of mean values. Default is None."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"mean_std"})})," (float, optional): Standard deviation of mean values. Default is None."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"artifact_width"})})," (int): Width of artifact to remove. Default is 50."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"remove_frames_before"})})," (int): Number of frames to remove before artifact. Default is 8."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"tuple"})}),": A tuple containing:","\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"v_cleaned (numpy.ndarray): Cleaned data array."}),"\n",(0,r.jsx)(e.li,{children:"art (numpy.ndarray): Artifact array."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L33",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-mean_numba",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"mean_numba"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"mean_numba(a)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Compute mean of 2D array along axis 0 using Numba."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"a"})})," (numpy.ndarray): Input 2D array."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"numpy.ndarray"})}),": Array of mean values."]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L51",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-cubic_fit2d",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"cubic_fit2d"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"cubic_fit2d(\n data,\n N=60,\n nc_start=60,\n return_artifacts=False,\n artifact_width=50,\n remove_frames_before=8,\n n_stds=2\n)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Perform 2D cubic fitting on the input data."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"data"})})," (numpy.ndarray): Input 2D data array."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"N"})})," (int): Window size for fitting. Default is 60."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"nc_start"})})," (int): Starting point for fitting. Default is 60."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"return_artifacts"})})," (bool): Whether to return artifacts. Default is False."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"artifact_width"})})," (int): Width of artifact to remove. Default is 50."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"remove_frames_before"})})," (int): Number of frames to remove before artifact. Default is 8."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"n_stds"})})," (int): Number of standard deviations for threshold. Default is 2."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"tuple"})}),": A tuple containing:","\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"v_cleaned (numpy.ndarray): Cleaned 2D data array."}),"\n",(0,r.jsx)(e.li,{children:"art (numpy.ndarray or None): Artifact 2D array if return_artifacts is True, else None."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L81",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-fast_factorial",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fast_factorial"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fast_factorial(n)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Compute factorial using a lookup table for faster computation."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"n"})})," (int): Input number."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"int"})}),": Factorial of n."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Raises:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"ValueError"})}),": If n is greater than 20."]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L100",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-fast_median",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fast_median"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fast_median(a)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Compute median of an array using Numba for faster computation."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"a"})})," (numpy.ndarray): Input array."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"float"})}),": Median of the input array."]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L114",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h2,{id:"function-fast_mmean",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fast_mmean"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fast_mmean(q, frame)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Compute moving mean."}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Args:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"q"})})," (float): Current moving mean."]}),"\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"frame"})})," (float): New value."]}),"\n"]}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsx)(e.strong,{children:"Returns:"})}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(e.code,{children:"float"})}),": Updated moving mean."]}),"\n"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsxs)(e.h2,{id:"class-artifactremoval",children:[(0,r.jsx)("kbd",{children:"class"})," ",(0,r.jsx)(e.code,{children:"ArtifactRemoval"})]}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L136",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h3,{id:"function-__init__",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"__init__"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"__init__(N, nc_start=0, min_val=-100, max_val=100, spike_thresh=[-3.5, -20])\n"})}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsxs)(e.h4,{id:"handler-shift_ind",children:[(0,r.jsx)("kbd",{children:"handler"})," shift_ind"]}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L233",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h3,{id:"function-fit",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fit"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fit(v, T, S)\n"})}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L269",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h3,{id:"function-fit_step",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"fit_step"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"fit_step(frame)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Recursively computes the new W then solves for the artifact of the center frame when the new frame is added"}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/artifact_removal.py#L358",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(e.h3,{id:"function-run",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(e.code,{children:"run"})]}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"run(\n data,\n return_artifacts=False,\n return_spikes=False,\n progress_bar=False,\n n_workers=1\n)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Runs the process for the whole data input. If data is a 1D array, it will return the cleaned data If data is a 2D array, it will run for each row"}),"\n",(0,r.jsx)(e.hr,{}),"\n",(0,r.jsx)(e.p,{children:(0,r.jsxs)(e.em,{children:["This file was automatically generated via ",(0,r.jsx)(e.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(n={}){const{wrapper:e}={...(0,c.R)(),...n.components};return e?(0,r.jsx)(e,{...n,children:(0,r.jsx)(o,{...n})}):o(n)}},8453:(n,e,i)=>{i.d(e,{R:()=>a,x:()=>t});var r=i(6540);const c={},s=r.createContext(c);function a(n){const e=r.useContext(s);return r.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function t(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(c):n.components||c:a(n.components),r.createElement(s.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/d3d09cfd.9d1341dd.js b/assets/js/d3d09cfd.32a9d7cd.js similarity index 95% rename from assets/js/d3d09cfd.9d1341dd.js rename to assets/js/d3d09cfd.32a9d7cd.js index c286db99..a6986639 100644 --- a/assets/js/d3d09cfd.9d1341dd.js +++ b/assets/js/d3d09cfd.32a9d7cd.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[162],{8521:(e,n,c)=>{c.r(n),c.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>o,toc:()=>l});var r=c(4848),t=c(8453);const s={},i="module query_electrodes.py",o={id:"docs/query_electrodes.py",title:"query_electrodes.py",description:"---",source:"@site/docs/docs/query_electrodes.py.mdx",sourceDirName:"docs",slug:"/docs/query_electrodes.py",permalink:"/BrainDance/docs/docs/query_electrodes.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/query_electrodes.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"plot.py",permalink:"/BrainDance/docs/docs/plot.py"},next:{title:"select_electrodes.py",permalink:"/BrainDance/docs/docs/select_electrodes.py"}},d={},l=[{value:"function query_electrode_list",id:"function-query_electrode_list",level:2},{value:"function query_config",id:"function-query_config",level:2},{value:"function main",id:"function-main",level:2}];function a(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/query_electrodes.py#L0",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsx)(n.header,{children:(0,r.jsxs)(n.h1,{id:"module-query_electrodespy",children:[(0,r.jsx)("kbd",{children:"module"})," ",(0,r.jsx)(n.code,{children:"query_electrodes.py"})]})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/query_electrodes.py#L12",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-query_electrode_list",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"query_electrode_list"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"query_electrode_list(e)\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/query_electrodes.py#L26",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-query_config",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"query_config"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"query_config(config, electrodes=None, remove_duplicates=False)\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/query_electrodes.py#L66",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-main",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"main"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"main()\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.em,{children:["This file was automatically generated via ",(0,r.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function u(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},8453:(e,n,c)=>{c.d(n,{R:()=>i,x:()=>o});var r=c(6540);const t={},s=r.createContext(t);function i(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[162],{8521:(e,n,c)=>{c.r(n),c.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>o,toc:()=>l});var r=c(4848),t=c(8453);const s={},i="module query_electrodes.py",o={id:"docs/query_electrodes.py",title:"query_electrodes.py",description:"---",source:"@site/docs/docs/query_electrodes.py.mdx",sourceDirName:"docs",slug:"/docs/query_electrodes.py",permalink:"/braindance/docs/docs/query_electrodes.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/query_electrodes.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"plot.py",permalink:"/braindance/docs/docs/plot.py"},next:{title:"select_electrodes.py",permalink:"/braindance/docs/docs/select_electrodes.py"}},d={},l=[{value:"function query_electrode_list",id:"function-query_electrode_list",level:2},{value:"function query_config",id:"function-query_config",level:2},{value:"function main",id:"function-main",level:2}];function a(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/query_electrodes.py#L0",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsx)(n.header,{children:(0,r.jsxs)(n.h1,{id:"module-query_electrodespy",children:[(0,r.jsx)("kbd",{children:"module"})," ",(0,r.jsx)(n.code,{children:"query_electrodes.py"})]})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/query_electrodes.py#L12",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-query_electrode_list",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"query_electrode_list"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"query_electrode_list(e)\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/query_electrodes.py#L26",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-query_config",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"query_config"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"query_config(config, electrodes=None, remove_duplicates=False)\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/maxwell/query_electrodes.py#L66",children:(0,r.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,r.jsxs)(n.h2,{id:"function-main",children:[(0,r.jsx)("kbd",{children:"function"})," ",(0,r.jsx)(n.code,{children:"main"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"main()\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.em,{children:["This file was automatically generated via ",(0,r.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function u(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},8453:(e,n,c)=>{c.d(n,{R:()=>i,x:()=>o});var r=c(6540);const t={},s=r.createContext(t);function i(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d67e22fd.2a8d2f9c.js b/assets/js/d67e22fd.2a8d2f9c.js new file mode 100644 index 00000000..cf803459 --- /dev/null +++ b/assets/js/d67e22fd.2a8d2f9c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[39],{5592:e=>{e.exports=JSON.parse('{"categoryGeneratedIndex":{"title":"usage","description":"Usage of RT-Sort","slug":"/category/usage","permalink":"/braindance/docs/category/usage","sidebar":"tutorialSidebar","navigation":{"previous":{"title":"Installation","permalink":"/braindance/docs/RT-sort/installation"},"next":{"title":"Loading Detection Models","permalink":"/braindance/docs/RT-sort/usage/load-detection-model"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/dc176fb6.e2b87b65.js b/assets/js/dc176fb6.0b01a725.js similarity index 98% rename from assets/js/dc176fb6.e2b87b65.js rename to assets/js/dc176fb6.0b01a725.js index 14ae96e6..1951c758 100644 --- a/assets/js/dc176fb6.e2b87b65.js +++ b/assets/js/dc176fb6.0b01a725.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[128],{1859:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>h,frontMatter:()=>t,metadata:()=>d,toc:()=>c});var s=r(4848),i=r(8453);const t={sidebar_position:5},o="API Reference",d={id:"RT-sort/api-reference",title:"API Reference",description:"This page provides a detailed reference for the main classes and functions in RT-Sort.",source:"@site/docs/RT-sort/api-reference.md",sourceDirName:"RT-sort",slug:"/RT-sort/api-reference",permalink:"/BrainDance/docs/RT-sort/api-reference",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/api-reference.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Training Your Own Detection Models",permalink:"/BrainDance/docs/RT-sort/usage/training-models"},next:{title:"Documentation",permalink:"/BrainDance/docs/category/documentation"}},l={},c=[{value:"ModelSpikeSorter",id:"modelspikesorter",level:2},{value:"ModelSpikeSorter.load(detection_model_path)",id:"modelspikesorterloaddetection_model_path",level:3},{value:"Sequence Detection",id:"sequence-detection",level:2},{value:"detect_sequences(recording, inter_path, detection_model, **kwargs)",id:"detect_sequencesrecording-inter_path-detection_model-kwargs",level:3},{value:"RTSort",id:"rtsort",level:2},{value:"reset()",id:"reset",level:3},{value:"running_sort(obs)",id:"running_sortobs",level:3},{value:"Training",id:"training",level:2},{value:"train_detection_model(recordings, **kwargs)",id:"train_detection_modelrecordings-kwargs",level:3},{value:"Kilosort2 Integration",id:"kilosort2-integration",level:2},{value:"run_kilosort2(recording_files, **kwargs)",id:"run_kilosort2recording_files-kwargs",level:3},{value:"Usage Examples",id:"usage-examples",level:2},{value:"Offline Sequence Detection",id:"offline-sequence-detection",level:3},{value:"Online Sorting",id:"online-sorting",level:3}];function a(e){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"api-reference",children:"API Reference"})}),"\n",(0,s.jsx)(n.p,{children:"This page provides a detailed reference for the main classes and functions in RT-Sort."}),"\n",(0,s.jsx)(n.h2,{id:"modelspikesorter",children:"ModelSpikeSorter"}),"\n",(0,s.jsx)(n.h3,{id:"modelspikesorterloaddetection_model_path",children:(0,s.jsx)(n.code,{children:"ModelSpikeSorter.load(detection_model_path)"})}),"\n",(0,s.jsx)(n.p,{children:"Loads a pre-trained detection model."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"detection_model_path"}),": Path to a folder containing a ModelSpikeSorter object's files."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," ModelSpikeSorter object"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"sequence-detection",children:"Sequence Detection"}),"\n",(0,s.jsx)(n.h3,{id:"detect_sequencesrecording-inter_path-detection_model-kwargs",children:(0,s.jsx)(n.code,{children:"detect_sequences(recording, inter_path, detection_model, **kwargs)"})}),"\n",(0,s.jsx)(n.p,{children:"Detects sequences in a recording."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"recording"}),": Recording loaded with SpikeInterface or path to a saved recording."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"inter_path"}),": Path to a folder for intermediate cached data."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"detection_model"}),": ModelSpikeSorter object or path to its folder."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"**kwargs"}),": Additional optional parameters.","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"recording_window_ms"}),": Tuple (start_ms, end_ms) for section of recording to process. Default is None (entire duration)."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"delete_inter"}),": Whether to delete the intermediate directory. Default is False."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"verbose"}),": Whether to print progress. Default is True."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"num_processes"}),": Number of CPU processes to use. Default is None (uses all available)."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," RTSort object or NumPy array of spike trains."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"rtsort",children:"RTSort"}),"\n",(0,s.jsx)(n.h3,{id:"reset",children:(0,s.jsx)(n.code,{children:"reset()"})}),"\n",(0,s.jsx)(n.p,{children:"Resets the RTSort object for online use."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"})," None"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," None"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"running_sortobs",children:(0,s.jsx)(n.code,{children:"running_sort(obs)"})}),"\n",(0,s.jsx)(n.p,{children:"Sorts a stream of data in real-time."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"obs"}),": NumPy array with shape (num_frames, num_electrodes)."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," List of tuples containing sorted spike data."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"training",children:"Training"}),"\n",(0,s.jsx)(n.h3,{id:"train_detection_modelrecordings-kwargs",children:(0,s.jsx)(n.code,{children:"train_detection_model(recordings, **kwargs)"})}),"\n",(0,s.jsx)(n.p,{children:"Trains a new detection model."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"recordings"}),": List of recordings for training."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"**kwargs"}),": Additional optional parameters.","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"kilosort_path"}),": Folder where Kilosort2 is installed. Default is None."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"input_scale"}),": Multiplier for recording traces. Default is 0.01."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"learning_rate"}),": Learning rate for training. Default is 7.76e-4."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"validation_recording"}),": Recording to use as validation. Default is None."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," ModelSpikeSorter object"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"kilosort2-integration",children:"Kilosort2 Integration"}),"\n",(0,s.jsx)(n.h3,{id:"run_kilosort2recording_files-kwargs",children:(0,s.jsx)(n.code,{children:"run_kilosort2(recording_files, **kwargs)"})}),"\n",(0,s.jsx)(n.p,{children:"Runs Kilosort2 on a set of recordings."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"recording_files"}),": List of recordings to spike sort."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"**kwargs"}),": Additional optional parameters.","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"kilosort_path"}),": Folder where Kilosort2 is installed."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"results_folders"}),": List of folders to store sorted results. Default is None."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"compile_to_npz"}),': Whether to save results as "sorted.npz". Default is True.']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"compile_to_mat"}),': Whether to save results as "sorted.mat". Default is False.']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"intermediate_folders"}),": List of folders for intermediate results. Default is None."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"delete_inter"}),": Whether to delete intermediate folders after sorting. Default is True."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," None (results are saved to files)"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"usage-examples",children:"Usage Examples"}),"\n",(0,s.jsx)(n.h3,{id:"offline-sequence-detection",children:"Offline Sequence Detection"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"rt_sort = detect_sequences(recording, inter_path, detection_model, recording_window_ms=(0, 5*60*1000))\nsequence_spike_trains = rt_sort.sort_offline(recording, inter_path, recording_window_ms=(5*60*1000, 10*60*1000), verbose=True)\n"})}),"\n",(0,s.jsx)(n.h3,{id:"online-sorting",children:"Online Sorting"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"rt_sort.reset()\nwhile not done:\n obs, done = env.step()\n sequence_detections = rt_sort.running_sort(obs)\n # Process sequence_detections\n"})}),"\n",(0,s.jsx)(n.p,{children:"For more detailed information on each function and its parameters, please refer to the respective sections in the user manual."})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>d});var s=r(6540);const i={},t=s.createContext(i);function o(e){const n=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[128],{1859:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>h,frontMatter:()=>t,metadata:()=>d,toc:()=>c});var s=r(4848),i=r(8453);const t={sidebar_position:5},o="API Reference",d={id:"RT-sort/api-reference",title:"API Reference",description:"This page provides a detailed reference for the main classes and functions in RT-Sort.",source:"@site/docs/RT-sort/api-reference.md",sourceDirName:"RT-sort",slug:"/RT-sort/api-reference",permalink:"/braindance/docs/RT-sort/api-reference",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/api-reference.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5},sidebar:"tutorialSidebar",previous:{title:"Training Your Own Detection Models",permalink:"/braindance/docs/RT-sort/usage/training-models"},next:{title:"Documentation",permalink:"/braindance/docs/category/documentation"}},l={},c=[{value:"ModelSpikeSorter",id:"modelspikesorter",level:2},{value:"ModelSpikeSorter.load(detection_model_path)",id:"modelspikesorterloaddetection_model_path",level:3},{value:"Sequence Detection",id:"sequence-detection",level:2},{value:"detect_sequences(recording, inter_path, detection_model, **kwargs)",id:"detect_sequencesrecording-inter_path-detection_model-kwargs",level:3},{value:"RTSort",id:"rtsort",level:2},{value:"reset()",id:"reset",level:3},{value:"running_sort(obs)",id:"running_sortobs",level:3},{value:"Training",id:"training",level:2},{value:"train_detection_model(recordings, **kwargs)",id:"train_detection_modelrecordings-kwargs",level:3},{value:"Kilosort2 Integration",id:"kilosort2-integration",level:2},{value:"run_kilosort2(recording_files, **kwargs)",id:"run_kilosort2recording_files-kwargs",level:3},{value:"Usage Examples",id:"usage-examples",level:2},{value:"Offline Sequence Detection",id:"offline-sequence-detection",level:3},{value:"Online Sorting",id:"online-sorting",level:3}];function a(e){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"api-reference",children:"API Reference"})}),"\n",(0,s.jsx)(n.p,{children:"This page provides a detailed reference for the main classes and functions in RT-Sort."}),"\n",(0,s.jsx)(n.h2,{id:"modelspikesorter",children:"ModelSpikeSorter"}),"\n",(0,s.jsx)(n.h3,{id:"modelspikesorterloaddetection_model_path",children:(0,s.jsx)(n.code,{children:"ModelSpikeSorter.load(detection_model_path)"})}),"\n",(0,s.jsx)(n.p,{children:"Loads a pre-trained detection model."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"detection_model_path"}),": Path to a folder containing a ModelSpikeSorter object's files."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," ModelSpikeSorter object"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"sequence-detection",children:"Sequence Detection"}),"\n",(0,s.jsx)(n.h3,{id:"detect_sequencesrecording-inter_path-detection_model-kwargs",children:(0,s.jsx)(n.code,{children:"detect_sequences(recording, inter_path, detection_model, **kwargs)"})}),"\n",(0,s.jsx)(n.p,{children:"Detects sequences in a recording."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"recording"}),": Recording loaded with SpikeInterface or path to a saved recording."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"inter_path"}),": Path to a folder for intermediate cached data."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"detection_model"}),": ModelSpikeSorter object or path to its folder."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"**kwargs"}),": Additional optional parameters.","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"recording_window_ms"}),": Tuple (start_ms, end_ms) for section of recording to process. Default is None (entire duration)."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"delete_inter"}),": Whether to delete the intermediate directory. Default is False."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"verbose"}),": Whether to print progress. Default is True."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"num_processes"}),": Number of CPU processes to use. Default is None (uses all available)."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," RTSort object or NumPy array of spike trains."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"rtsort",children:"RTSort"}),"\n",(0,s.jsx)(n.h3,{id:"reset",children:(0,s.jsx)(n.code,{children:"reset()"})}),"\n",(0,s.jsx)(n.p,{children:"Resets the RTSort object for online use."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"})," None"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," None"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"running_sortobs",children:(0,s.jsx)(n.code,{children:"running_sort(obs)"})}),"\n",(0,s.jsx)(n.p,{children:"Sorts a stream of data in real-time."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"obs"}),": NumPy array with shape (num_frames, num_electrodes)."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," List of tuples containing sorted spike data."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"training",children:"Training"}),"\n",(0,s.jsx)(n.h3,{id:"train_detection_modelrecordings-kwargs",children:(0,s.jsx)(n.code,{children:"train_detection_model(recordings, **kwargs)"})}),"\n",(0,s.jsx)(n.p,{children:"Trains a new detection model."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"recordings"}),": List of recordings for training."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"**kwargs"}),": Additional optional parameters.","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"kilosort_path"}),": Folder where Kilosort2 is installed. Default is None."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"input_scale"}),": Multiplier for recording traces. Default is 0.01."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"learning_rate"}),": Learning rate for training. Default is 7.76e-4."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"validation_recording"}),": Recording to use as validation. Default is None."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," ModelSpikeSorter object"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"kilosort2-integration",children:"Kilosort2 Integration"}),"\n",(0,s.jsx)(n.h3,{id:"run_kilosort2recording_files-kwargs",children:(0,s.jsx)(n.code,{children:"run_kilosort2(recording_files, **kwargs)"})}),"\n",(0,s.jsx)(n.p,{children:"Runs Kilosort2 on a set of recordings."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Parameters:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"recording_files"}),": List of recordings to spike sort."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"**kwargs"}),": Additional optional parameters.","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"kilosort_path"}),": Folder where Kilosort2 is installed."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"results_folders"}),": List of folders to store sorted results. Default is None."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"compile_to_npz"}),': Whether to save results as "sorted.npz". Default is True.']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"compile_to_mat"}),': Whether to save results as "sorted.mat". Default is False.']}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"intermediate_folders"}),": List of folders for intermediate results. Default is None."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"delete_inter"}),": Whether to delete intermediate folders after sorting. Default is True."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Returns:"})," None (results are saved to files)"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"usage-examples",children:"Usage Examples"}),"\n",(0,s.jsx)(n.h3,{id:"offline-sequence-detection",children:"Offline Sequence Detection"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"rt_sort = detect_sequences(recording, inter_path, detection_model, recording_window_ms=(0, 5*60*1000))\nsequence_spike_trains = rt_sort.sort_offline(recording, inter_path, recording_window_ms=(5*60*1000, 10*60*1000), verbose=True)\n"})}),"\n",(0,s.jsx)(n.h3,{id:"online-sorting",children:"Online Sorting"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"rt_sort.reset()\nwhile not done:\n obs, done = env.step()\n sequence_detections = rt_sort.running_sort(obs)\n # Process sequence_detections\n"})}),"\n",(0,s.jsx)(n.p,{children:"For more detailed information on each function and its parameters, please refer to the respective sections in the user manual."})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>d});var s=r(6540);const i={},t=s.createContext(i);function o(e){const n=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e7bb38f3.b30b3510.js b/assets/js/e7bb38f3.b30b3510.js new file mode 100644 index 00000000..7636bc69 --- /dev/null +++ b/assets/js/e7bb38f3.b30b3510.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[611],{3518:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"BrainDance","href":"/braindance/docs/","docId":"intro","unlisted":false},{"type":"link","label":"Quick Start Guide","href":"/braindance/docs/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Core Concepts","href":"/braindance/docs/core-concepts","docId":"core-concepts","unlisted":false},{"type":"category","label":"RT-Sort","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Introduction to RT-Sort","href":"/braindance/docs/RT-sort/introduction","docId":"RT-sort/introduction","unlisted":false},{"type":"link","label":"Installation","href":"/braindance/docs/RT-sort/installation","docId":"RT-sort/installation","unlisted":false},{"type":"category","label":"usage","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Loading Detection Models","href":"/braindance/docs/RT-sort/usage/load-detection-model","docId":"RT-sort/usage/load-detection-model","unlisted":false},{"type":"link","label":"Sequence Detection (Offline Use)","href":"/braindance/docs/RT-sort/usage/sequence-detection","docId":"RT-sort/usage/sequence-detection","unlisted":false},{"type":"link","label":"Real-time Application (Online Use)","href":"/braindance/docs/RT-sort/usage/real-time-application","docId":"RT-sort/usage/real-time-application","unlisted":false},{"type":"link","label":"Training Your Own Detection Models","href":"/braindance/docs/RT-sort/usage/training-models","docId":"RT-sort/usage/training-models","unlisted":false}],"href":"/braindance/docs/category/usage"},{"type":"link","label":"API Reference","href":"/braindance/docs/RT-sort/api-reference","docId":"RT-sort/api-reference","unlisted":false}],"href":"/braindance/docs/category/rt-sort"},{"type":"category","label":"Documentation","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"artifact_removal.py","href":"/braindance/docs/docs/artifact_removal.py","docId":"docs/artifact_removal.py","unlisted":false},{"type":"link","label":"base_env.py","href":"/braindance/docs/docs/base_env.py","docId":"docs/base_env.py","unlisted":false},{"type":"link","label":"data_loader.py","href":"/braindance/docs/docs/data_loader.py","docId":"docs/data_loader.py","unlisted":false},{"type":"link","label":"dummy_maxlab.py","href":"/braindance/docs/docs/dummy_maxlab.py","docId":"docs/dummy_maxlab.py","unlisted":false},{"type":"link","label":"dummy_zmq_np.py","href":"/braindance/docs/docs/dummy_zmq_np.py","docId":"docs/dummy_zmq_np.py","unlisted":false},{"type":"link","label":"maxwell_env.py","href":"/braindance/docs/docs/maxwell_env.py","docId":"docs/maxwell_env.py","unlisted":false},{"type":"link","label":"maxwell_utils.py","href":"/braindance/docs/docs/maxwell_utils.py","docId":"docs/maxwell_utils.py","unlisted":false},{"type":"link","label":"params.py","href":"/braindance/docs/docs/params.py","docId":"docs/params.py","unlisted":false},{"type":"link","label":"phases.py","href":"/braindance/docs/docs/phases.py","docId":"docs/phases.py","unlisted":false},{"type":"link","label":"plot.py","href":"/braindance/docs/docs/plot.py","docId":"docs/plot.py","unlisted":false},{"type":"link","label":"query_electrodes.py","href":"/braindance/docs/docs/query_electrodes.py","docId":"docs/query_electrodes.py","unlisted":false},{"type":"link","label":"select_electrodes.py","href":"/braindance/docs/docs/select_electrodes.py","docId":"docs/select_electrodes.py","unlisted":false},{"type":"link","label":"spikedetector.py","href":"/braindance/docs/docs/spikedetector.py","docId":"docs/spikedetector.py","unlisted":false},{"type":"link","label":"train.py","href":"/braindance/docs/docs/train.py","docId":"docs/train.py","unlisted":false},{"type":"link","label":"trainer.py","href":"/braindance/docs/docs/trainer.py","docId":"docs/trainer.py","unlisted":false},{"type":"link","label":"utils.py","href":"/braindance/docs/docs/utils.py","docId":"docs/utils.py","unlisted":false}],"href":"/braindance/docs/category/documentation"}]},"docs":{"core-concepts":{"id":"core-concepts","title":"Core Concepts","description":"Understanding the core concepts of BrainDance will help you design and execute more complex experiments.","sidebar":"tutorialSidebar"},"docs/artifact_removal.py":{"id":"docs/artifact_removal.py","title":"artifact_removal.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/base_env.py":{"id":"docs/base_env.py","title":"base_env.py","description":"---","sidebar":"tutorialSidebar"},"docs/data_loader.py":{"id":"docs/data_loader.py","title":"data_loader.py","description":"---","sidebar":"tutorialSidebar"},"docs/dummy_maxlab.py":{"id":"docs/dummy_maxlab.py","title":"dummy_maxlab.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/dummy_zmq_np.py":{"id":"docs/dummy_zmq_np.py","title":"dummy_zmq_np.py","description":"ZMQ Publisher for streaming simulated or real neural data.","sidebar":"tutorialSidebar"},"docs/maxwell_env.py":{"id":"docs/maxwell_env.py","title":"maxwell_env.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/maxwell_utils.py":{"id":"docs/maxwell_utils.py","title":"maxwell_utils.py","description":"---","sidebar":"tutorialSidebar"},"docs/params.py":{"id":"docs/params.py","title":"params.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/phases.py":{"id":"docs/phases.py","title":"phases.py","description":"Experiment phases","sidebar":"tutorialSidebar"},"docs/plot.py":{"id":"docs/plot.py","title":"plot.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/query_electrodes.py":{"id":"docs/query_electrodes.py","title":"query_electrodes.py","description":"---","sidebar":"tutorialSidebar"},"docs/select_electrodes.py":{"id":"docs/select_electrodes.py","title":"select_electrodes.py","description":"---","sidebar":"tutorialSidebar"},"docs/spikedetector.py":{"id":"docs/spikedetector.py","title":"spikedetector.py","description":"Global Variables","sidebar":"tutorialSidebar"},"docs/train.py":{"id":"docs/train.py","title":"train.py","description":"---","sidebar":"tutorialSidebar"},"docs/trainer.py":{"id":"docs/trainer.py","title":"trainer.py","description":"---","sidebar":"tutorialSidebar"},"docs/utils.py":{"id":"docs/utils.py","title":"utils.py","description":"---","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"BrainDance","description":"Neural stimulation framework for organoids and cultures with micro electrode arrays","sidebar":"tutorialSidebar"},"quick-start":{"id":"quick-start","title":"Quick Start Guide","description":"Get up and running with BrainDance in just a few minutes!","sidebar":"tutorialSidebar"},"RT-sort/api-reference":{"id":"RT-sort/api-reference","title":"API Reference","description":"This page provides a detailed reference for the main classes and functions in RT-Sort.","sidebar":"tutorialSidebar"},"RT-sort/installation":{"id":"RT-sort/installation","title":"Installation","description":"To install RT-Sort, follow these steps:","sidebar":"tutorialSidebar"},"RT-sort/introduction":{"id":"RT-sort/introduction","title":"Introduction to RT-Sort","description":"RT-Sort is a powerful tool for real-time spike detection and sorting with millisecond latencies. This user manual will guide you through the installation, usage, and advanced features of RT-Sort.","sidebar":"tutorialSidebar"},"RT-sort/usage/load-detection-model":{"id":"RT-sort/usage/load-detection-model","title":"Loading Detection Models","description":"To use RT-Sort, you first need to load a detection model. Here\'s how to do it:","sidebar":"tutorialSidebar"},"RT-sort/usage/real-time-application":{"id":"RT-sort/usage/real-time-application","title":"Real-time Application (Online Use)","description":"Once you have detected sequences, you can use RT-Sort for real-time applications. Here\'s how to do it:","sidebar":"tutorialSidebar"},"RT-sort/usage/sequence-detection":{"id":"RT-sort/usage/sequence-detection","title":"Sequence Detection (Offline Use)","description":"RT-Sort can be used for offline sequence detection with a pre-trained detection model. Here\'s how to do it for both Maxwell MEAs and Neuropixels.","sidebar":"tutorialSidebar"},"RT-sort/usage/training-models":{"id":"RT-sort/usage/training-models","title":"Training Your Own Detection Models","description":"RT-Sort allows you to train your own detection models using leave-one-out cross-validation. Here\'s how to do it:","sidebar":"tutorialSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/eddf7db5.7baf1b47.js b/assets/js/eddf7db5.dfd5f488.js similarity index 98% rename from assets/js/eddf7db5.7baf1b47.js rename to assets/js/eddf7db5.dfd5f488.js index 2a305136..326b4ec2 100644 --- a/assets/js/eddf7db5.7baf1b47.js +++ b/assets/js/eddf7db5.dfd5f488.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[860],{9173:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>h,frontMatter:()=>c,metadata:()=>o,toc:()=>a});var t=s(4848),i=s(8453);const c={},r="module utils.py",o={id:"docs/utils.py",title:"utils.py",description:"---",source:"@site/docs/docs/utils.py.mdx",sourceDirName:"docs",slug:"/docs/utils.py",permalink:"/BrainDance/docs/docs/utils.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/utils.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"trainer.py",permalink:"/BrainDance/docs/docs/trainer.py"}},d={},a=[{value:"function confusion_matrix",id:"function-confusion_matrix",level:2},{value:"function confusion_stats",id:"function-confusion_stats",level:2},{value:"function random_seed",id:"function-random_seed",level:2},{value:"function get_time",id:"function-get_time",level:2},{value:"function copy_file",id:"function-copy_file",level:2},{value:"function round",id:"function-round",level:2},{value:"function torch_to_np",id:"function-torch_to_np",level:2}];function l(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L0",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsx)(n.header,{children:(0,t.jsxs)(n.h1,{id:"module-utilspy",children:[(0,t.jsx)("kbd",{children:"module"})," ",(0,t.jsx)(n.code,{children:"utils.py"})]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L9",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-confusion_matrix",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"confusion_matrix"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"confusion_matrix(preds, labels)\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L20",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-confusion_stats",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"confusion_stats"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"confusion_stats(confusion_matrix)\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L29",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-random_seed",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"random_seed"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"random_seed(seed, silent=False)\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L37",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-get_time",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"get_time"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"get_time()\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Gets the time in the string format of yymmdd_HHMMSS_ffffff (",(0,t.jsx)(n.a,{href:"https://www.programiz.com/python-programming/datetime/strftime",children:"https://www.programiz.com/python-programming/datetime/strftime"}),") Ex: If run at 9/26/22 at 3:53pm and 30 seconds and 1 microsecond, yymmdd_HHMMSS_ffffff = 220926_155330_000001"]}),"\n",(0,t.jsx)(n.p,{children:":return: str Formatted time"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L49",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-copy_file",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"copy_file"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"copy_file(src_path, dest_folder)\n"})}),"\n",(0,t.jsx)(n.p,{children:"Copies file at src_path and stores in dest_folder"}),"\n",(0,t.jsxs)(n.p,{children:[":param"," src_path: Path or str Path of source file ",":param"," dest_folder: Path or str Path to folder in which source file is saved The copied file has the same name as the source file Ex) test.py saved on 9/26/22 at 1:30pm will be saved as 220926_1330_test.py"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L65",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-round",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"round"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"round(n)\n"})}),"\n",(0,t.jsx)(n.p,{children:"Rounds a float (n) to the nearest integer Uses standard math rounding, i.e. 0.5 rounds up to 1"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L79",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-torch_to_np",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"torch_to_np"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"torch_to_np(tensor)\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.em,{children:["This file was automatically generated via ",(0,t.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>o});var t=s(6540);const i={},c=t.createContext(i);function r(e){const n=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[860],{9173:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>h,frontMatter:()=>c,metadata:()=>o,toc:()=>a});var t=s(4848),i=s(8453);const c={},r="module utils.py",o={id:"docs/utils.py",title:"utils.py",description:"---",source:"@site/docs/docs/utils.py.mdx",sourceDirName:"docs",slug:"/docs/utils.py",permalink:"/braindance/docs/docs/utils.py",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/docs/utils.py.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"trainer.py",permalink:"/braindance/docs/docs/trainer.py"}},d={},a=[{value:"function confusion_matrix",id:"function-confusion_matrix",level:2},{value:"function confusion_stats",id:"function-confusion_stats",level:2},{value:"function random_seed",id:"function-random_seed",level:2},{value:"function get_time",id:"function-get_time",level:2},{value:"function copy_file",id:"function-copy_file",level:2},{value:"function round",id:"function-round",level:2},{value:"function torch_to_np",id:"function-torch_to_np",level:2}];function l(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",hr:"hr",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L0",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsx)(n.header,{children:(0,t.jsxs)(n.h1,{id:"module-utilspy",children:[(0,t.jsx)("kbd",{children:"module"})," ",(0,t.jsx)(n.code,{children:"utils.py"})]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L9",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-confusion_matrix",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"confusion_matrix"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"confusion_matrix(preds, labels)\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L20",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-confusion_stats",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"confusion_stats"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"confusion_stats(confusion_matrix)\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L29",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-random_seed",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"random_seed"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"random_seed(seed, silent=False)\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L37",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-get_time",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"get_time"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"get_time()\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Gets the time in the string format of yymmdd_HHMMSS_ffffff (",(0,t.jsx)(n.a,{href:"https://www.programiz.com/python-programming/datetime/strftime",children:"https://www.programiz.com/python-programming/datetime/strftime"}),") Ex: If run at 9/26/22 at 3:53pm and 30 seconds and 1 microsecond, yymmdd_HHMMSS_ffffff = 220926_155330_000001"]}),"\n",(0,t.jsx)(n.p,{children:":return: str Formatted time"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L49",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-copy_file",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"copy_file"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"copy_file(src_path, dest_folder)\n"})}),"\n",(0,t.jsx)(n.p,{children:"Copies file at src_path and stores in dest_folder"}),"\n",(0,t.jsxs)(n.p,{children:[":param"," src_path: Path or str Path of source file ",":param"," dest_folder: Path or str Path to folder in which source file is saved The copied file has the same name as the source file Ex) test.py saved on 9/26/22 at 1:30pm will be saved as 220926_1330_test.py"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L65",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-round",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"round"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"round(n)\n"})}),"\n",(0,t.jsx)(n.p,{children:"Rounds a float (n) to the nearest integer Uses standard math rounding, i.e. 0.5 rounds up to 1"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("a",{href:"https://github.com/braingeneers/braindance/blob/main/braindance/core/spikedetector/utils.py#L79",children:(0,t.jsx)("img",{align:"right",style:{float:"right"},src:"https://img.shields.io/badge/-source-cccccc?style=flat-square"})}),"\n",(0,t.jsxs)(n.h2,{id:"function-torch_to_np",children:[(0,t.jsx)("kbd",{children:"function"})," ",(0,t.jsx)(n.code,{children:"torch_to_np"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"torch_to_np(tensor)\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.em,{children:["This file was automatically generated via ",(0,t.jsx)(n.a,{href:"https://github.com/ml-tooling/lazydocs",children:"lazydocs"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>o});var t=s(6540);const i={},c=t.createContext(i);function r(e){const n=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/efa6ead6.d94441d0.js b/assets/js/efa6ead6.4f9a4d6b.js similarity index 96% rename from assets/js/efa6ead6.d94441d0.js rename to assets/js/efa6ead6.4f9a4d6b.js index 006e42d4..d26aee91 100644 --- a/assets/js/efa6ead6.d94441d0.js +++ b/assets/js/efa6ead6.4f9a4d6b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[683],{180:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>a,toc:()=>l});var t=r(4848),s=r(8453);const i={sidebar_position:2},o="Sequence Detection (Offline Use)",a={id:"RT-sort/usage/sequence-detection",title:"Sequence Detection (Offline Use)",description:"RT-Sort can be used for offline sequence detection with a pre-trained detection model. Here's how to do it for both Maxwell MEAs and Neuropixels.",source:"@site/docs/RT-sort/usage/sequence-detection.md",sourceDirName:"RT-sort/usage",slug:"/RT-sort/usage/sequence-detection",permalink:"/BrainDance/docs/RT-sort/usage/sequence-detection",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/usage/sequence-detection.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Loading Detection Models",permalink:"/BrainDance/docs/RT-sort/usage/load-detection-model"},next:{title:"Real-time Application (Online Use)",permalink:"/BrainDance/docs/RT-sort/usage/real-time-application"}},c={},l=[{value:"Maxwell MEAs",id:"maxwell-meas",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Optional Parameters",id:"optional-parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Example",id:"example",level:3},{value:"Neuropixels",id:"neuropixels",level:2},{value:"Next Steps",id:"next-steps",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"sequence-detection-offline-use",children:"Sequence Detection (Offline Use)"})}),"\n",(0,t.jsx)(n.p,{children:"RT-Sort can be used for offline sequence detection with a pre-trained detection model. Here's how to do it for both Maxwell MEAs and Neuropixels."}),"\n",(0,t.jsx)(n.h2,{id:"maxwell-meas",children:"Maxwell MEAs"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"from braindance.core.spikesorter.rt_sort import detect_sequences\n\nrt_sort = detect_sequences(recording, inter_path, detection_model, **kwargs)\n"})}),"\n",(0,t.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"recording"}),": Recording loaded with SpikeInterface or a path to a saved recording (str or pathlib.Path)."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"inter_path"}),": Path to a folder where RT-Sort's intermediate cached data is stored."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"detection_model"}),": ModelSpikeSorter object or a path to a folder containing a ModelSpikeSorter object's files."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"optional-parameters",children:"Optional Parameters"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"recording_window_ms"}),": Tuple (start_ms, end_ms) indicating which section of the recording to run RT-Sort. Default is None (entire duration)."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"delete_inter"}),": Whether to delete the directory inter_path and its contents. Default is False."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"verbose"}),": Whether to print progress of RT-Sort. Default is True."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"num_processes"}),": Number of CPU processes to use. Default is None (uses all available logical CPUs)."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["If ",(0,t.jsx)(n.code,{children:"return_spikes=False"})," (default): Returns an RTSort object."]}),"\n",(0,t.jsxs)(n.li,{children:["If ",(0,t.jsx)(n.code,{children:"return_spikes=True"}),": Returns a NumPy array of shape (num_sequences,) where each element is a NumPy array containing a sequence's spike train."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"# Detect sequences in the first 5 minutes of a recording\nrt_sort = detect_sequences(recording, inter_path, detection_model, recording_window_ms=(0, 5*60*1000))\n\n# Assign spikes in the next 5 minutes\nsequence_spike_trains = rt_sort.sort_offline(recording, inter_path, recording_window_ms=(5*60*1000, 10*60*1000), verbose=True)\n"})}),"\n",(0,t.jsx)(n.h2,{id:"neuropixels",children:"Neuropixels"}),"\n",(0,t.jsx)(n.p,{children:"The process for Neuropixels is similar to Maxwell MEAs, with one key difference:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"from braindance.core.spikesorter.rt_sort import detect_sequences, neuropixels_params\n\nrt_sort = detect_sequences(recording, inter_path, detection_model, **neuropixels_params, **kwargs)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Use the ",(0,t.jsx)(n.code,{children:"neuropixels_params"})," dictionary to pass Neuropixels-specific RT-Sort parameters. It's also recommended to use a Neuropixels-specific detection model."]}),"\n",(0,t.jsx)(n.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,t.jsxs)(n.p,{children:["After detecting sequences, you can proceed to ",(0,t.jsx)(n.a,{href:"real-time-application",children:"real-time application"})," or ",(0,t.jsx)(n.a,{href:"training-models",children:"training your own models"}),"."]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>a});var t=r(6540);const s={},i=t.createContext(s);function o(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[683],{180:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>a,toc:()=>l});var t=r(4848),s=r(8453);const i={sidebar_position:2},o="Sequence Detection (Offline Use)",a={id:"RT-sort/usage/sequence-detection",title:"Sequence Detection (Offline Use)",description:"RT-Sort can be used for offline sequence detection with a pre-trained detection model. Here's how to do it for both Maxwell MEAs and Neuropixels.",source:"@site/docs/RT-sort/usage/sequence-detection.md",sourceDirName:"RT-sort/usage",slug:"/RT-sort/usage/sequence-detection",permalink:"/braindance/docs/RT-sort/usage/sequence-detection",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/usage/sequence-detection.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Loading Detection Models",permalink:"/braindance/docs/RT-sort/usage/load-detection-model"},next:{title:"Real-time Application (Online Use)",permalink:"/braindance/docs/RT-sort/usage/real-time-application"}},c={},l=[{value:"Maxwell MEAs",id:"maxwell-meas",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Optional Parameters",id:"optional-parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Example",id:"example",level:3},{value:"Neuropixels",id:"neuropixels",level:2},{value:"Next Steps",id:"next-steps",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"sequence-detection-offline-use",children:"Sequence Detection (Offline Use)"})}),"\n",(0,t.jsx)(n.p,{children:"RT-Sort can be used for offline sequence detection with a pre-trained detection model. Here's how to do it for both Maxwell MEAs and Neuropixels."}),"\n",(0,t.jsx)(n.h2,{id:"maxwell-meas",children:"Maxwell MEAs"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"from braindance.core.spikesorter.rt_sort import detect_sequences\n\nrt_sort = detect_sequences(recording, inter_path, detection_model, **kwargs)\n"})}),"\n",(0,t.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"recording"}),": Recording loaded with SpikeInterface or a path to a saved recording (str or pathlib.Path)."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"inter_path"}),": Path to a folder where RT-Sort's intermediate cached data is stored."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"detection_model"}),": ModelSpikeSorter object or a path to a folder containing a ModelSpikeSorter object's files."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"optional-parameters",children:"Optional Parameters"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"recording_window_ms"}),": Tuple (start_ms, end_ms) indicating which section of the recording to run RT-Sort. Default is None (entire duration)."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"delete_inter"}),": Whether to delete the directory inter_path and its contents. Default is False."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"verbose"}),": Whether to print progress of RT-Sort. Default is True."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"num_processes"}),": Number of CPU processes to use. Default is None (uses all available logical CPUs)."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["If ",(0,t.jsx)(n.code,{children:"return_spikes=False"})," (default): Returns an RTSort object."]}),"\n",(0,t.jsxs)(n.li,{children:["If ",(0,t.jsx)(n.code,{children:"return_spikes=True"}),": Returns a NumPy array of shape (num_sequences,) where each element is a NumPy array containing a sequence's spike train."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"# Detect sequences in the first 5 minutes of a recording\nrt_sort = detect_sequences(recording, inter_path, detection_model, recording_window_ms=(0, 5*60*1000))\n\n# Assign spikes in the next 5 minutes\nsequence_spike_trains = rt_sort.sort_offline(recording, inter_path, recording_window_ms=(5*60*1000, 10*60*1000), verbose=True)\n"})}),"\n",(0,t.jsx)(n.h2,{id:"neuropixels",children:"Neuropixels"}),"\n",(0,t.jsx)(n.p,{children:"The process for Neuropixels is similar to Maxwell MEAs, with one key difference:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"from braindance.core.spikesorter.rt_sort import detect_sequences, neuropixels_params\n\nrt_sort = detect_sequences(recording, inter_path, detection_model, **neuropixels_params, **kwargs)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Use the ",(0,t.jsx)(n.code,{children:"neuropixels_params"})," dictionary to pass Neuropixels-specific RT-Sort parameters. It's also recommended to use a Neuropixels-specific detection model."]}),"\n",(0,t.jsx)(n.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,t.jsxs)(n.p,{children:["After detecting sequences, you can proceed to ",(0,t.jsx)(n.a,{href:"real-time-application",children:"real-time application"})," or ",(0,t.jsx)(n.a,{href:"training-models",children:"training your own models"}),"."]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>a});var t=r(6540);const s={},i=t.createContext(s);function o(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f0423e55.626dbb80.js b/assets/js/f0423e55.97b6bad4.js similarity index 97% rename from assets/js/f0423e55.626dbb80.js rename to assets/js/f0423e55.97b6bad4.js index 7fa03ac8..010512e6 100644 --- a/assets/js/f0423e55.626dbb80.js +++ b/assets/js/f0423e55.97b6bad4.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[461],{6708:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>h,frontMatter:()=>s,metadata:()=>d,toc:()=>a});var i=r(4848),t=r(8453);const s={sidebar_position:4},o="Training Your Own Detection Models",d={id:"RT-sort/usage/training-models",title:"Training Your Own Detection Models",description:"RT-Sort allows you to train your own detection models using leave-one-out cross-validation. Here's how to do it:",source:"@site/docs/RT-sort/usage/training-models.md",sourceDirName:"RT-sort/usage",slug:"/RT-sort/usage/training-models",permalink:"/BrainDance/docs/RT-sort/usage/training-models",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/usage/training-models.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Real-time Application (Online Use)",permalink:"/BrainDance/docs/RT-sort/usage/real-time-application"},next:{title:"API Reference",permalink:"/BrainDance/docs/RT-sort/api-reference"}},l={},a=[{value:"Training Detection Models",id:"training-detection-models",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Recommended Parameters",id:"recommended-parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Sorting Recordings Offline with Kilosort2",id:"sorting-recordings-offline-with-kilosort2",level:2},{value:"Parameters",id:"parameters-1",level:3},{value:"Recommended Parameters",id:"recommended-parameters-1",level:3},{value:"Returns",id:"returns-1",level:3},{value:"Notes on Training",id:"notes-on-training",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"training-your-own-detection-models",children:"Training Your Own Detection Models"})}),"\n",(0,i.jsx)(n.p,{children:"RT-Sort allows you to train your own detection models using leave-one-out cross-validation. Here's how to do it:"}),"\n",(0,i.jsx)(n.h2,{id:"training-detection-models",children:"Training Detection Models"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"from braindance.core.spikedetector.train import train_detection_model\n\nmodel = train_detection_model(recordings)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"recordings"}),": A list containing the recordings to use for training the detection model (at least two)."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"recommended-parameters",children:"Recommended Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"kilosort_path"}),': Folder where Kilosort2 is installed (if not set in environment variable "KILOSORT_PATH").']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"input_scale"}),": Multiplier for recording traces before input into the detection model (default: 0.01)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"learning_rate"}),": Learning rate for training (default: 7.76e-4)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"validation_recording"}),": Recording to use as validation (default: None)."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ModelSpikeSorter"})," object"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"sorting-recordings-offline-with-kilosort2",children:"Sorting Recordings Offline with Kilosort2"}),"\n",(0,i.jsx)(n.p,{children:"If you prefer to sort recordings with Kilosort2 separately before training detection models, you can use:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"from braindance.core.spikesorter.kilosort2 import run_kilosort2\n\nrun_kilosort2(recording_files)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-1",children:"Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"recordings"}),": A list containing the recordings to spike sort."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"recommended-parameters-1",children:"Recommended Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"kilosort_path"}),": Folder where Kilosort2 is installed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"results_folders"}),": List of folders to store sorted results (default: None)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"compile_to_npz"}),': Whether to save results as "sorted.npz" (default: True).']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"compile_to_mat"}),': Whether to save results as "sorted.mat" (default: False).']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"intermediate_folders"}),": List of folders to store intermediate results (default: None)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"delete_inter"}),": Whether to delete intermediate folders after sorting (default: True)."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"returns-1",children:"Returns"}),"\n",(0,i.jsx)(n.p,{children:"None (results are saved to files)"}),"\n",(0,i.jsx)(n.h2,{id:"notes-on-training",children:"Notes on Training"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"The training process is divided into two main steps: spike sorting with Kilosort2 and training the detection model."}),"\n",(0,i.jsx)(n.li,{children:"Adjust the learning rate based on the loss curve created at the end of training."}),"\n",(0,i.jsx)(n.li,{children:"A straight loss curve might indicate a learning rate that is too low, while a curve that decreases initially but then strongly increases might indicate a rate that is too high."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more details on parameters and advanced usage, refer to the ",(0,i.jsx)(n.a,{href:"../api-reference",children:"API Reference"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>d});var i=r(6540);const t={},s=i.createContext(t);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[461],{6708:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>h,frontMatter:()=>s,metadata:()=>d,toc:()=>a});var i=r(4848),t=r(8453);const s={sidebar_position:4},o="Training Your Own Detection Models",d={id:"RT-sort/usage/training-models",title:"Training Your Own Detection Models",description:"RT-Sort allows you to train your own detection models using leave-one-out cross-validation. Here's how to do it:",source:"@site/docs/RT-sort/usage/training-models.md",sourceDirName:"RT-sort/usage",slug:"/RT-sort/usage/training-models",permalink:"/braindance/docs/RT-sort/usage/training-models",draft:!1,unlisted:!1,editUrl:"https://github.com/braingeneers/braindance/docs/RT-sort/usage/training-models.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"Real-time Application (Online Use)",permalink:"/braindance/docs/RT-sort/usage/real-time-application"},next:{title:"API Reference",permalink:"/braindance/docs/RT-sort/api-reference"}},l={},a=[{value:"Training Detection Models",id:"training-detection-models",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Recommended Parameters",id:"recommended-parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Sorting Recordings Offline with Kilosort2",id:"sorting-recordings-offline-with-kilosort2",level:2},{value:"Parameters",id:"parameters-1",level:3},{value:"Recommended Parameters",id:"recommended-parameters-1",level:3},{value:"Returns",id:"returns-1",level:3},{value:"Notes on Training",id:"notes-on-training",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"training-your-own-detection-models",children:"Training Your Own Detection Models"})}),"\n",(0,i.jsx)(n.p,{children:"RT-Sort allows you to train your own detection models using leave-one-out cross-validation. Here's how to do it:"}),"\n",(0,i.jsx)(n.h2,{id:"training-detection-models",children:"Training Detection Models"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"from braindance.core.spikedetector.train import train_detection_model\n\nmodel = train_detection_model(recordings)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"recordings"}),": A list containing the recordings to use for training the detection model (at least two)."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"recommended-parameters",children:"Recommended Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"kilosort_path"}),': Folder where Kilosort2 is installed (if not set in environment variable "KILOSORT_PATH").']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"input_scale"}),": Multiplier for recording traces before input into the detection model (default: 0.01)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"learning_rate"}),": Learning rate for training (default: 7.76e-4)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"validation_recording"}),": Recording to use as validation (default: None)."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ModelSpikeSorter"})," object"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"sorting-recordings-offline-with-kilosort2",children:"Sorting Recordings Offline with Kilosort2"}),"\n",(0,i.jsx)(n.p,{children:"If you prefer to sort recordings with Kilosort2 separately before training detection models, you can use:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"from braindance.core.spikesorter.kilosort2 import run_kilosort2\n\nrun_kilosort2(recording_files)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-1",children:"Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"recordings"}),": A list containing the recordings to spike sort."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"recommended-parameters-1",children:"Recommended Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"kilosort_path"}),": Folder where Kilosort2 is installed."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"results_folders"}),": List of folders to store sorted results (default: None)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"compile_to_npz"}),': Whether to save results as "sorted.npz" (default: True).']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"compile_to_mat"}),': Whether to save results as "sorted.mat" (default: False).']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"intermediate_folders"}),": List of folders to store intermediate results (default: None)."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"delete_inter"}),": Whether to delete intermediate folders after sorting (default: True)."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"returns-1",children:"Returns"}),"\n",(0,i.jsx)(n.p,{children:"None (results are saved to files)"}),"\n",(0,i.jsx)(n.h2,{id:"notes-on-training",children:"Notes on Training"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"The training process is divided into two main steps: spike sorting with Kilosort2 and training the detection model."}),"\n",(0,i.jsx)(n.li,{children:"Adjust the learning rate based on the loss curve created at the end of training."}),"\n",(0,i.jsx)(n.li,{children:"A straight loss curve might indicate a learning rate that is too low, while a curve that decreases initially but then strongly increases might indicate a rate that is too high."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more details on parameters and advanced usage, refer to the ",(0,i.jsx)(n.a,{href:"../api-reference",children:"API Reference"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>d});var i=r(6540);const t={},s=i.createContext(t);function o(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/main.1dae7bc2.js b/assets/js/main.1dae7bc2.js deleted file mode 100644 index 62dcbc9e..00000000 --- a/assets/js/main.1dae7bc2.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.1dae7bc2.js.LICENSE.txt */ -(self.webpackChunkbraindance_docs=self.webpackChunkbraindance_docs||[]).push([[792],{8328:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});n(6540);var r=n(3259),a=n.n(r),o=n(4054);const i={"0c0d280c":[()=>n.e(21).then(n.bind(n,2718)),"@site/docs/docs/train.py.mdx",2718],"0e384e19":[()=>n.e(976).then(n.bind(n,619)),"@site/docs/intro.md",619],"1437f731":[()=>n.e(743).then(n.t.bind(n,1296,19)),"@generated/docusaurus-plugin-content-docs/default/p/brain-dance-docs-category-usage-e77.json",1296],"14eb3368":[()=>Promise.all([n.e(869),n.e(969)]).then(n.bind(n,7247)),"@theme/DocCategoryGeneratedIndexPage",7247],17896441:[()=>Promise.all([n.e(869),n.e(401)]).then(n.bind(n,6118)),"@theme/DocItem",6118],"1df93b7f":[()=>Promise.all([n.e(869),n.e(583)]).then(n.bind(n,5579)),"@site/src/pages/index.tsx",5579],"1f61acc8":[()=>n.e(508).then(n.bind(n,9520)),"@site/docs/docs/dummy_maxlab.py.mdx",9520],"288dd688":[()=>n.e(267).then(n.bind(n,3961)),"@site/docs/docs/maxwell_env.py.mdx",3961],"323168e2":[()=>n.e(187).then(n.bind(n,8194)),"@site/docs/docs/params.py.mdx",8194],"32cca411":[()=>n.e(815).then(n.bind(n,5398)),"@site/docs/docs/data_loader.py.mdx",5398],"3f9c0f90":[()=>n.e(573).then(n.bind(n,2160)),"@site/docs/docs/phases.py.mdx",2160],"3ffd729a":[()=>n.e(615).then(n.bind(n,7223)),"@site/docs/RT-sort/installation.md",7223],"43cd4838":[()=>n.e(184).then(n.bind(n,5146)),"@site/docs/core-concepts.md",5146],"496af695":[()=>n.e(315).then(n.bind(n,7188)),"@site/docs/docs/maxwell_utils.py.mdx",7188],"4ad60338":[()=>n.e(326).then(n.bind(n,2958)),"@site/docs/RT-sort/usage/real-time-application.md",2958],"4c7309ee":[()=>n.e(845).then(n.bind(n,4973)),"@site/docs/docs/select_electrodes.py.mdx",4973],"50015d8e":[()=>n.e(587).then(n.bind(n,2330)),"@site/docs/docs/dummy_zmq_np.py.mdx",2330],"5e95c892":[()=>n.e(647).then(n.bind(n,7121)),"@theme/DocsRoot",7121],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"6231b20d":[()=>n.e(648).then(n.bind(n,3171)),"@site/docs/RT-sort/introduction.md",3171],"6484fcfc":[()=>n.e(925).then(n.bind(n,2949)),"@site/docs/RT-sort/usage/load-detection-model.md",2949],"66de5925":[()=>n.e(255).then(n.bind(n,5601)),"@site/docs/docs/base_env.py.mdx",5601],"6b4d9966":[()=>n.e(281).then(n.t.bind(n,261,19)),"@generated/docusaurus-plugin-content-docs/default/p/brain-dance-docs-c1a.json",261],"72e14192":[()=>n.e(814).then(n.bind(n,6711)),"@site/docs/quick-start.md",6711],"83686c74":[()=>n.e(474).then(n.bind(n,31)),"@site/docs/docs/plot.py.mdx",31],"9025e78b":[()=>n.e(237).then(n.bind(n,541)),"@site/docs/docs/trainer.py.mdx",541],"9d27e319":[()=>n.e(143).then(n.bind(n,196)),"@site/docs/docs/spikedetector.py.mdx",196],a49b7d55:[()=>n.e(986).then(n.t.bind(n,5014,19)),"@generated/docusaurus-plugin-content-docs/default/p/brain-dance-docs-category-rt-sort-65f.json",5014],a7456010:[()=>n.e(235).then(n.t.bind(n,8552,19)),"@generated/docusaurus-plugin-content-pages/default/__plugin.json",8552],a7bd4aaa:[()=>n.e(98).then(n.bind(n,1723)),"@theme/DocVersionRoot",1723],a94703ab:[()=>Promise.all([n.e(869),n.e(48)]).then(n.bind(n,1377)),"@theme/DocRoot",1377],aba21aa0:[()=>n.e(742).then(n.t.bind(n,7093,19)),"@generated/docusaurus-plugin-content-docs/default/__plugin.json",7093],cd7db571:[()=>n.e(736).then(n.bind(n,1105)),"@site/docs/docs/artifact_removal.py.mdx",1105],d3d09cfd:[()=>n.e(162).then(n.bind(n,8521)),"@site/docs/docs/query_electrodes.py.mdx",8521],dc176fb6:[()=>n.e(128).then(n.bind(n,1859)),"@site/docs/RT-sort/api-reference.md",1859],eddf7db5:[()=>n.e(860).then(n.bind(n,9173)),"@site/docs/docs/utils.py.mdx",9173],efa6ead6:[()=>n.e(683).then(n.bind(n,180)),"@site/docs/RT-sort/usage/sequence-detection.md",180],f0423e55:[()=>n.e(461).then(n.bind(n,6708)),"@site/docs/RT-sort/usage/training-models.md",6708],ff104f3b:[()=>n.e(393).then(n.t.bind(n,5419,19)),"@generated/docusaurus-plugin-content-docs/default/p/brain-dance-docs-category-documentation-0c8.json",5419]};var l=n(4848);function s(e){let{error:t,retry:n,pastDelay:r}=e;return t?(0,l.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,l.jsx)("p",{children:String(t)}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,l.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,l.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,l.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var c=n(6921),u=n(3102);function d(e,t){if("*"===e)return a()({loading:s,loader:()=>n.e(618).then(n.bind(n,2237)),modules:["@theme/NotFound"],webpack:()=>[2237],render(e,t){const n=e.default;return(0,l.jsx)(u.W,{value:{plugin:{name:"native",id:"default"}},children:(0,l.jsx)(n,{...t})})}});const r=o[`${e}-${t}`],d={},f=[],p=[],m=(0,c.A)(r);return Object.entries(m).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],f.push(r[1]),p.push(r[2]))})),a().Map({loading:s,loader:d,modules:f,webpack:()=>p,render(t,n){const a=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const o=r.default;if(!o)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof o&&"function"!=typeof o||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{o[e]=r[e]}));let i=a;const l=n.split(".");l.slice(0,-1).forEach((e=>{i=i[e]})),i[l[l.length-1]]=o}));const o=a.__comp;delete a.__comp;const i=a.__context;delete a.__context;const s=a.__props;return delete a.__props,(0,l.jsx)(u.W,{value:i,children:(0,l.jsx)(o,{...a,...s,...n})})}})}const f=[{path:"/BrainDance/docs",component:d("/BrainDance/docs","9c3"),routes:[{path:"/BrainDance/docs",component:d("/BrainDance/docs","daa"),routes:[{path:"/BrainDance/docs",component:d("/BrainDance/docs","af4"),routes:[{path:"/BrainDance/docs",component:d("/BrainDance/docs","a46"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/category/documentation",component:d("/BrainDance/docs/category/documentation","84b"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/category/rt-sort",component:d("/BrainDance/docs/category/rt-sort","6a5"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/category/usage",component:d("/BrainDance/docs/category/usage","7ab"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/core-concepts",component:d("/BrainDance/docs/core-concepts","5c8"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/artifact_removal.py",component:d("/BrainDance/docs/docs/artifact_removal.py","90d"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/base_env.py",component:d("/BrainDance/docs/docs/base_env.py","1ee"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/data_loader.py",component:d("/BrainDance/docs/docs/data_loader.py","20b"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/dummy_maxlab.py",component:d("/BrainDance/docs/docs/dummy_maxlab.py","286"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/dummy_zmq_np.py",component:d("/BrainDance/docs/docs/dummy_zmq_np.py","e73"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/maxwell_env.py",component:d("/BrainDance/docs/docs/maxwell_env.py","324"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/maxwell_utils.py",component:d("/BrainDance/docs/docs/maxwell_utils.py","8f4"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/params.py",component:d("/BrainDance/docs/docs/params.py","12c"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/phases.py",component:d("/BrainDance/docs/docs/phases.py","784"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/plot.py",component:d("/BrainDance/docs/docs/plot.py","3c6"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/query_electrodes.py",component:d("/BrainDance/docs/docs/query_electrodes.py","adb"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/select_electrodes.py",component:d("/BrainDance/docs/docs/select_electrodes.py","cd1"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/spikedetector.py",component:d("/BrainDance/docs/docs/spikedetector.py","f71"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/train.py",component:d("/BrainDance/docs/docs/train.py","4c3"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/trainer.py",component:d("/BrainDance/docs/docs/trainer.py","86b"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/docs/utils.py",component:d("/BrainDance/docs/docs/utils.py","23e"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/quick-start",component:d("/BrainDance/docs/quick-start","119"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/RT-sort/api-reference",component:d("/BrainDance/docs/RT-sort/api-reference","441"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/RT-sort/installation",component:d("/BrainDance/docs/RT-sort/installation","749"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/RT-sort/introduction",component:d("/BrainDance/docs/RT-sort/introduction","c6b"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/RT-sort/usage/load-detection-model",component:d("/BrainDance/docs/RT-sort/usage/load-detection-model","ec0"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/RT-sort/usage/real-time-application",component:d("/BrainDance/docs/RT-sort/usage/real-time-application","1f0"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/RT-sort/usage/sequence-detection",component:d("/BrainDance/docs/RT-sort/usage/sequence-detection","834"),exact:!0,sidebar:"tutorialSidebar"},{path:"/BrainDance/docs/RT-sort/usage/training-models",component:d("/BrainDance/docs/RT-sort/usage/training-models","4a9"),exact:!0,sidebar:"tutorialSidebar"}]}]}]},{path:"/BrainDance/",component:d("/BrainDance/","ec5"),exact:!0},{path:"*",component:d("*")}]},6125:(e,t,n)=>{"use strict";n.d(t,{o:()=>o,x:()=>i});var r=n(6540),a=n(4848);const o=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,a.jsx)(o.Provider,{value:n,children:t})}},7815:(e,t,n)=>{"use strict";var r=n(6540),a=n(5338),o=n(545),i=n(4625),l=n(4784),s=n(8193);const c=[n(119),n(6134),n(6294),n(1043)];var u=n(8328),d=n(6347),f=n(2831),p=n(4848);function m(e){let{children:t}=e;return(0,p.jsx)(p.Fragment,{children:t})}var h=n(5260),g=n(4586),y=n(6025),b=n(6342),v=n(1003),w=n(2131),k=n(4090);const x="default";var S=n(440),_=n(1463);function E(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,g.A)(),r=(0,w.o)(),a=n[e].htmlLang,o=e=>e.replace("-","_");return(0,p.jsxs)(h.A,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,p.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,p.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,p.jsx)("meta",{property:"og:locale",content:o(a)}),Object.values(n).filter((e=>a!==e.htmlLang)).map((e=>(0,p.jsx)("meta",{property:"og:locale:alternate",content:o(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function C(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,g.A)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,g.A)(),{pathname:r}=(0,d.zy)();return e+(0,S.Ks)((0,y.Ay)(r),{trailingSlash:n,baseUrl:t})}(),a=t?`${n}${t}`:r;return(0,p.jsxs)(h.A,{children:[(0,p.jsx)("meta",{property:"og:url",content:a}),(0,p.jsx)("link",{rel:"canonical",href:a})]})}function T(){const{i18n:{currentLocale:e}}=(0,g.A)(),{metadata:t,image:n}=(0,b.p)();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(h.A,{children:[(0,p.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,p.jsx)("body",{className:k.w})]}),n&&(0,p.jsx)(v.be,{image:n}),(0,p.jsx)(C,{}),(0,p.jsx)(E,{}),(0,p.jsx)(_.A,{tag:x,locale:e}),(0,p.jsx)(h.A,{children:t.map(((e,t)=>(0,p.jsx)("meta",{...e},t)))})]})}const A=new Map;var N=n(6125),O=n(6988),P=n(205);function j(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>a.forEach((e=>e?.()))}const R=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,P.A)((()=>{r!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,a=t.hash===n.hash,o=t.search===n.search;if(r&&a&&!o)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:r}),j("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function D(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,f.u)(u.A,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class L extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=s.A.canUseDOM?j("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=j("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),D(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return(0,p.jsx)(R,{previousLocation:this.previousLocation,location:t,children:(0,p.jsx)(d.qh,{location:t,render:()=>e})})}}const I=L,B="__docusaurus-base-url-issue-banner-container",F="__docusaurus-base-url-issue-banner",M="__docusaurus-base-url-issue-banner-suggestion-container";function z(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '${B}';\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{let{route:t}=e;return!0===t.exact})))return A.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return A.set(e.pathname,t),{...e,pathname:t}}((0,d.zy)());return(0,p.jsx)(I,{location:e,children:q})}function K(){return(0,p.jsx)(V.A,{children:(0,p.jsx)(O.l,{children:(0,p.jsxs)(N.x,{children:[(0,p.jsxs)(m,{children:[(0,p.jsx)(H,{}),(0,p.jsx)(T,{}),(0,p.jsx)(U,{}),(0,p.jsx)(Y,{})]}),(0,p.jsx)(G,{})]})})})}var Q=n(4054);const Z=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const a=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;a?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var X=n(6921);const J=new Set,ee=new Set,te=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ne={prefetch:e=>{if(!(e=>!te()&&!ee.has(e)&&!J.has(e))(e))return!1;J.add(e);const t=(0,f.u)(u.A,e).flatMap((e=>{return t=e.route.path,Object.entries(Q).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,X.A)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?Z(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!te()&&!ee.has(e))(e)&&(ee.add(e),D(e))},re=Object.freeze(ne);function ae(e){let{children:t}=e;return"hash"===l.default.future.experimental_router?(0,p.jsx)(i.I9,{children:t}):(0,p.jsx)(i.Kd,{children:t})}const oe=Boolean(!0);if(s.A.canUseDOM){window.docusaurus=re;const e=document.getElementById("__docusaurus"),t=(0,p.jsx)(o.vd,{children:(0,p.jsx)(ae,{children:(0,p.jsx)(K,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},i=()=>{if(window.docusaurusRoot)window.docusaurusRoot.render(t);else if(oe)window.docusaurusRoot=a.hydrateRoot(e,t,{onRecoverableError:n});else{const r=a.createRoot(e,{onRecoverableError:n});r.render(t),window.docusaurusRoot=r}};D(window.location.pathname).then((()=>{(0,r.startTransition)(i)}))}},6988:(e,t,n)=>{"use strict";n.d(t,{o:()=>d,l:()=>f});var r=n(6540),a=n(4784);const o=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/BrainDance/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/BrainDance/docs","mainDocId":"intro","docs":[{"id":"core-concepts","path":"/BrainDance/docs/core-concepts","sidebar":"tutorialSidebar"},{"id":"docs/artifact_removal.py","path":"/BrainDance/docs/docs/artifact_removal.py","sidebar":"tutorialSidebar"},{"id":"docs/base_env.py","path":"/BrainDance/docs/docs/base_env.py","sidebar":"tutorialSidebar"},{"id":"docs/data_loader.py","path":"/BrainDance/docs/docs/data_loader.py","sidebar":"tutorialSidebar"},{"id":"docs/dummy_maxlab.py","path":"/BrainDance/docs/docs/dummy_maxlab.py","sidebar":"tutorialSidebar"},{"id":"docs/dummy_zmq_np.py","path":"/BrainDance/docs/docs/dummy_zmq_np.py","sidebar":"tutorialSidebar"},{"id":"docs/maxwell_env.py","path":"/BrainDance/docs/docs/maxwell_env.py","sidebar":"tutorialSidebar"},{"id":"docs/maxwell_utils.py","path":"/BrainDance/docs/docs/maxwell_utils.py","sidebar":"tutorialSidebar"},{"id":"docs/params.py","path":"/BrainDance/docs/docs/params.py","sidebar":"tutorialSidebar"},{"id":"docs/phases.py","path":"/BrainDance/docs/docs/phases.py","sidebar":"tutorialSidebar"},{"id":"docs/plot.py","path":"/BrainDance/docs/docs/plot.py","sidebar":"tutorialSidebar"},{"id":"docs/query_electrodes.py","path":"/BrainDance/docs/docs/query_electrodes.py","sidebar":"tutorialSidebar"},{"id":"docs/select_electrodes.py","path":"/BrainDance/docs/docs/select_electrodes.py","sidebar":"tutorialSidebar"},{"id":"docs/spikedetector.py","path":"/BrainDance/docs/docs/spikedetector.py","sidebar":"tutorialSidebar"},{"id":"docs/train.py","path":"/BrainDance/docs/docs/train.py","sidebar":"tutorialSidebar"},{"id":"docs/trainer.py","path":"/BrainDance/docs/docs/trainer.py","sidebar":"tutorialSidebar"},{"id":"docs/utils.py","path":"/BrainDance/docs/docs/utils.py","sidebar":"tutorialSidebar"},{"id":"intro","path":"/BrainDance/docs/","sidebar":"tutorialSidebar"},{"id":"quick-start","path":"/BrainDance/docs/quick-start","sidebar":"tutorialSidebar"},{"id":"RT-sort/api-reference","path":"/BrainDance/docs/RT-sort/api-reference","sidebar":"tutorialSidebar"},{"id":"RT-sort/installation","path":"/BrainDance/docs/RT-sort/installation","sidebar":"tutorialSidebar"},{"id":"RT-sort/introduction","path":"/BrainDance/docs/RT-sort/introduction","sidebar":"tutorialSidebar"},{"id":"RT-sort/usage/load-detection-model","path":"/BrainDance/docs/RT-sort/usage/load-detection-model","sidebar":"tutorialSidebar"},{"id":"RT-sort/usage/real-time-application","path":"/BrainDance/docs/RT-sort/usage/real-time-application","sidebar":"tutorialSidebar"},{"id":"RT-sort/usage/sequence-detection","path":"/BrainDance/docs/RT-sort/usage/sequence-detection","sidebar":"tutorialSidebar"},{"id":"RT-sort/usage/training-models","path":"/BrainDance/docs/RT-sort/usage/training-models","sidebar":"tutorialSidebar"},{"id":"/category/rt-sort","path":"/BrainDance/docs/category/rt-sort","sidebar":"tutorialSidebar"},{"id":"/category/usage","path":"/BrainDance/docs/category/usage","sidebar":"tutorialSidebar"},{"id":"/category/documentation","path":"/BrainDance/docs/category/documentation","sidebar":"tutorialSidebar"}],"draftIds":[],"sidebars":{"tutorialSidebar":{"link":{"path":"/BrainDance/docs/","label":"intro"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(2654);const s=JSON.parse('{"docusaurusVersion":"3.5.2","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.5.2"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.5.2"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.5.2"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.5.2"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.5.2"}}}');var c=n(4848);const u={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},d=r.createContext(u);function f(e){let{children:t}=e;return(0,c.jsx)(d.Provider,{value:u,children:t})}},7489:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(6540),a=n(8193),o=n(5260),i=n(440),l=n(781),s=n(3102),c=n(4848);function u(e){let{error:t,tryAgain:n}=e;return(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,c.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,c.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,c.jsx)(d,{error:t})]})}function d(e){let{error:t}=e;const n=(0,i.rA)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,c.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function f(e){let{children:t}=e;return(0,c.jsx)(s.W,{value:{plugin:{name:"docusaurus-core-error-boundary",id:"default"}},children:t})}function p(e){let{error:t,tryAgain:n}=e;return(0,c.jsx)(f,{children:(0,c.jsxs)(h,{fallback:()=>(0,c.jsx)(u,{error:t,tryAgain:n}),children:[(0,c.jsx)(o.A,{children:(0,c.jsx)("title",{children:"Page Error"})}),(0,c.jsx)(l.A,{children:(0,c.jsx)(u,{error:t,tryAgain:n})})]})})}const m=e=>(0,c.jsx)(p,{...e});class h extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.A.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??m)(e)}return e??null}}},8193:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5260:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(545),a=n(4848);function o(e){return(0,a.jsx)(r.mg,{...e})}},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(6540),a=n(4625),o=n(440),i=n(4586),l=n(6654),s=n(8193),c=n(3427),u=n(6025),d=n(4848);function f(e,t){let{isNavLink:n,to:f,href:p,activeClassName:m,isActive:h,"data-noBrokenLinkCheck":g,autoAddBaseUrl:y=!0,...b}=e;const{siteConfig:v}=(0,i.A)(),{trailingSlash:w,baseUrl:k}=v,x=v.future.experimental_router,{withBaseUrl:S}=(0,u.hH)(),_=(0,c.A)(),E=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>E.current));const C=f||p;const T=(0,l.A)(C),A=C?.replace("pathname://","");let N=void 0!==A?(O=A,y&&(e=>e.startsWith("/"))(O)?S(O):O):void 0;var O;"hash"===x&&N?.startsWith("./")&&(N=N?.slice(1)),N&&T&&(N=(0,o.Ks)(N,{trailingSlash:w,baseUrl:k}));const P=(0,r.useRef)(!1),j=n?a.k2:a.N_,R=s.A.canUseIntersectionObserver,D=(0,r.useRef)(),L=()=>{P.current||null==N||(window.docusaurus.preload(N),P.current=!0)};(0,r.useEffect)((()=>(!R&&T&&s.A.canUseDOM&&null!=N&&window.docusaurus.prefetch(N),()=>{R&&D.current&&D.current.disconnect()})),[D,N,R,T]);const I=N?.startsWith("#")??!1,B=!b.target||"_self"===b.target,F=!N||!T||!B||I&&"hash"!==x;g||!I&&F||_.collectLink(N),b.id&&_.collectAnchor(b.id);const M={};return F?(0,d.jsx)("a",{ref:E,href:N,...C&&!T&&{target:"_blank",rel:"noopener noreferrer"},...b,...M}):(0,d.jsx)(j,{...b,onMouseEnter:L,onTouchStart:L,innerRef:e=>{E.current=e,R&&e&&T&&(D.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(D.current.unobserve(e),D.current.disconnect(),null!=N&&window.docusaurus.prefetch(N))}))})),D.current.observe(e))},to:N,...n&&{isActive:h,activeClassName:m},...M})}const p=r.forwardRef(f)},418:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=()=>null},1312:(e,t,n)=>{"use strict";n.d(t,{A:()=>c,T:()=>s});var r=n(6540),a=n(4848);function o(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var i=n(2654);function l(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[t??n]??n??t}function s(e,t){let{message:n,id:r}=e;return o(l({message:n,id:r}),t)}function c(e){let{children:t,id:n,values:r}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const i=l({message:t,id:n});return(0,a.jsx)(a.Fragment,{children:o(i,r)})}},7065:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},6654:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>a,z:()=>r})},6025:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>l,hH:()=>i});var r=n(6540),a=n(4586),o=n(6654);function i(){const{siteConfig:e}=(0,a.A)(),{baseUrl:t,url:n}=e,i=e.future.experimental_router,l=(0,r.useCallback)(((e,r)=>function(e){let{siteUrl:t,baseUrl:n,url:r,options:{forcePrependBaseUrl:a=!1,absolute:i=!1}={},router:l}=e;if(!r||r.startsWith("#")||(0,o.z)(r))return r;if("hash"===l)return r.startsWith("/")?`.${r}`:`./${r}`;if(a)return n+r.replace(/^\//,"");if(r===n.replace(/\/$/,""))return n;const s=r.startsWith(n)?r:n+r.replace(/^\//,"");return i?t+s:s}({siteUrl:n,baseUrl:t,url:e,options:r,router:i})),[n,t,i]);return{withBaseUrl:l}}function l(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},3427:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(6540);n(4848);const a=r.createContext({collectAnchor:()=>{},collectLink:()=>{}}),o=()=>(0,r.useContext)(a);function i(){return o()}},4586:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6988);function o(){return(0,r.useContext)(a.o)}},2303:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6125);function o(){return(0,r.useContext)(a.o)}},205:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6540);const a=n(8193).A.canUseDOM?r.useLayoutEffect:r.useEffect},6921:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function a(e){const t={};return function e(n,a){Object.entries(n).forEach((n=>{let[o,i]=n;const l=a?`${a}.${o}`:o;r(i)?e(i,l):t[l]=i}))}(e),t}},3102:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>o});var r=n(6540),a=n(4848);const o=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(o),l=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:i,value:n})),[i,n]);return(0,a.jsx)(o.Provider,{value:l,children:t})}},3886:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>g,g1:()=>b});var r=n(6540),a=n(4070),o=n(7065),i=n(6342),l=n(679),s=n(9532),c=n(4848);const u=e=>`docs-preferred-version-${e}`,d={save:(e,t,n)=>{(0,l.Wf)(u(e),{persistence:t}).set(n)},read:(e,t)=>(0,l.Wf)(u(e),{persistence:t}).get(),clear:(e,t)=>{(0,l.Wf)(u(e),{persistence:t}).del()}},f=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const p=r.createContext(null);function m(){const e=(0,a.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>f(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=d.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(d.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d.save(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function h(e){let{children:t}=e;const n=m();return(0,c.jsx)(p.Provider,{value:n,children:t})}function g(e){let{children:t}=e;return(0,c.jsx)(h,{children:t})}function y(){const e=(0,r.useContext)(p);if(!e)throw new s.dV("DocsPreferredVersionContextProvider");return e}function b(e){void 0===e&&(e=o.W);const t=(0,a.ht)(e),[n,i]=y(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}},609:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,t:()=>c});var r=n(6540),a=n(9532),o=n(4848);const i=Symbol("EmptyContext"),l=r.createContext(i);function s(e){let{children:t,name:n,items:a}=e;const i=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return(0,o.jsx)(l.Provider,{value:i,children:t})}function c(){const e=(0,r.useContext)(l);if(e===i)throw new a.dV("DocsSidebarProvider");return e}},4718:(e,t,n)=>{"use strict";n.d(t,{d1:()=>C,Nr:()=>p,w8:()=>y,$S:()=>m,cC:()=>f,B5:()=>E,Vd:()=>x,QB:()=>_,fW:()=>S,OF:()=>k,Y:()=>v});var r=n(6540),a=n(6347),o=n(2831),i=n(4070),l=n(9169);function s(e){return Array.from(new Set(e))}var c=n(3886),u=n(3025),d=n(609);function f(e){const t=(0,u.r)();if(!e)return;const n=t.docs[e];if(!n)throw new Error(`no version doc found by id=${e}`);return n}function p(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(const t of e.items){const e=p(t);if(e)return e}}(e):void 0:e.href}function m(){const{pathname:e}=(0,a.zy)(),t=(0,d.t)();if(!t)throw new Error("Unexpected: cant find current sidebar in context");const n=w({sidebarItems:t.items,pathname:e,onlyCategories:!0}).slice(-1)[0];if(!n)throw new Error(`${e} is not associated with a category. useCurrentSidebarCategory() should only be used on category index pages.`);return n}const h=(e,t)=>void 0!==e&&(0,l.ys)(e,t),g=(e,t)=>e.some((e=>y(e,t)));function y(e,t){return"link"===e.type?h(e.href,t):"category"===e.type&&(h(e.href,t)||g(e.items,t))}function b(e,t){switch(e.type){case"category":return y(e,t)||e.items.some((e=>b(e,t)));case"link":return!e.unlisted||y(e,t);default:return!0}}function v(e,t){return(0,r.useMemo)((()=>e.filter((e=>b(e,t)))),[e,t])}function w(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const a=[];return function e(t){for(const o of t)if("category"===o.type&&((0,l.ys)(o.href,n)||e(o.items))||"link"===o.type&&(0,l.ys)(o.href,n)){return r&&"category"!==o.type||a.unshift(o),!0}return!1}(t),a}function k(){const e=(0,d.t)(),{pathname:t}=(0,a.zy)(),n=(0,i.vT)()?.pluginData.breadcrumbs;return!1!==n&&e?w({sidebarItems:e.items,pathname:t}):null}function x(e){const{activeVersion:t}=(0,i.zK)(e),{preferredVersion:n}=(0,c.g1)(e),a=(0,i.r7)(e);return(0,r.useMemo)((()=>s([t,n,a].filter(Boolean))),[t,n,a])}function S(e,t){const n=x(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function _(e,t){const n=x(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${s(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function E(e){let{route:t}=e;const n=(0,a.zy)(),r=(0,u.r)(),i=t.routes,l=i.find((e=>(0,a.B6)(n.pathname,e)));if(!l)return null;const s=l.sidebar,c=s?r.docsSidebars[s]:void 0;return{docElement:(0,o.v)(i),sidebarName:s,sidebarItems:c}}function C(e){return e.filter((e=>!("category"===e.type||"link"===e.type)||!!p(e)))}},3025:(e,t,n)=>{"use strict";n.d(t,{n:()=>l,r:()=>s});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function l(e){let{children:t,version:n}=e;return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(null===e)throw new a.dV("DocsVersionProvider");return e}},4070:(e,t,n)=>{"use strict";n.d(t,{zK:()=>h,vT:()=>f,Gy:()=>u,HW:()=>g,ht:()=>d,r7:()=>m,jh:()=>p});var r=n(6347),a=n(4586),o=n(7065);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.A)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){const n=function(e,t){return[...e.versions].sort(((e,t)=>e.path===t.path?0:e.path.includes(t.path)?-1:t.path.includes(e.path)?1:0)).find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),a=n?.docs.find((e=>!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const c={},u=()=>i("docusaurus-plugin-content-docs")??c,d=e=>{try{return function(e,t,n){void 0===t&&(t=o.W),void 0===n&&(n={});const r=i(e),a=r?.[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0})}catch(t){throw new Error("You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled"+("Default"===e?"":` (pluginId=${e}`),{cause:t})}};function f(e){void 0===e&&(e={});const t=u(),{pathname:n}=(0,r.zy)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.B6)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function p(e){return d(e).versions}function m(e){const t=d(e);return l(t)}function h(e){const t=d(e),{pathname:n}=(0,r.zy)();return s(t,n)}function g(e){const t=d(e),{pathname:n}=(0,r.zy)();return function(e,t){const n=l(e);return{latestDocSuggestion:s(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},6294:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(5947),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},6134:(e,t,n)=>{"use strict";var r=n(1765),a=n(4784);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(9700),n(4188)(`./prism-${e}`)})),delete globalThis.Prism}(r.My)},1107:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(6540);var r=n(4164),a=n(1312),o=n(6342),i=n(8774),l=n(3427);const s={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};var c=n(4848);function u(e){let{as:t,id:n,...u}=e;const d=(0,l.A)(),{navbar:{hideOnScroll:f}}=(0,o.p)();if("h1"===t||!n)return(0,c.jsx)(t,{...u,id:void 0});d.collectAnchor(n);const p=(0,a.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof u.children?u.children:n});return(0,c.jsxs)(t,{...u,className:(0,r.A)("anchor",f?s.anchorWithHideOnScrollNavbar:s.anchorWithStickyNavbar,u.className),id:n,children:[u.children,(0,c.jsx)(i.A,{className:"hash-link",to:`#${n}`,"aria-label":p,title:p,children:"\u200b"})]})}},3186:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);const r={iconExternalLink:"iconExternalLink_nPIU"};var a=n(4848);function o(e){let{width:t=13.5,height:n=13.5}=e;return(0,a.jsx)("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,a.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}},781:(e,t,n)=>{"use strict";n.d(t,{A:()=>pt});var r=n(6540),a=n(4164),o=n(7489),i=n(1003),l=n(6347),s=n(1312),c=n(5062),u=n(4848);const d="__docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,l.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&f(t)}),[]);return(0,c.$)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const m=(0,s.T)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function h(e){const t=e.children??m,{containerRef:n,onClick:r}=p();return(0,u.jsx)("div",{ref:n,role:"region","aria-label":m,children:(0,u.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var g=n(7559),y=n(4090);const b={skipToContent:"skipToContent_fXgn"};function v(){return(0,u.jsx)(h,{className:b.skipToContent})}var w=n(6342),k=n(5041);function x(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:a=1.2,className:o,...i}=e;return(0,u.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,u.jsx)("g",{stroke:r,strokeWidth:a,children:(0,u.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const S={closeButton:"closeButton_CVFx"};function _(e){return(0,u.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,a.A)("clean-btn close",S.closeButton,e.className),children:(0,u.jsx)(x,{width:14,height:14,strokeWidth:3.1})})}const E={content:"content_knG7"};function C(e){const{announcementBar:t}=(0,w.p)(),{content:n}=t;return(0,u.jsx)("div",{...e,className:(0,a.A)(E.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const T={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function A(){const{announcementBar:e}=(0,w.p)(),{isActive:t,close:n}=(0,k.M)();if(!t)return null;const{backgroundColor:r,textColor:a,isCloseable:o}=e;return(0,u.jsxs)("div",{className:T.announcementBar,style:{backgroundColor:r,color:a},role:"banner",children:[o&&(0,u.jsx)("div",{className:T.announcementBarPlaceholder}),(0,u.jsx)(C,{className:T.announcementBarContent}),o&&(0,u.jsx)(_,{onClick:n,className:T.announcementBarClose})]})}var N=n(9876),O=n(3104);var P=n(9532),j=n(5600);const R=r.createContext(null);function D(e){let{children:t}=e;const n=function(){const e=(0,N.M)(),t=(0,j.YL)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,P.ZC)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return(0,u.jsx)(R.Provider,{value:n,children:t})}function L(e){if(e.component){const t=e.component;return(0,u.jsx)(t,{...e.props})}}function I(){const e=(0,r.useContext)(R);if(!e)throw new P.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,j.YL)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:L(o)})),[a,o,t])}function B(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:o}=I();return(0,u.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,u.jsxs)("div",{className:(0,a.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":o}),children:[(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var F=n(5293),M=n(2303);function z(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})})}function $(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})})}const U={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function H(e){let{className:t,buttonClassName:n,value:r,onChange:o}=e;const i=(0,M.A)(),l=(0,s.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,s.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,s.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,u.jsx)("div",{className:(0,a.A)(U.toggle,t),children:(0,u.jsxs)("button",{className:(0,a.A)("clean-btn",U.toggleButton,!i&&U.toggleButtonDisabled,n),type:"button",onClick:()=>o("dark"===r?"light":"dark"),disabled:!i,title:l,"aria-label":l,"aria-live":"polite",children:[(0,u.jsx)(z,{className:(0,a.A)(U.toggleIcon,U.lightToggleIcon)}),(0,u.jsx)($,{className:(0,a.A)(U.toggleIcon,U.darkToggleIcon)})]})})}const V=r.memo(H),W={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function G(e){let{className:t}=e;const n=(0,w.p)().navbar.style,r=(0,w.p)().colorMode.disableSwitch,{colorMode:a,setColorMode:o}=(0,F.G)();return r?null:(0,u.jsx)(V,{className:t,buttonClassName:"dark"===n?W.darkNavbarColorModeToggle:void 0,value:a,onChange:o})}var q=n(3465);function Y(){return(0,u.jsx)(q.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function K(){const e=(0,N.M)();return(0,u.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle(),children:(0,u.jsx)(x,{color:"var(--ifm-color-emphasis-600)"})})}function Q(){return(0,u.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,u.jsx)(Y,{}),(0,u.jsx)(G,{className:"margin-right--md"}),(0,u.jsx)(K,{})]})}var Z=n(8774),X=n(6025),J=n(6654);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(3186);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:a,label:o,html:i,isDropdownLink:l,prependBaseUrlToHref:s,...c}=e;const d=(0,X.Ay)(r),f=(0,X.Ay)(t),p=(0,X.Ay)(a,{forcePrependBaseUrl:!0}),m=o&&a&&!(0,J.A)(a),h=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,u.jsxs)(u.Fragment,{children:[o,m&&(0,u.jsx)(te.A,{...l&&{width:12,height:12}})]})};return a?(0,u.jsx)(Z.A,{href:s?p:a,...c,...h}):(0,u.jsx)(Z.A,{to:d,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(f)},...c,...h})}function re(e){let{className:t,isDropdownItem:n=!1,...r}=e;const o=(0,u.jsx)(ne,{className:(0,a.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,u.jsx)("li",{children:o}):o}function ae(e){let{className:t,isDropdownItem:n,...r}=e;return(0,u.jsx)("li",{className:"menu__list-item",children:(0,u.jsx)(ne,{className:(0,a.A)("menu__link",t),...r})})}function oe(e){let{mobile:t=!1,position:n,...r}=e;const a=t?ae:re;return(0,u.jsx)(a,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var ie=n(1422),le=n(9169),se=n(4586);const ce={dropdownNavbarItemMobile:"dropdownNavbarItemMobile_S0Fm"};function ue(e,t){return e.some((e=>function(e,t){return!!(0,le.ys)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:o,onClick:i,...l}=e;const s=(0,r.useRef)(null),[c,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[s]),(0,u.jsxs)("div",{ref:s,className:(0,a.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":c}),children:[(0,u.jsx)(ne,{"aria-haspopup":"true","aria-expanded":c,role:"button",href:l.to?void 0:"#",className:(0,a.A)("navbar__link",o),...l,onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!c))},children:l.children??l.label}),(0,u.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(Ee,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function fe(e){let{items:t,className:n,position:o,onClick:i,...s}=e;const c=function(){const{siteConfig:{baseUrl:e}}=(0,se.A)(),{pathname:t}=(0,l.zy)();return t.replace(e,"/")}(),d=ue(t,c),{collapsed:f,toggleCollapsed:p,setCollapsed:m}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&m(!d)}),[c,d,m]),(0,u.jsxs)("li",{className:(0,a.A)("menu__list-item",{"menu__list-item--collapsed":f}),children:[(0,u.jsx)(ne,{role:"button",className:(0,a.A)(ce.dropdownNavbarItemMobile,"menu__link menu__link--sublist menu__link--sublist-caret",n),...s,onClick:e=>{e.preventDefault(),p()},children:s.children??s.label}),(0,u.jsx)(ie.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:f,children:t.map(((e,t)=>(0,r.createElement)(Ee,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function pe(e){let{mobile:t=!1,...n}=e;const r=t?fe:de;return(0,u.jsx)(r,{...n})}var me=n(2131);function he(e){let{width:t=20,height:n=20,...r}=e;return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})})}const ge="iconLanguage_nlXk";var ye=n(418);const be={navbarSearchContainer:"navbarSearchContainer_Bca1"};function ve(e){let{children:t,className:n}=e;return(0,u.jsx)("div",{className:(0,a.A)(n,be.navbarSearchContainer),children:t})}var we=n(4070),ke=n(4718);var xe=n(3886);function Se(e,t){return t.alternateDocVersions[e.name]??function(e){return e.docs.find((t=>t.id===e.mainDocId))}(e)}const _e={default:oe,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:a="",...o}=e;const{i18n:{currentLocale:i,locales:c,localeConfigs:d}}=(0,se.A)(),f=(0,me.o)(),{search:p,hash:m}=(0,l.zy)(),h=[...n,...c.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${m}${a}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...r],g=t?(0,s.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return(0,u.jsx)(pe,{...o,mobile:t,label:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(he,{className:ge}),g]}),items:h})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,u.jsx)(ve,{className:n,children:(0,u.jsx)(ye.A,{})})},dropdown:pe,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:o=!1}=e;const i=o?"li":"div";return(0,u.jsx)(i,{className:(0,a.A)({navbar__item:!r&&!o,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,we.zK)(r),i=(0,ke.QB)(t,r),l=o?.path===i?.path;return null===i||i.unlisted&&!l?null:(0,u.jsx)(oe,{exact:!0,...a,isActive:()=>l||!!o?.sidebar&&o.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,we.zK)(r),i=(0,ke.fW)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,u.jsx)(oe,{exact:!0,...a,isActive:()=>o?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...a}=e;const o=(0,ke.Vd)(r)[0],i=t??o.label,l=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(o).path;return(0,u.jsx)(oe,{...a,label:i,to:l})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:a,dropdownItemsAfter:o,...i}=e;const{search:c,hash:d}=(0,l.zy)(),f=(0,we.zK)(n),p=(0,we.jh)(n),{savePreferredVersionName:m}=(0,xe.g1)(n),h=[...a,...p.map((function(e){const t=Se(e,f);return{label:e.label,to:`${t.path}${c}${d}`,isActive:()=>e===f.activeVersion,onClick:()=>m(e.name)}})),...o],g=(0,ke.Vd)(n)[0],y=t&&h.length>1?(0,s.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):g.label,b=t&&h.length>1?void 0:Se(g,f).path;return h.length<=1?(0,u.jsx)(oe,{...i,mobile:t,label:y,to:b,isActive:r?()=>!1:void 0}):(0,u.jsx)(pe,{...i,mobile:t,label:y,to:b,items:h,isActive:r?()=>!1:void 0})}};function Ee(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),a=_e[r];if(!a)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,u.jsx)(a,{...n})}function Ce(){const e=(0,N.M)(),t=(0,w.p)().navbar.items;return(0,u.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(Ee,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function Te(e){return(0,u.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,u.jsx)(s.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})})}function Ae(){const e=0===(0,w.p)().navbar.items.length,t=I();return(0,u.jsxs)(u.Fragment,{children:[!e&&(0,u.jsx)(Te,{onClick:()=>t.hide()}),t.content]})}function Ne(){const e=(0,N.M)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?(0,u.jsx)(B,{header:(0,u.jsx)(Q,{}),primaryMenu:(0,u.jsx)(Ce,{}),secondaryMenu:(0,u.jsx)(Ae,{})}):null}const Oe={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Pe(e){return(0,u.jsx)("div",{role:"presentation",...e,className:(0,a.A)("navbar-sidebar__backdrop",e.className)})}function je(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,w.p)(),i=(0,N.M)(),{navbarRef:l,isNavbarVisible:d}=function(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return(0,O.Mq)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=l?n(!1):i+c{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return a.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return(0,u.jsxs)("nav",{ref:l,"aria-label":(0,s.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,a.A)("navbar","navbar--fixed-top",n&&[Oe.navbarHideable,!d&&Oe.navbarHidden],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown}),children:[t,(0,u.jsx)(Pe,{onClick:i.toggle}),(0,u.jsx)(Ne,{})]})}var Re=n(440);const De={errorBoundaryError:"errorBoundaryError_a6uf",errorBoundaryFallback:"errorBoundaryFallback_VBag"};function Le(e){return(0,u.jsx)("button",{type:"button",...e,children:(0,u.jsx)(s.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function Ie(e){let{error:t}=e;const n=(0,Re.rA)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,u.jsx)("p",{className:De.errorBoundaryError,children:n})}class Be extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const Fe="right";function Me(e){let{width:t=30,height:n=30,className:r,...a}=e;return(0,u.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...a,children:(0,u.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function ze(){const{toggle:e,shown:t}=(0,N.M)();return(0,u.jsx)("button",{onClick:e,"aria-label":(0,s.T)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,u.jsx)(Me,{})})}const $e={colorModeToggle:"colorModeToggle_DEke"};function Ue(e){let{items:t}=e;return(0,u.jsx)(u.Fragment,{children:t.map(((e,t)=>(0,u.jsx)(Be,{onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t}),children:(0,u.jsx)(Ee,{...e})},t)))})}function He(e){let{left:t,right:n}=e;return(0,u.jsxs)("div",{className:"navbar__inner",children:[(0,u.jsx)("div",{className:"navbar__items",children:t}),(0,u.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function Ve(){const e=(0,N.M)(),t=(0,w.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??Fe)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),a=t.find((e=>"search"===e.type));return(0,u.jsx)(He,{left:(0,u.jsxs)(u.Fragment,{children:[!e.disabled&&(0,u.jsx)(ze,{}),(0,u.jsx)(Y,{}),(0,u.jsx)(Ue,{items:n})]}),right:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ue,{items:r}),(0,u.jsx)(G,{className:$e.colorModeToggle}),!a&&(0,u.jsx)(ve,{children:(0,u.jsx)(ye.A,{})})]})})}function We(){return(0,u.jsx)(je,{children:(0,u.jsx)(Ve,{})})}function Ge(e){let{item:t}=e;const{to:n,href:r,label:a,prependBaseUrlToHref:o,...i}=t,l=(0,X.Ay)(n),s=(0,X.Ay)(r,{forcePrependBaseUrl:!0});return(0,u.jsxs)(Z.A,{className:"footer__link-item",...r?{href:o?s:r}:{to:l},...i,children:[a,r&&!(0,J.A)(r)&&(0,u.jsx)(te.A,{})]})}function qe(e){let{item:t}=e;return t.html?(0,u.jsx)("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)("li",{className:"footer__item",children:(0,u.jsx)(Ge,{item:t})},t.href??t.to)}function Ye(e){let{column:t}=e;return(0,u.jsxs)("div",{className:"col footer__col",children:[(0,u.jsx)("div",{className:"footer__title",children:t.title}),(0,u.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,u.jsx)(qe,{item:e},t)))})]})}function Ke(e){let{columns:t}=e;return(0,u.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,u.jsx)(Ye,{column:e},t)))})}function Qe(){return(0,u.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function Ze(e){let{item:t}=e;return t.html?(0,u.jsx)("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)(Ge,{item:t})}function Xe(e){let{links:t}=e;return(0,u.jsx)("div",{className:"footer__links text--center",children:(0,u.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,u.jsxs)(r.Fragment,{children:[(0,u.jsx)(Ze,{item:e}),t.length!==n+1&&(0,u.jsx)(Qe,{})]},n)))})})}function Je(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,u.jsx)(Ke,{columns:t}):(0,u.jsx)(Xe,{links:t})}var et=n(1122);const tt={footerLogoLink:"footerLogoLink_BH7S"};function nt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.hH)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,u.jsx)(et.A,{className:(0,a.A)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function rt(e){let{logo:t}=e;return t.href?(0,u.jsx)(Z.A,{href:t.href,className:tt.footerLogoLink,target:t.target,children:(0,u.jsx)(nt,{logo:t})}):(0,u.jsx)(nt,{logo:t})}function at(e){let{copyright:t}=e;return(0,u.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function ot(e){let{style:t,links:n,logo:r,copyright:o}=e;return(0,u.jsx)("footer",{className:(0,a.A)("footer",{"footer--dark":"dark"===t}),children:(0,u.jsxs)("div",{className:"container container-fluid",children:[n,(r||o)&&(0,u.jsxs)("div",{className:"footer__bottom text--center",children:[r&&(0,u.jsx)("div",{className:"margin-bottom--sm",children:r}),o]})]})})}function it(){const{footer:e}=(0,w.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:a}=e;return(0,u.jsx)(ot,{style:a,links:n&&n.length>0&&(0,u.jsx)(Je,{links:n}),logo:r&&(0,u.jsx)(rt,{logo:r}),copyright:t&&(0,u.jsx)(at,{copyright:t})})}const lt=r.memo(it),st=(0,P.fM)([F.a,k.o,O.Tv,xe.VQ,i.Jx,function(e){let{children:t}=e;return(0,u.jsx)(j.y_,{children:(0,u.jsx)(N.e,{children:(0,u.jsx)(D,{children:t})})})}]);function ct(e){let{children:t}=e;return(0,u.jsx)(st,{children:t})}var ut=n(1107);function dt(e){let{error:t,tryAgain:n}=e;return(0,u.jsx)("main",{className:"container margin-vert--xl",children:(0,u.jsx)("div",{className:"row",children:(0,u.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,u.jsx)(ut.A,{as:"h1",className:"hero__title",children:(0,u.jsx)(s.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,u.jsx)("div",{className:"margin-vert--lg",children:(0,u.jsx)(Le,{onClick:n,className:"button button--primary shadow--lw"})}),(0,u.jsx)("hr",{}),(0,u.jsx)("div",{className:"margin-vert--md",children:(0,u.jsx)(Ie,{error:t})})]})})})}const ft={mainWrapper:"mainWrapper_z2l0"};function pt(e){const{children:t,noFooter:n,wrapperClassName:r,title:l,description:s}=e;return(0,y.J)(),(0,u.jsxs)(ct,{children:[(0,u.jsx)(i.be,{title:l,description:s}),(0,u.jsx)(v,{}),(0,u.jsx)(A,{}),(0,u.jsx)(We,{}),(0,u.jsx)("div",{id:d,className:(0,a.A)(g.G.wrapper.main,ft.mainWrapper,r),children:(0,u.jsx)(o.A,{fallback:e=>(0,u.jsx)(dt,{...e}),children:t})}),!n&&(0,u.jsx)(lt,{})]})}},3465:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(6540);var r=n(8774),a=n(6025),o=n(4586),i=n(6342),l=n(1122),s=n(4848);function c(e){let{logo:t,alt:n,imageClassName:r}=e;const o={light:(0,a.Ay)(t.src),dark:(0,a.Ay)(t.srcDark||t.src)},i=(0,s.jsx)(l.A,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,s.jsx)("div",{className:r,children:i}):i}function u(e){const{siteConfig:{title:t}}=(0,o.A)(),{navbar:{title:n,logo:l}}=(0,i.p)(),{imageClassName:u,titleClassName:d,...f}=e,p=(0,a.Ay)(l?.href||"/"),m=n?"":t,h=l?.alt??m;return(0,s.jsxs)(r.A,{to:p,...f,...l?.target&&{target:l.target},children:[l&&(0,s.jsx)(c,{logo:l,alt:h,imageClassName:u}),null!=n&&(0,s.jsx)("b",{className:d,children:n})]})}},1463:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(5260),a=n(4848);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return(0,a.jsxs)(r.A,{children:[t&&(0,a.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,a.jsx)("meta",{name:"docusaurus_version",content:n}),o&&(0,a.jsx)("meta",{name:"docusaurus_tag",content:o}),i&&(0,a.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,a.jsx)("meta",{name:"docsearch:version",content:n}),o&&(0,a.jsx)("meta",{name:"docsearch:docusaurus_tag",content:o})]})}},1122:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(6540),a=n(4164),o=n(2303),i=n(5293);const l={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};var s=n(4848);function c(e){let{className:t,children:n}=e;const c=(0,o.A)(),{colorMode:u}=(0,i.G)();return(0,s.jsx)(s.Fragment,{children:(c?"dark"===u?["dark"]:["light"]:["light","dark"]).map((e=>{const o=n({theme:e,className:(0,a.A)(t,l.themedComponent,l[`themedComponent--${e}`])});return(0,s.jsx)(r.Fragment,{children:o},e)}))})}function u(e){const{sources:t,className:n,alt:r,...a}=e;return(0,s.jsx)(c,{className:n,children:e=>{let{theme:n,className:o}=e;return(0,s.jsx)("img",{src:t[n],alt:r,className:o,...a})}})}},1422:(e,t,n)=>{"use strict";n.d(t,{N:()=>y,u:()=>c});var r=n(6540),a=n(8193),o=n(205),i=n(3109),l=n(4848);const s="ease-in-out";function c(e){let{initialState:t}=e;const[n,a]=(0,r.useState)(t??!1),o=(0,r.useCallback)((()=>{a((e=>!e))}),[]);return{collapsed:n,setCollapsed:a,toggleCollapsed:o}}const u={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function f(e,t){const n=t?u:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function p(e){let{collapsibleRef:t,collapsed:n,animation:a}=e;const o=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=e.scrollHeight,n=a?.duration??function(e){if((0,i.O)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${a?.easing??s}`,height:`${t}px`}}function l(){const t=r();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return f(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(l(),requestAnimationFrame((()=>{e.style.height=u.height,e.style.overflow=u.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{l()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,a])}function m(e){if(!a.A.canUseDOM)return e?u:d}function h(e){let{as:t="div",collapsed:n,children:a,animation:o,onCollapseTransitionEnd:i,className:s,disableSSRStyle:c}=e;const u=(0,r.useRef)(null);return p({collapsibleRef:u,collapsed:n,animation:o}),(0,l.jsx)(t,{ref:u,style:c?void 0:m(n),onTransitionEnd:e=>{"height"===e.propertyName&&(f(u.current,n),i?.(n))},className:s,children:a})}function g(e){let{collapsed:t,...n}=e;const[a,i]=(0,r.useState)(!t),[s,c]=(0,r.useState)(t);return(0,o.A)((()=>{t||i(!0)}),[t]),(0,o.A)((()=>{a&&c(t)}),[a,t]),a?(0,l.jsx)(h,{...n,collapsed:s}):null}function y(e){let{lazy:t,...n}=e;const r=t?g:h;return(0,l.jsx)(r,{...n})}},5041:(e,t,n)=>{"use strict";n.d(t,{M:()=>h,o:()=>m});var r=n(6540),a=n(2303),o=n(679),i=n(9532),l=n(6342),s=n(4848);const c=(0,o.Wf)("docusaurus.announcement.dismiss"),u=(0,o.Wf)("docusaurus.announcement.id"),d=()=>"true"===c.get(),f=e=>c.set(String(e)),p=r.createContext(null);function m(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.p)(),t=(0,a.A)(),[n,o]=(0,r.useState)((()=>!!t&&d()));(0,r.useEffect)((()=>{o(d())}),[]);const i=(0,r.useCallback)((()=>{f(!0),o(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=u.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;u.set(t),r&&f(!1),!r&&d()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return(0,s.jsx)(p.Provider,{value:n,children:t})}function h(){const e=(0,r.useContext)(p);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},5293:(e,t,n)=>{"use strict";n.d(t,{G:()=>y,a:()=>g});var r=n(6540),a=n(8193),o=n(9532),i=n(679),l=n(6342),s=n(4848);const c=r.createContext(void 0),u="theme",d=(0,i.Wf)(u),f={light:"light",dark:"dark"},p=e=>e===f.dark?f.dark:f.light,m=e=>a.A.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e),h=e=>{d.set(p(e))};function g(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.p)(),[a,o]=(0,r.useState)(m(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(o(t),a&&h(t)):(o(n?window.matchMedia("(prefers-color-scheme: dark)").matches?f.dark:f.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",p(a))}),[a]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==u)return;const t=d.get();null!==t&&i(p(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const s=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||s.current?s.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:a,setColorMode:i,get isDarkTheme(){return a===f.dark},setLightTheme(){i(f.light)},setDarkTheme(){i(f.dark)}})),[a,i])}();return(0,s.jsx)(c.Provider,{value:n,children:t})}function y(){const e=(0,r.useContext)(c);if(null==e)throw new o.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},9876:(e,t,n)=>{"use strict";n.d(t,{e:()=>p,M:()=>m});var r=n(6540),a=n(5600),o=n(4581),i=n(6347),l=n(9532);function s(e){!function(e){const t=(0,i.W6)(),n=(0,l._q)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}var c=n(6342),u=n(4848);const d=r.createContext(void 0);function f(){const e=function(){const e=(0,a.YL)(),{items:t}=(0,c.p)().navbar;return 0===t.length&&!e.component}(),t=(0,o.l)(),n=!e&&"mobile"===t,[i,l]=(0,r.useState)(!1);s((()=>{if(i)return l(!1),!1}));const u=(0,r.useCallback)((()=>{l((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&l(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:i})),[e,n,u,i])}function p(e){let{children:t}=e;const n=f();return(0,u.jsx)(d.Provider,{value:n,children:t})}function m(){const e=r.useContext(d);if(void 0===e)throw new l.dV("NavbarMobileSidebarProvider");return e}},5600:(e,t,n)=>{"use strict";n.d(t,{GX:()=>c,YL:()=>s,y_:()=>l});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function l(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(!e)throw new a.dV("NavbarSecondaryMenuContentProvider");return e[0]}function c(e){let{component:t,props:n}=e;const o=(0,r.useContext)(i);if(!o)throw new a.dV("NavbarSecondaryMenuContentProvider");const[,l]=o,s=(0,a.Be)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},4090:(e,t,n)=>{"use strict";n.d(t,{w:()=>a,J:()=>o});var r=n(6540);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},4581:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(6540),a=n(8193);const o={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(e){let{desktopBreakpoint:t=i}=void 0===e?{}:e;const[n,l]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){l(function(e){if(!a.A.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?o.desktop:o.mobile}(t))}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]),n}},7559:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",blogAuthorsListPage:"blog-authors-list-page",blogAuthorsPostsPage:"blog-authors-posts-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",draftBanner:"theme-draft-banner",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{blogFooterTagsRow:"theme-blog-footer-tags-row",blogFooterEditMetaRow:"theme-blog-footer-edit-meta-row"},pages:{pageFooterEditMetaRow:"theme-pages-footer-edit-meta-row"}}},3109:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{O:()=>r})},1003:(e,t,n)=>{"use strict";n.d(t,{e3:()=>p,be:()=>d,Jx:()=>m});var r=n(6540),a=n(4164),o=n(5260),i=n(3102);function l(){const e=r.useContext(i.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(6025),c=n(4586);var u=n(4848);function d(e){let{title:t,description:n,keywords:r,image:a,children:i}=e;const l=function(e){const{siteConfig:t}=(0,c.A)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,s.hH)(),f=a?d(a,{absolute:!0}):void 0;return(0,u.jsxs)(o.A,{children:[t&&(0,u.jsx)("title",{children:l}),t&&(0,u.jsx)("meta",{property:"og:title",content:l}),n&&(0,u.jsx)("meta",{name:"description",content:n}),n&&(0,u.jsx)("meta",{property:"og:description",content:n}),r&&(0,u.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),f&&(0,u.jsx)("meta",{property:"og:image",content:f}),f&&(0,u.jsx)("meta",{name:"twitter:image",content:f}),i]})}const f=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const i=r.useContext(f),l=(0,a.A)(i,t);return(0,u.jsxs)(f.Provider,{value:l,children:[(0,u.jsx)(o.A,{children:(0,u.jsx)("html",{className:l})}),n]})}function m(e){let{children:t}=e;const n=l(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const o=`plugin-id-${n.plugin.id}`;return(0,u.jsx)(p,{className:(0,a.A)(r,o),children:t})}},9532:(e,t,n)=>{"use strict";n.d(t,{Be:()=>c,ZC:()=>l,_q:()=>i,dV:()=>s,fM:()=>u});var r=n(6540),a=n(205),o=n(4848);function i(e){const t=(0,r.useRef)(e);return(0,a.A)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function l(e){const t=(0,r.useRef)();return(0,a.A)((()=>{t.current=e})),t.current}class s extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function c(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function u(e){return t=>{let{children:n}=t;return(0,o.jsx)(o.Fragment,{children:e.reduceRight(((e,t)=>(0,o.jsx)(t,{children:e})),n)})}}},9169:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>l,ys:()=>i});var r=n(6540),a=n(8328),o=n(4586);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function l(){const{baseUrl:e}=(0,o.A)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function a(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(a).flatMap((e=>e.routes??[])))}(n)}({routes:a.A,baseUrl:e})),[e])}},3104:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>f,Tv:()=>c,gk:()=>p});var r=n(6540),a=n(8193),o=n(2303),i=(n(205),n(9532)),l=n(4848);const s=r.createContext(void 0);function c(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return(0,l.jsx)(s.Provider,{value:n,children:t})}function u(){const e=(0,r.useContext)(s);if(null==e)throw new i.dV("ScrollControllerProvider");return e}const d=()=>a.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function f(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=u(),a=(0,r.useRef)(d()),o=(0,i._q)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=d();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}function p(){const e=(0,r.useRef)(null),t=(0,o.A)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const a=document.documentElement.scrollTop;(n&&a>e||!n&&at&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},679:(e,t,n)=>{"use strict";n.d(t,{Wf:()=>c});n(6540);const r=JSON.parse('{"N":"localStorage","M":""}'),a=r.N;function o(e){let{key:t,oldValue:n,newValue:r,storage:a}=e;if(n===r)return;const o=document.createEvent("StorageEvent");o.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,a),window.dispatchEvent(o)}function i(e){if(void 0===e&&(e=a),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,l||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),l=!0),null}var t}let l=!1;const s={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function c(e,t){const n=`${e}${r.M}`;if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(n);const a=i(t?.persistence);return null===a?s:{get:()=>{try{return a.getItem(n)}catch(e){return console.error(`Docusaurus storage error, can't get key=${n}`,e),null}},set:e=>{try{const t=a.getItem(n);a.setItem(n,e),o({key:n,oldValue:t,newValue:e,storage:a})}catch(t){console.error(`Docusaurus storage error, can't set ${n}=${e}`,t)}},del:()=>{try{const e=a.getItem(n);a.removeItem(n),o({key:n,oldValue:e,newValue:null,storage:a})}catch(e){console.error(`Docusaurus storage error, can't delete key=${n}`,e)}},listen:e=>{try{const t=t=>{t.storageArea===a&&t.key===n&&e(t)};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}catch(t){return console.error(`Docusaurus storage error, can't listen for changes of key=${n}`,t),()=>{}}}}}},2131:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(4586),a=n(6347),o=n(440);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:l}}=(0,r.A)(),{pathname:s}=(0,a.zy)(),c=(0,o.Ks)(s,{trailingSlash:n,baseUrl:e}),u=l===i?e:e.replace(`/${l}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${u}`:`${u}${e}/`}(n)}${d}`}}}},5062:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(6540),a=n(6347),o=n(9532);function i(e){const t=(0,a.zy)(),n=(0,o.ZC)(t),i=(0,o._q)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6342:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(4586);function a(){return(0,r.A)().siteConfig.themeConfig}},2983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addTrailingSlash=a,t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),l="/"===i||i===r?i:(s=i,c=n,c?a(s):o(s));var s,c;return e.replace(i,l)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=o;const r=n(2566);function a(e){return e.endsWith("/")?e:`${e}/`}function o(e){return(0,r.removeSuffix)(e,"/")}},253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=function e(t){if(t.cause)return[t,...e(t.cause)];return[t]}},440:(e,t,n)=>{"use strict";t.rA=t.Ks=void 0;const r=n(1635);var a=n(2983);Object.defineProperty(t,"Ks",{enumerable:!0,get:function(){return r.__importDefault(a).default}});var o=n(2566);var i=n(253);Object.defineProperty(t,"rA",{enumerable:!0,get:function(){return i.getErrorCausalChain}})},2566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPrefix=function(e,t){return e.startsWith(t)?e:`${t}${e}`},t.removeSuffix=function(e,t){if(""===t)return e;return e.endsWith(t)?e.slice(0,-t.length):e},t.addSuffix=function(e,t){return e.endsWith(t)?e:`${e}${t}`},t.removePrefix=function(e,t){return e.startsWith(t)?e.slice(t.length):e}},1513:(e,t,n)=>{"use strict";n.d(t,{zR:()=>w,TM:()=>C,yJ:()=>p,sC:()=>A,AO:()=>f});var r=n(8168);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&a(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};var l=n(1561);function s(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function f(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function p(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.A)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function m(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=p(e,t,h(),w.location);u.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(4363),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=p(n);a&&a!==m&&e(t,a,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),h=s(n),g=0;g{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,i,l],u=0;(s=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},4634:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},119:(e,t,n)=>{"use strict";n.r(t)},1043:(e,t,n)=>{"use strict";n.r(t)},5947:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function a(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),c=o.querySelector(r.barSelector),u=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,i(e,u,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),c=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function c(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=f(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},7022:()=>{!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,i=0;i{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},9700:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=o.length);s++){var c=l[s];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=o[a],d=n.tokenStack[u],f="string"==typeof c?c:c.content,p=t(r,u),m=f.indexOf(p);if(m>-1){++a;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=f.substring(m+p.length),b=[];h&&b.push.apply(b,i([h])),b.push(g),y&&b.push.apply(b,i([y])),"string"==typeof c?l.splice.apply(l,[s,1].concat(b)):c.content=b}}else c.content&&i(c.content)}return l}(n.tokens)}}}})}(Prism)},2342:()=>{Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},4188:(e,t,n)=>{var r={"./prism-bash":7022,"./prism-json":2514,"./prism-python":2342};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=4188},2694:(e,t,n)=>{"use strict";var r=n(6925);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:(e,t,n)=>{"use strict";var r=n(6540),a=n(9982);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n