This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import numba | |
import time | |
NUM_STATE_VARS = 14 | |
def main(): | |
n = 5 | |
s = make_initial_neuron_state(n ** 3, V_soma=None, V_axon=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.path.insert(0, '/home/llandsmeer/repos/llandsmeer/arbor/build-debug/prefix/lib/python3.10/site-packages') | |
sys.path.append('/home/llandsmeer/repos/llandsmeer/nmlcc-cat') | |
import arbor | |
import matplotlib.pyplot as plt | |
import nmlcat | |
cat = nmlcat.Catalogue.make() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker build -t arbor-gui . && docker run -it -p 5999:5999 arbor-gui | |
# then visit http://localhost:5999/vnc.html?host=localhost&port=5999&autoconnect=true | |
FROM ubuntu:latest | |
EXPOSE 5999 | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | |
ENV TZ=Europe/Amsterdam | |
RUN apt-get update && apt-get install -y xvfb x11vnc wget novnc git wmctrl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git clone --depth 1 --recursive --branch=SDE 'https://github.com/boeschf/arbor' | |
# cd arbor ; mkdir build ; cd build | |
# cmake -DCMAKE_INSTALL_PREFIX=$(realpath prefix) -DARB_USE_BUNDLED_LIBS=ON -DARB_WITH_PYTHON=ON .. | |
# make -j 12 && make install | |
import sys | |
import importlib.util | |
import os.path | |
#### IF INSTALLED USING PIP: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import numpy as np | |
import re | |
import subprocess | |
import tempfile | |
import arbor | |
from math import sqrt | |
import matplotlib.pyplot as plt | |
ARBOR_BUILD_CATALOGUE = 'arbor-build-catalogue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sympy as sm | |
import lark | |
parser = lark.Lark(r''' | |
%import common.SIGNED_NUMBER -> NUMBER | |
%import common.WS | |
%ignore WS | |
%ignore /\?.*\n/ | |
%ignore /:.*\n/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import json | |
import requests | |
import rtmidi | |
# pip install python-rtmidi | |
midi = rtmidi.MidiIn() | |
ports = midi.get_ports() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import pyte | |
import struct | |
import select | |
import time | |
import fcntl | |
import os | |
import pty | |
import subprocess | |
import termios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import numpy as np | |
from PyQt5 import QtGui, QtWidgets, QtCore | |
class MainWindow(QtWidgets.QMainWindow): | |
def __init__(self): | |
super().__init__() | |
self.imshow = Grayscale() | |
self.setCentralWidget(self.imshow) | |
self.update_timer = QtCore.QTimer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numba | |
import numpy as np | |
@numba.jit(fastmath=True, cache=True, nopython=True) | |
def simulate(skip_initial_transient_seconds=0, sim_seconds=10, delta=0.005, record_every=20, | |
# Parameters | |
g_int = 0.13, # Cell internal conductance -- now a parameter (0.13) | |
p1 = 0.25, # Cell surface ratio soma/dendrite | |
p2 = 0.15, # Cell surface ratio axon(hillock)/soma |