Skip to content

Instantly share code, notes, and snippets.

@tabedzki
tabedzki / console_output.log
Last active September 13, 2024 19:32
Simplified Version of Current Kilosort Logging and interplay with module level logging
outer_logger - DEBUG - This is a debug message from the outer logger before calling run_kilosort.
outer_logger - INFO - This is an info message from the outer logger before calling run_kilosort.
test_logging: Kilosort version 4
test_logging: Sorting None
test_logging: ----------------------------------------
test_logging: Encountered error in `run_kilosort`:
Traceback (most recent call last):
File "/Users/ct5868/test_logging.py", line 22, in run_kilosort
will_fail()
File "/Users/ct5868/test_logging.py", line 30, in will_fail
@tabedzki
tabedzki / console_output
Last active September 13, 2024 19:29
Proposed alternative to current Kilosort Logging and interplay with module level logging
outer_logger - DEBUG - This is a debug message from the outer logger before calling run_kilosort.
outer_logger - INFO - This is an info message from the outer logger before calling run_kilosort.
outer_logger - ERROR - Kilosort4 failed
Traceback (most recent call last):
File "/Users/ct5868/testing_logging_levels.py", line 35, in <module>
run_kilosort(settings={}, results_dir='.')
File "/Users/ct5868/test_logging.py", line 26, in run_kilosort
raise e
File "/Users/ct5868/test_logging.py", line 21, in run_kilosort
will_fail()
@tabedzki
tabedzki / sample_dropdown_with_down_arrow.m
Created March 20, 2024 15:28
This file serves as an example of a working dropdown menu in MATLAB to replace the deprecated uisplittools
% Create a figure and add a toolbar to it
fig = figure('Toolbar', 'none', 'MenuBar', 'none', 'Name', 'Custom Toolbar Dropdown', 'WindowButtonDownFcn', @(src, event)hideContextMenu(src));
tb = uitoolbar(fig);
% Load the icon (e.g. greenarrowicon)
icon = fullfile(matlabroot,'/toolbox/matlab/icons/greenarrowicon.gif');
[cdata,map] = imread(icon);
% Convert white pixels into a transparent background
map(map(:, 1) + map(:, 2) + map(:, 3) == 3) = NaN;
% Convert into 3D RGB-space
cdataRedo = ind2rgb(cdata,map);
@tabedzki
tabedzki / lammps_init_v2.py
Last active July 13, 2021 15:32
Polymer creation for LAMMPS
import numpy as np
import pbc_utils as pbc
import sys
import os
import math
class input_config:
def __init__(self, xbox, ybox, zbox):
self.natoms = 0
self.nbonds = 0