Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Learning bio brb

Cameron Davidson-Pilon CamDavidsonPilon

:shipit:
Learning bio brb
View GitHub Profile
View light_dark_cycle_led_automation.py
# -*- coding: utf-8 -*-
from __future__ import annotations
import signal
from pioreactor.automations import LEDAutomationContrib
from pioreactor.automations import events
from pioreactor.actions.led_intensity import LED_Channel
__plugin_summary__ = "An LED automation for ON/OFF cycles"
__plugin_version__ = "0.0.2"
__plugin_name__ = "Light Dark Cycle LED automation"
@CamDavidsonPilon
CamDavidsonPilon / install_pioreactor_as_leader.sh
Last active Mar 31, 2021
TODO: make these absolute paths
View install_pioreactor_as_leader.sh
#!/bin/bash
sudo apt update
sudo apt install -y git
git clone https://github.com/Pioreactor/pioreactor.git --depth 1
cd pioreactor
make install-leader
View install_pioreactor_as_worker.sh
#!/bin/bash
sudo apt update
sudo apt install -y git
git clone https://github.com/Pioreactor/pioreactor.git --depth 1
cd pioreactor
make install-worker-from-args newHostname=$1
View install_pioreactor_leader_as_worker.sh
#!/bin/bash
sudo apt update
sudo apt install -y git
git clone https://github.com/Pioreactor/pioreactor.git --depth 1
cd pioreactor
make install-leader-as-worker
View fivethirtyeight.csv
votes scaled_prob
64.02877697841728 0
79.85611510791367 0
93.52517985611513 0
107.19006190396522 0.0
120.14388489208633 0
135.97122302158274 0
151.07913669064752 0
159.70386481512466 0.011627906976744207
173.36038146227202 0.02906976744186074
@CamDavidsonPilon
CamDavidsonPilon / nodered.json
Last active Jun 30, 2020
Part of tempeh.io blog post
View nodered.json
[
{
"id": "328cb8d0.ad53d8",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "e064c4c9.ed0b18",
View DHT22.py
import time
import board
import adafruit_dht
from paho.mqtt import publish
# Initial the dht device, with data pin connected to:
dhtDevice = adafruit_dht.DHT22(board.D21)
while True:
View b_splines.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View model2.py
"""
Our model is
log(cell/ml) = alpha * (secchi stick depth) + intercept + Noise
However, our cell/mL comes from a noisy hemocytometer, and our
depth measured with the secchi stick is also noisy. Our goal is
still to infer alpha & intercept as well as possible, so we can
dump the hemocytometer.
View show_problem_eval.py
# test previous algorithm
actuals = pd.read_csv("https://gist.githubusercontent.com/csaid/a57c4ebaa1c7b0671cdc9692638ea4c4/raw/ad1709938834d7bc88b62ff0763733502eb6a329/shower_problem_tau_samples.csv")
DELTA = 0.1
def survival_function(t, lambda_=50., rho=1.5):
# Assume simple Weibull model
return np.exp(-(t/lambda_) ** rho)