Skip to content

Instantly share code, notes, and snippets.

View benjeffery's full-sized avatar

Ben Jeffery benjeffery

View GitHub Profile
import time
import numpy as np
import numba
import tskit
#@numba.njit(cache=True)
def decode(s):
stack = [0]*10000
stack_p = 0
import time
import numpy as np
import numba
import tskit
@numba.njit(cache=True)
def decode(s):
stack = np.zeros(10000, dtype=np.int32)
stack_p = np.int32(0)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tskit 0.3.6</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
static PyObject *
IndividualTable_extend(IndividualTable *self, PyObject *args, PyObject *kwds)
{
PyObject *ret = NULL;
IndividualTable *other = NULL;
PyObject *obj_row_indexes = Py_None;
PyArrayObject *row_indexes = NULL;
tsk_id_t *row_indexes_data = NULL;
tsk_size_t num_rows = 0;
int err;
import math
import numpy as np
import msprime
seed = 1102
divergence_time = 50
####Variables####
# These are the DIPLOID counts
sequence_length = 100000
Ne_A = 10000
@benjeffery
benjeffery / main.md
Last active September 23, 2020 15:05

The default repos of all the tskit-dev repos is changing from master to "main" at 1200UTC on 20200928. (Monday)

The following repos are affected:

  • administrative
  • containers
  • .github
  • kastore
  • msprime
  • msprime-1.0-paper
@benjeffery
benjeffery / covid_testing_alarm.py
Last active January 28, 2021 12:28
UK Covid testing alarm
import datetime
import time
import requests
import playsound #You might need to install pygobject if you get an error about missing "gi" module for this.
playsound.playsound("ding.mp3") #You'll need a file here that is noisy
while True:
try:
r = requests.post(
"https://ads-prd-gov-1-sp.test-for-coronavirus.service.gov.uk/testcentres/availabilityquery",