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 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.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
# 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
# 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
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
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 arbor | |
import re | |
import subprocess | |
import tempfile | |
import pathlib | |
import matplotlib.pyplot as plt | |
nmodl = ''' | |
NEURON { | |
SUFFIX node |
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 collections | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
logfile = '<path to benchmark output.dat>' | |
tables = collections.defaultdict(list) | |
def tryfloat(x): | |
# the argument can be a float or |
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
// Generated code block BEGIN | |
#define M_PI 3.14159265358979323846 | |
#include <math.h> | |
typedef float * __restrict__ __attribute__((align_value (32))) Table_F32; | |
typedef long long * __restrict__ __attribute__((align_value (32))) Table_I64; | |
typedef union { int i32; float f32; } TypePun_I32F32; typedef char static_assert[ sizeof(int) == sizeof(float) ]; | |
static float EncodeI32ToF32( int i ){ TypePun_I32F32 cast; cast.i32 = i; return cast.f32;} | |
static int EncodeF32ToI32( float f ){ TypePun_I32F32 cast; cast.f32 = f; return cast.i32;} | |
static float stepf( float x ){ if( x < 0 ) return 0; else return 1; } |