Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loopalyzer - The Loop visualizer #3629

Closed
wants to merge 43 commits into from
Closed

Loopalyzer - The Loop visualizer #3629

wants to merge 43 commits into from

Conversation

lixgbg
Copy link
Contributor

@lixgbg lixgbg commented Jun 10, 2018

Hello

This is a new report to help visualise how Loop works to make it easier to adjust the ratios that affect its performance. Loopalyzer adds an additional tab to Nightscout reports. It does work with some other setups as well (closed and open loop and non loop, your mileage may vary depending on uploader) but is intended for Loop users.

To explain its purpose and how to use it please see this short introduction -> https://youtu.be/4-yXkzNqTE0

This feature was submitted to master branch a couple of weeks ago. I cancelled it and this is an improved version, and submitted to dev branch.

lixgbg and others added 30 commits March 10, 2018 16:27
Dev update from nightscout
Refresh dev from nightscout
New branch dev -> loopalyzer-dev, cloned to Mac, edited index.js and pushing.
Merge loopalyzer-dev into loopalyzer
Update with latest dev; IOB/COB from NS client util
* Skipping Loopalyzer unless it is the selected tab
* Showing message if more than one week duration selected
Added fill-in using carb and insulin treatments to avoid gaps in graphs
@PieterGit
Copy link
Contributor

@lixgbg Nice PR. My npm update created a conflict. Is this ready to merge?

I don't know if Loopalyzer is a good name because I thought it was specific for Loop.
Perhaps "Analyze APS" or something else is better.

@nightscout nightscout deleted a comment Jun 25, 2018
@PieterGit
Copy link
Contributor

@lixgbg Thinking about a better functional name. I would like to have the names of the tabs to be clear for people. Isn't your loopalyzer more of a Daily (detailed) view of the Nightscout data?

@MilosKozak or @sulkaharo or @jasoncalabrese : what do you think about the right name for this view?

@lixgbg
Copy link
Contributor Author

lixgbg commented Jun 26, 2018

@PieterGit I did an npm update in an attempt to resolve the conflicts. But there is still a number of them, apparently because I based my code on 0.10.3-dev from 2018-03-04 and the latest is 2018-06-24. How do you resolve these conflicts in the most efficient way?

@lixgbg
Copy link
Contributor Author

lixgbg commented Jun 26, 2018

@PieterGit @MilosKozak @sulkaharo @jasoncalabrese
Initially I developed this view to enable a better visualization of the data that Loop uploads to NS and makes its decisions on, hence the name Loopalyzer. I then improved it and tested with other uploaders and attempted to make it as tolerant as possible to various data, and to missing data. So now it's more versatile than its original purpose. Still it's most useful if data such as carbs (and COB) and insulin (and IOB) is uploaded to NS, which is not the case if using a plain NS setup, e.g. using only Dexcom.

Feel free to be creative with naming, given this background info.

@lixgbg
Copy link
Contributor Author

lixgbg commented Jul 19, 2018

@PieterGit did you have a chance to look at and resolve the conflict for this PR and the 3179?

@PieterGit PieterGit added this to the 0.11.0 milestone Jul 19, 2018
@PieterGit
Copy link
Contributor

@lixgbg No not yet. We first need to get 0.10.3 out of the door and I think this PR needs extra work/thought before implementing it. We also need to have consensus on the view and the name we present to the users. My best guess for now is that this is a "Daily (detailed)" view which is a bit more clear to novice users than Loopalyzer. But I'm very open for better names and discussion on that subject.

So I'm hoping other core committers like @MilosKozak @sulkaharo @jasoncalabrese can join this discussion. They are all very busy these days.

@PieterGit
Copy link
Contributor

@lixgbg now that 0.10.3 has been release I think this feature can soon be merged to dev. Can you confirm that it is ready to merge to dev?

@lixgbg
Copy link
Contributor Author

lixgbg commented Aug 7, 2018

@PieterGit Yes it should be ready (unless there are some criteria for merging I’m not aware of).

@PieterGit
Copy link
Contributor

@lixgbg I resolved the conflicts and merged it to https://github.com/nightscout/cgm-remote-monitor/tree/wip/loopalyzer

I noticed that both the Loopalyzer view and the Day to Day header showed up:
image

I will test further later this week. Please PR new commits to wip/loopalyzer.

@lixgbg
Copy link
Contributor Author

lixgbg commented Aug 15, 2018

@PieterGit Thanks for the merge. Interesting that both headers showed up. I have been running Loopalyzer for many weeks now and have never seen that. Do you know if anything fundamental has changed in the Reports in 0.11 (I have been on 0.10.3 dev)?

@PieterGit PieterGit mentioned this pull request Aug 25, 2018
@PieterGit
Copy link
Contributor

@jasoncalabrese @MilosKozak @sulkaharo @jpcunningh Can you please review this PR of @lixgbg and tell me if you think we can merge this for the 0.11 release?

@jpcunningh
Copy link
Collaborator

@PieterGit, I've played with it for about 45minutes this evening it looks and feels solid to me. We are using OpenAPS, and the plugin appears to be pulling the data in correctly.

I also tested as many boundary conditions as I could think of such as using the buttons to go to days before the From / To settings, going past the current day, etc. Also saw no errors on the console.

@lixgbg, very nice addition! Thank you!

@bewest
Copy link
Member

bewest commented Nov 18, 2018

Very cool report.

@PieterGit
Copy link
Contributor

This PR has been integrated with the https://github.com/nightscout/cgm-remote-monitor/tree/needs_testing
branch. Please test that branch and report at this issue or at #4169

@PieterGit
Copy link
Contributor

@lixgbg thanks for your hard work on this PR.

This PR has been tested as part of the need_testing branch of #4169
@blocklist_twitter @balshor @sulkaharo @jpcunningh @unsoluble @veryfancy @balshor @tynbendad have run this PR for a week.
Several users reported succes with this new report and really like it! No negative stuff popped up. Gitter link: https://gitter.im/nightscout/public?at=5c2f33d12863d8612bd78eb0

If you encounter success or failure with this PR, please reopen the issue and share your findings.

Closing PR, will be merged with #4169

@PieterGit PieterGit closed this Jan 5, 2019
@lixgbg
Copy link
Contributor Author

lixgbg commented Jan 6, 2019

Thanks, sounds good! Where is a good place to add some documentation on it? I made a Youtube video a few months ago (at the top of this PR) but it would make sense to also have something in text. I haven't found any documentation for any of the Reports so far. Is there a place for that?

@lixgbg lixgbg mentioned this pull request Jan 19, 2019
@sulkaharo sulkaharo mentioned this pull request Feb 7, 2019
sulkaharo added a commit that referenced this pull request Feb 7, 2019
Draft release notes for upcoming 0.11 release (currently release candidate phase).

# Changes

Over 360 commits, 89 files changed, +8,428 / −6,569 lines of changes (full list of changes here: 
https://github.com/nightscout/cgm-remote-monitor/pull/4022/commits )

## New features
- Fully secure by default out of the box.  Unsecure access via http is not allowed anymore by default. This might force you to re-authenticate with your `API_SECRET` or token if you were using unsecure access. (@PieterGit )
- No outdated packages with vulnerabilities are being used anymore (@PieterGit ) 
- Add Week to Week report (@jpcunningh, #4123 ) 
- Add Loopalyzer report to analyse looping. Visualize your loop (@lixgbg, #3629 #4235 )
- Add predictions support to Day to Day report (@lixgbg, #3179 )
- Add cgm sensor stop to Careportal (@jpcunningh, #4060)

## Removed features
- remove `mqtt` module, because it had a security issue and was not used
- remove `sgvdata`  module, because it had a security issue, added a lot of complexity and wasn't needed (@PieterGit ). Replacement implementation for CSV and TSV export (@sulkaharo ).

## Improvements
- Fix MongoDB database insert handling. Log error on inserts and don't crash in case the MongoDB disk is full or MongoDB quota is reached (@sulkaharo and @jpcunningh)
- Upgrade packages to recent version, fixing all known security issues with dependencies (@PieterGit)
- Redirect redirect HTTP to HTTPS and implement HSTS (@jweismann, @PieterGit, #4044 and #4010	and #4253 )
- Technical improvement: Migrate from `uglify-js` to `terser-webpack-plugin` (@PieterGit)
- Streamlined Heroku deployment template with more descriptive text and more appropriate defaults for new users (@unsoluble, #4116 )

## Bug fixes
- Fix CGM voltageb battery warning level to match xDrip+ (@jpcunningh, #3954 )
- Fix daylight saving and reloading bug in profile editor, (@DigitalDan1, @Kywalh #4029 and #4074 )
- Reduce the amount of Profile Switch treatments being loaded to fix UI slowdown and Nightscout home screen losing AAPS data from >3 hours ago, (@sulkaharo, @vickster1, #4055 )
- Upgrade to [share2nightscout 0.2.0](https://github.com/nightscout/share2nightscout-bridge/releases/tag/0.2.0). Prevent Nightscout server crashes in case Dexcom server does not respond (@PieterGit, @veryfancy)
- Fix UI so pills are updated immediately after new data is loaded (@sulkaharo)
- Fixes to If-Modified-Since HTTP header handling for BG data (@sulkaharo)

## Documentation and language updates
- Language updates for Danish, Dutch, German, Hebrew, Norwegian, Russian 
- New languages: Japanese, Turkish
- Update Alexa documentation. Note that some Alexa improvements are postponed to Nightscout 0.12 because the Alexa plugin needs refactoring, see #4168 (comment)
- Update IFTTT maker-setup.md docs (@Dave9111, @unsoluble, #4206 )
- Updated various docs, including [CONTRIBUTING](https://github.com/nightscout/cgm-remote-monitor/blob/dev/CONTRIBUTING.md) documentation

# Upgrade notes
- We only allow Nightscout to start with a secure Node JS. 
  - Latest Node 8 LTS (8.15.0 or later) and Latest Node 10 LTS (10.15.1 or later) are recommended and supported. 
  - Latest Node version on Azure (currently 10.14.0) is tolerated, but not recommended
  - Other versions will not start 
- The [rawbg](https://github.com/nightscout/cgm-remote-monitor#rawbg-raw-bg) settings are converted to a single setting tri-state variable.
- We improved security and added several new environment variables such as [INSECURE_USE_HTTP and SECURE_HSTS_HEADER](https://github.com/nightscout/cgm-remote-monitor/#predefined-values-for-your-server-settings-optional)
  - Your site redirects to https by default. If you don't want that or use a Nginx or Apache proxy, set `INSECURE_USE_HTTP` to `true`.
  - We enabled [HTTP Strict Transport Security (HSTS)](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) headers by default, settings `SECURE_HSTS_HEADER` and `SECURE_HSTS_HEADER_*`

## Upgrade notes for Azure users

We recommend Azure users consider migrating their hosting to Heroku, as we've observed Heroku users have significantly less issues with having their sites work reliably. If you want to continue using Azure, change the following configuration variables in Azure before updating to the latest Nightscout version:
```
WEBSITE_NODE_DEFAULT_VERSION=10.14.1
SCM_COMMAND_IDLE_TIMEOUT=300
```

# Install instructions

Install instructions can be found: https://github.com/nightscout/cgm-remote-monitor/blob/master/README.md#install

# Contributors to this release

The release coordination for this release was done by @PieterGit 
We would like to thank the following people for their contribution (in alphabetical order):
@anderser, @apanasef, @balshor, @bewest, @blocklist_twitter, @CaroGo, @cascer1, @cluckj, @danamlewis, @Dave9111, @diabetlum, @herzogmedia, @janrpn, @jasoncalabrese, @jpcunningh, @jweismann, @kenstack, @Kywalh, @lixgbg, @LuminaryXion, @MilosKozak, @mitrei, @PaperT1D, @PieterGit, @unsoluble, @rarneson, @renegadeandy, @scottleibrand, @sulkaharo, @T-o-b-i-a-s, @tynbendad, @unsoluble, @veryfancy, @viq, @wootmasterslick

(if I forgot somebody, please respond)

# TODO

TODO: Translations, Languages with less than 80% will be removed in a future Nightscout version. Currently the following languages are at risk: 
中文(繁體) (zh_tw), Hrvatski (hr), Ελληνικά (el), 한국어 (ko)
See https://gitter.im/nightscout/public?at=5bef2f34de42d46bba766f66

TODO: Fix Codacy errors, https://app.codacy.com/app/Nightscout/cgm-remote-monitor/issues?bid=2452379&filters=W3siaWQiOiJDYXRlZ29yeSIsInZhbHVlcyI6WyJFcnJvciBQcm9uZSJdfV0=

TODO: test dev after all new features are merged for at least two weeks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants