Skip to content

Instantly share code, notes, and snippets.

Ben West bewest

Block or report user

Report or block bewest

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bewest /
Last active Feb 20, 2020
glucose sonification

Glucose Sonification



Sonification is the use of non-speech audio to convey information or perceptualize data.[1] Auditory perception has advantages in temporal, spatial, amplitude, and frequency resolution that open possibilities as an alternative or complement to visualization techniques.

bewest /
Last active Oct 18, 2018
community, MDR, FDA oversight

Community and MDR

The FDA enforces science and data driven standards to promote and protect public health and safety. One of the ways they perform their job is by providing oversight of all products available to the public. One way they acheive "oversight" is through "post market surveillance," in other words monitoring how devices perform, with a special focus on potential or actual harms or injuries. In other words, FDA is deeply committed to the idea that "vendors" who create a device should know and report performance, safety and effectiveness data even when a vendor ceases to make or sell a device.

bewest /
Created Jul 29, 2018
Getting one day data out of Nightscout

Get one day data out of Nightscout

Here's how to get one day of data out of Nightscout. The trick is in realizing that the field used to define the date is different between different data types, and that different data types are stored in different places. In addition, the API itself has interesting behaviors, for example to switch between tsv, csv, and json outputs, to perform regex based searches, and in some cases bugs to work around.

Mechanics of the search syntax. The API endpoints support a query string syntax used to compose queries.

bewest / oh.js
Last active Aug 27, 2016
proof of concept, gets data from Nightscout, sends it to OpenHumans
View oh.js
openhumans upload API
METADATA='{"tags": ["survey", "diet", "csv"], "description": "Diet survey questions and responses", "md5": "156da7fc980988c51682374436849943"}'
http --verbose --form POST $URL \
View foo-data.txt
bewest / new-defaults.json
Created Aug 7, 2016
nightscout defaults experiment
View new-defaults.json
"units": "mg/dL",
"timeFormat": 12,
"nightMode": false,
"editMode": true,
"showRawbg": "always",
"customTitle": "Nightscout",
"theme": "default",
"alarmUrgentHigh": false,
"alarmUrgentHighMins": [
bewest /
Created Jul 10, 2016
prepping data by rewinding history

rewind history, extracting data and observations for openai

 2315  ./mk-time-series monitor/glucose.json | tee mega-log-glucose.json
 2316  head mega-log-glucose.json 
 2327  cat mega-log-glucose.json | json -a hash
 2328  cat mega-log-glucose.json | json -a hash | wc -l
bewest / new-predict-reports.json
Created Jul 10, 2016
reports with loudnates stuff set up
View new-predict-reports.json
"type": "alias",
"name": "rm-warmup",
"rm-warmup": {
"command": "! bash -c \"rm -f model.json monitor/clock.json > /dev/null\""
"type": "alias",
bewest /
Created Jul 10, 2016
openai gym environment
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
from openapscontrib.predict import predict
class DiabetesEnv(gym.Env):
metadata = {
You can’t perform that action at this time.