Skip to content

Instantly share code, notes, and snippets.

View h-mayorquin's full-sized avatar

Heberto Mayorquin h-mayorquin

View GitHub Profile

[Plover][] is an awesome open source stenography program, but to run the software [you need an NKRO keyboard][nkro]. The [ErgoDox keyboard][ergodox] can be made to run in NKRO mode by following these steps.

Install dependencies

These instructions are based on this document, which assumes you're using Windows. I'm using a mac, and I had to download and install the [CrossPack for AVR Development][crosspack] before the build process worked.

Download the source

The NKRO firmware and Plover keymap can be found in the simon_layout branch of @shayneholmes fork of tmk_keyboard. Get the source:

@h-mayorquin
h-mayorquin / calculate_nwb_compression.py
Last active January 21, 2022 14:46
Calculates the compression for a given dandi-set
import h5py
from dandi.dandiapi import DandiAPIClient
from pynwb import NWBHDF5IO
import pynwb
import numpy as np
dandi_dataset_id = "000166"
dandi_dataset_id = "000213"
with DandiAPIClient() as client:
@h-mayorquin
h-mayorquin / test_performance.py
Created March 24, 2022 16:49
Test interface performance
def run_neuroscope(spikeextractors_backend):
from datetime import datetime
from nwb_conversion_tools import NWBConverter, NeuroscopeRecordingInterface
file_path = "/home/heberto/globus_data/Buzsaki/TingleyD/DT1/DT1_rLS_20150723_1584um/DT1_rLS_20150723_1584um.dat"
nwbfile_path = str("./performance.nwb")
@h-mayorquin
h-mayorquin / test_neuroscope_memory
Created April 4, 2022 07:11
To run with the profiler.
from pathlib import Path
def run_neuroscope(spikeextractors_backend):
from datetime import datetime
from nwb_conversion_tools import NWBConverter, NeuroscopeRecordingInterface
file_path = Path(
"/home/heberto/globus_data/Buzsaki/TingleyD/DT1/DT1_rLS_20150723_1584um/DT1_rLS_20150723_1584um.dat"
@h-mayorquin
h-mayorquin / test_spikelgx_performance.py
Created April 15, 2022 14:39
Test performance for spikeglx
from datetime import datetime
from pathlib import Path
from nwb_conversion_tools import NWBConverter
output_path = Path("/home/heberto/")
def run_conversion_function(parameters_dic):
nwbfile_path = output_path / f"{str(parameters_dic['case_name'])}.nwb"
class TestConverter(NWBConverter):
data_interface_classes = dict(Interface=parameters_dic["data_interface"])
@h-mayorquin
h-mayorquin / session_start_time.py
Last active May 9, 2022 14:15
session_start_time time zone attach vs attach and offset
from datetime import datetime
import dateutil
from datetime import tzinfo
# The name to inupt here is the second column in the following table:
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
tzinfo=dateutil.tz.gettz("America/Los_Angeles")
# This adds the time zone and offsets the time
session_start_time = datetime.fromisoformat('2020-02-01 16:10:09')
@h-mayorquin
h-mayorquin / error_movie_interface.py
Created May 5, 2022 10:27
Error in the movie interface
============================= test session starts =============================
platform win32 -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
rootdir: D:\a\nwb-conversion-tools\nwb-conversion-tools
plugins: cov-3.0.0, forked-1.4.0, xdist-2.5.0
gw0 I / gw1 I
gw0 [215] / gw1 [215]
....s................................................................... [ 33%]
........................................F...........................s.ss [ 66%]
....s.................................................................. [100%]
from pathlib import Path
import os
data_directory = Path("/home/heberto/loki20210127/stream/")
file_path = data_directory / "Image_001_001.raw"
file_path_tiff = data_directory / "Image_001_001_2GB_001.tif"
file = file_path.open()
file_descriptor = file.fileno()
file_size = os.fstat(file_descriptor).st_size
@h-mayorquin
h-mayorquin / calculate_pytest_duration.py
Created June 30, 2022 00:33
Create a data set for time sts
# Run this before pytest --durations=100 --durations-min=0.05 > test_output.txt
from pathlib import Path
import pandas as pd
file_path = Path("test_output.txt")
all_text = file_path.read_text()
all_lines = all_text.splitlines()
first_index = all_lines.index(next(line for line in all_lines if "slowest" in line)) + 1
@h-mayorquin
h-mayorquin / Metadata for Axona
Created August 3, 2022 17:19
Meatadata for axona
{'bin': {'filename': PosixPath('/home/heberto/ephy_testing_data/axona/axona_raw.bin'),
'bytes_packet': 432,
'bytes_data': 384,
'bytes_head': 32,
'bytes_tail': 16,
'data_type': 'int16',
'header_size': 0,
'header_encoding': None,
'num_channels': 16,
'num_total_packets': 19200,