These are chat archives for nightscout/intend-to-bolus

23rd
Jun 2015
Ben West
@bewest
Jun 23 2015 00:03
cool, I think if you run sudo activate-global-python-argcomplete that should enable tab completion features
diabeticgonewild
@diabeticgonewild
Jun 23 2015 00:14
Will do. Feeling better a lot better now. Thank you!
Ali Mazaheri
@amazaheri
Jun 23 2015 02:35
running 0.0.3 :)
running both Rasbian and Ubuntu I find Rasbian more stable.
diabeticgonewild
@diabeticgonewild
Jun 23 2015 02:39
Future images will use Raspbian
Ali Mazaheri
@amazaheri
Jun 23 2015 03:16
:+1:
Ben West
@bewest
Jun 23 2015 03:20
it's debian/apt based, so should be fairly similar procedure
openaps itself is a pure python package, as long as you have setuptools installed, openaps should install nicely
some of the plugins might use things like numpy which will start to require additional dependencies... either things like -dev packages to install headers, or sometimes the apt version of the package
so things like scipy, numpy are better installed via apt sometimes
@amazaheri I noticed your version uses a web service... are you just posting latest outputs for analysis later?
Ali Mazaheri
@amazaheri
Jun 23 2015 03:25
yeah
its there
its a simple webAPI
Ben West
@bewest
Jun 23 2015 03:26
was thinking about breaking up the scripts a bit more
loudnate has some history cleaning functions
iob.js actually does few things, including filtering history
Ali Mazaheri
@amazaheri
Jun 23 2015 03:27
agreed it would be great
Ben West
@bewest
Jun 23 2015 03:27
currently it fails to interleave known basal schedule, fails to retrospectively apply any potentially changed basals, and needs to consider suspend/resume
so thinking about splitting that out, maybe into @loudnate's thing
Ali Mazaheri
@amazaheri
Jun 23 2015 03:28
so I added current basal to getprofile.js
Ben West
@bewest
Jun 23 2015 03:28
so few more "intermediate" steps
as their own "use"
Ali Mazaheri
@amazaheri
Jun 23 2015 03:29
I changed the iob to use the profile vs. hardcoded values
Ben West
@bewest
Jun 23 2015 03:29
ah very nice
very very nice
ok, you are handling js well
Ali Mazaheri
@amazaheri
Jun 23 2015 03:30
the profile gets u ISF, CarbRatio, bgtargets and Basal setting based on time of the execution
VS node JS extension helps lol
we need suspend resume, its missing from original pseudo code and ref design
I added a dev branch which we can start tweaking
Ben West
@bewest
Jun 23 2015 03:32
considering TempBasals and Bolus correctly is main thing
if we can do all that, we should be able to add suspend/resume relatively easily
it generates basal "events" for given time range
according to given schedule
any of the tr/es stream stuff you can think of as funny way for handling arrays
lot of people get hung up on the streams stuff, but really it's an array, but organized in time rather than memory
Ali Mazaheri
@amazaheri
Jun 23 2015 03:34
:+1:
Ben West
@bewest
Jun 23 2015 03:35
ok I apparently uninstalled node from my rpi
time to re-install it
I was wondering if I should work on these tools in python or js
diabeticgonewild
@diabeticgonewild
Jun 23 2015 03:35
Everyone's doing JS
Ali Mazaheri
@amazaheri
Jun 23 2015 03:35
python if
converting is not too much hassle
diabeticgonewild
@diabeticgonewild
Jun 23 2015 03:35
I like Python though
Ben West
@bewest
Jun 23 2015 03:36
well, both work
Ali Mazaheri
@amazaheri
Jun 23 2015 03:36
then hybrid
:)
Ben West
@bewest
Jun 23 2015 03:36
are you using getprofile as openaps device?
Ali Mazaheri
@amazaheri
Jun 23 2015 03:36
yes
Ben West
@bewest
Jun 23 2015 03:36
then you can configure reports
Ali Mazaheri
@amazaheri
Jun 23 2015 03:36
that's what I have
using ur goodness
its the last step
after getting all the info from pump
it generates profile.json
like:
{"carbs_hr":28,"max_iob":3,"dia":3,"target_bg":120,"type":"current","current_basal":0.5,"max_daily_basal":0.6000000000000001,"max_basal":1,"max_bg":180,"min_bg":90,"carbratio":20,"sens":120}
for point of time
then I use it for iob and request temp basal
Ben West
@bewest
Jun 23 2015 03:38
ah, I was looking at your openaps.ini
Ali Mazaheri
@amazaheri
Jun 23 2015 03:38
would be great
to add an extension
openaps use pump get_profile
Ben West
@bewest
Jun 23 2015 03:39
you can do that now
Ali Mazaheri
@amazaheri
Jun 23 2015 03:39
alais?
Ben West
@bewest
Jun 23 2015 03:39
it's same way determinebasal works
no, even better, it's a device
Ali Mazaheri
@amazaheri
Jun 23 2015 03:39
oh
that I have
Ben West
@bewest
Jun 23 2015 03:39
there's a special vendor called uh
Ali Mazaheri
@amazaheri
Jun 23 2015 03:39
in my working repo
hold on
I update it
Ben West
@bewest
Jun 23 2015 03:40
openaps device add -h has a special process type
diabeticgonewild
@diabeticgonewild
Jun 23 2015 03:40
Man I need to get to work on this stuff. So far behind. Write up comes first though. Withdrawal from this med sucks! I'm getting anxiety, heart palpitations and nausea but it's better than doing nothing even though i felt more motivated on this med.
Ben West
@bewest
Jun 23 2015 03:40
so you can tell openaps that your "node process" is a "process" type of device
this way you can tell openaps to use node to run the tool, same as all others
diabeticgonewild
@diabeticgonewild
Jun 23 2015 03:41
How do you use plugins?
Ben West
@bewest
Jun 23 2015 03:43
that's what I'm describing actually
if you have eg some js node script
diabeticgonewild
@diabeticgonewild
Jun 23 2015 03:43
Yeah
Ben West
@bewest
Jun 23 2015 03:43
you can make openaps support it through this plugin mechanism, specifically, it's a "process" type of plugin
Ali Mazaheri
@amazaheri
Jun 23 2015 03:44
updated ini is there
Ben West
@bewest
Jun 23 2015 03:47
ah, here's an example: bewest/openaps-example@73e2032
diabeticgonewild
@diabeticgonewild
Jun 23 2015 03:48
I'm going to go into plugins on my write up so an example would be useful. It doesn't have to be perfect though
Ben West
@bewest
Jun 23 2015 03:48
so typing openaps device add calciob process --require input node iob.js tells openaps that iob.js is a "node script", that it takes a single input, we'll call input and to internally name that as a device called calciob
so now it shows up under openaps use calciob -h
and if your run the use case there, it actually runs the node script with the required arguments
diabeticgonewild
@diabeticgonewild
Jun 23 2015 03:49
Awesome! That's perfect!
Ben West
@bewest
Jun 23 2015 03:50
that means openaps can configure and track it using reports also
diabeticgonewild
@diabeticgonewild
Jun 23 2015 03:51
Awesome! 👌
Ben West
@bewest
Jun 23 2015 03:51
Vendors get implemented in "devices" which can be "used" and tracked by "reports" to log what they are doing
now there's an alias system, so once your devices and reports and "configured" the way you like them, you can alias them to shorter commands
diabeticgonewild
@diabeticgonewild
Jun 23 2015 03:53
Nice!
Ben West
@bewest
Jun 23 2015 03:58
@amazaheri that's cool, nice to see people using this
Ali Mazaheri
@amazaheri
Jun 23 2015 04:05
its pure goodness :)
Chris Hannemann
@channemann
Jun 23 2015 04:08
@diabeticgonewild nice work on the writeup
will you be uploading it as sections in the openaps wiki?
Ali Mazaheri
@amazaheri
Jun 23 2015 04:09
agree nice to add that to wiki
Chris Hannemann
@channemann
Jun 23 2015 04:11
I would be interested in writing some sections that make it even more accessible and understandable to those who are completely new to the project (and perhaps even to GitHub, Raspberry Pi, and even closed loops systems)
Ben West
@bewest
Jun 23 2015 04:12
yeah, wiki is one way
there is a docs repo, it's all markdown
Chris Hannemann
@channemann
Jun 23 2015 04:13
If you publish your writeup there or elsewhere (per @bewest’s suggestions), I can go in and start adding those other sections
Ben West
@bewest
Jun 23 2015 04:13
can fork and do pr's/issues on that
I think that's my pref, because we can re-use it for website/book, etc...
Chris Hannemann
@channemann
Jun 23 2015 04:13
ah, and you can’t do those on the wiki, correct?
Ben West
@bewest
Jun 23 2015 04:14
right, the wiki is slightly less re-usable
I mean, it's there and anyone can edit it
so that's the benefit
but wiki's in general tend to get messy
Chris Hannemann
@channemann
Jun 23 2015 04:14
The only other benefit I see with the wiki is that it’s front-and-center
Ben West
@bewest
Jun 23 2015 04:15
what do you mean?
Chris Hannemann
@channemann
Jun 23 2015 04:16
When you’re on the openaps github site, the wiki link on the right is prominent
But providing a link at the top of the readme could serve a similar function
Ben West
@bewest
Jun 23 2015 04:20
yeah, same for single page on wiki that says "go here"
Chris Hannemann
@channemann
Jun 23 2015 04:20
good call
diabeticgonewild
@diabeticgonewild
Jun 23 2015 04:21
Yeah I will be making sections and owing his suggestions
Chris Hannemann
@channemann
Jun 23 2015 04:22
Ok, I’ll start writing the stuff around your piece, then
diabeticgonewild
@diabeticgonewild
Jun 23 2015 04:22
I forked it. I just have find the repo.
Didn't do much work. Yay for medicine that makes me sleepy and stress free to the point that I don't work
Here's the repo of the doc https://github.com/diabeticgonewild/docs
I don't know markdown too well so it doesn't look right right now
Chris Hannemann
@channemann
Jun 23 2015 04:27
No worries, we’re all learning
Will you be putting in a pull request for it soon, or are you waiting to polish it up a bit first?
diabeticgonewild
@diabeticgonewild
Jun 23 2015 04:28
Polishing first. I want it to be clean before others use it.
It doesn't have to be perfect and it won't be
But it needs to not be confusing
Due to appearance
Chris Hannemann
@channemann
Jun 23 2015 04:29
Got it
diabeticgonewild
@diabeticgonewild
Jun 23 2015 04:30
I am not a teacher or anything so I am not perfect with respect to providing this knowledge for users who need this assistance
But It can be improved as more people get started on openAPS
Chris Hannemann
@channemann
Jun 23 2015 04:30
That’s the idea
I was just wondering if I shoud fork the master now or wait for yours to get merged
diabeticgonewild
@diabeticgonewild
Jun 23 2015 04:32
Do what you want. I hope to be done with this on Wednesday but I am experiencing withdrawals and don't feel well.
Don't wait on me is what I am trying to say
Chris Hannemann
@channemann
Jun 23 2015 04:33
In that case, I think I’ll simply write these parts locally for the moment; no rush to throw them up there
Thanks
diabeticgonewild
@diabeticgonewild
Jun 23 2015 04:33
You're welcome 😎
diabeticgonewild
@diabeticgonewild
Jun 23 2015 04:39
Yeah working on the write up now!
Nathan Racklyeft
@loudnate
Jun 23 2015 05:12
@bewest mmhistorytools handles suspends, overlapping/cancelled temp basals, halted square and normal boluses, and normalizes against a basal schedule. an iob curve on top of that should be incredibly easy. I hesitated adding one (I'm using walsh) to that project because there seems to be varying preferences among folks here.
diabeticgonewild
@diabeticgonewild
Jun 23 2015 05:19
You can use the 530G IOB curve or the 522 curve I made
An example of the 530G one being applied is in the PR for NS
Link: nightscout/cgm-remote-monitor#564
Nathan Racklyeft
@loudnate
Jun 23 2015 05:21
yep – will be great to see a variety of plugins for different curves in openaps too!
diabeticgonewild
@diabeticgonewild
Jun 23 2015 05:21
Walsh is good though
Yeah I made one for Novolog recently. I want to do +/- 5,10,15, and 20% errors on the glucose infusion rate graphs. The integral of the glucose infusion rate is practically the IOB function (almost--have to do confidence intervals and scaling to 100%)
That's the error according to these people that do these studies all the time
But @bewest provided a really good link a month ago
But yeah you could go wild with the derivative of those functions
Nathan Racklyeft
@loudnate
Jun 23 2015 05:26
that's cool. I'd love to try out those curves in my own predictions!
Chris Hannemann
@channemann
Jun 23 2015 05:43
@loudnate once you get the framework for adding any IOB curve based on the data, it should be trivial to make it flexible
could you try going through the motions with an easy one—something as basic as linear decay to keep the math simple—and see how it functions?
Nathan Racklyeft
@loudnate
Jun 23 2015 05:53
yeah, so a point-in-time linear iob from the dataset shown here, assuming a fixed insulin duration:
Nathan Racklyeft
@loudnate
Jun 23 2015 06:06
ah so writing this from scratch isn't going to happen tonight, sorry. I rely on you for calculus. :smile: I updated the openaps -> glucodyn renderer to use mmhistorytools tonight, though. Let's get together this week and we can pull together a simple linear IOB example plugin.
Chris Hannemann
@channemann
Jun 23 2015 06:07
sounds good to me
let me know when you're free (I think I'm good except Wednesday)
diabeticgonewild
@diabeticgonewild
Jun 23 2015 06:10
If you're crazy, are a math person, and are hands on you can do it from scratch. I have the papers if you want them and I can explain it to you...but only if you are crazy! One of the steps literally looks like this https://twitter.com/wilddiabetic/status/603108332652466176
loudnate @loudnate takes the calendar discussion offline
diabeticgonewild
@diabeticgonewild
Jun 23 2015 07:04
OK I really want to get a working APS going quickly and fast and I can whip it out in MATLAB super fast cause that's my native programming language, plus I'm pretty much married to it. Anyway, I want to learn JS and Python but this approach is quick and fast. The Pi can't run MATLAB but the minnowboard max can. It can be executed on the command line so I'm pretty much set. Plus I can use all of the extensions I want. I do intend on making a JS or Python version as it's more versatile but I can really get this done super quickly in my native language. Here's an example of it executing at the command line: http://m.imgur.com/RiNdvRV
Also the Minnowboard Max v2 looks like it could run my #VirtualPancreas project for ambulatory use!!!!! This has comparable specifications of my 2007 laptop when I started college!!!!!!
diabeticgonewild
@diabeticgonewild
Jun 23 2015 07:10
Well I had a 2.0 GHz processor vs a 1.33 GHz processor but without the GUI it should be fine with dual cores and parallel processing set up and parameterized for the #VirtualPancreas (Hovorka stuff) project
diabeticgonewild
@diabeticgonewild
Jun 23 2015 07:30
I'm not being lazy. I'm just going to take the path of least resistance, for now.
I do intend on doing it in another language besides MATLAB because I enjoy learning, but "learning to program in a new language" for an "artificial pancreas project" is less than ideal.
But yeah, pretty sure I can have the writeup done before tomorrow morning!