Skip to content

Instantly share code, notes, and snippets.

[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["Srinivas Gorur-Shandilya <code@srinivas.gs>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.12"
[tool.poetry]
name = "ideas-python-utils"
version = "23.1.31"
description = "Python utilities for tools in IDEAS"
authors = ["Srinivas Gorur-Shandilya <srinivas@inscopix.com>"]
readme = "README.md"
packages = [{include = "ideas"}]
[tool.poetry.dependencies]
python = ">=3.9,<3.12"
@sg-s
sg-s / poetry-apple-silicon.md
Created January 9, 2023 20:18
Getting poetry working on Macs with Apple Silicon

Problem

poetry shits the bed when trying to install ipykernel on Macs with Apple Silicon

reason

Microsoft.

Yeah. They made something called debugpy that ipykernel depends on which fails for inscritable reasons.

@sg-s
sg-s / spike-sorting.md
Last active June 11, 2021 18:05
Spike sorting Review

Spike sorting packages

Name Platform Notes
kilosort MATLAB + drift correction, GPU
mountainsort
  1. mountainsort
  2. wave_clus wavelets + super-paramagnetic clustering
@sg-s
sg-s / julia-dev.md
Last active June 14, 2021 13:26
Developing packages in Julia

What you want to do:

  • Write a package in Julia and develop it with the ultimate goal of releasing it for others to use

How to do it

  1. Open Julia
  2. Install PkgTemplates using using Pkg; Pkg.add("PkgTemplates")
  3. using PkgTemplates
  4. Create a template using your git user name: t = Template(user="sg-s")
@sg-s
sg-s / github-with-more-than-one-person.md
Last active April 23, 2021 17:10
Github with more than one person

You submitted a patch to someone else's repository, and now you want your fork to sync with their repo

  1. Clone your fork (if you haven't already)
  2. git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
  3. git fetch upstream
  4. git pull upstream master

Someone else has opened a PR on your repo, and you want to check that their code works before merging

A common problem in software development and research is the "do-something"-"save data" loop. Often we are saving structured data over and over again, and this document looks at the fastest way to do this.

Solutions I will not consider

Writing each chunk of data to its own file

I will not consider this because:

  1. how do we combine these files later? This just kicks the can down the road
@sg-s
sg-s / matlab-basic.md
Last active February 10, 2021 21:03
Extremely basic MATLAB crash course

How to make a vector

a = [1; 2; 3]
a = [1, 2, 3] % avoid
a = zeros(10,1)
a = ones(10,1)
a = NaN(10,1)
a = linspace(0,1,10)
a = logspace(-1,1,10)
@sg-s
sg-s / data-falsehoods.md
Last active May 28, 2020 20:09
Falsehoods I beleived about real data, and the price I paid for it

The data exists

If data is split across multiple files that are sequentially numbered, then it is foolish to beleive that every file exists. Some files can go missing, or be corrupted.

Files with the same name and the same size contain the same data

I learnt the hard way that one version can be corrupted, and the other version is fine, and it's all too easy to replace to good version with the corrupted version

Alternate DNS
198.101.242.72
23.253.163.53
BlockAid Public DNS (or PeerDNS)
205.204.88.60
178.21.23.150
Censurfridns
91.239.100.100