Skip to content

Python3 Update #32

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

dist: xenial
language: python
python:
- "2.7"
- "3.5" # Need to support debian stretch for edison 32-bit installs
install:
- pip install -e .
- sudo python setup.py install
script: make travis
- make ci-install
script:
- make test
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
TESTS = $(wildcard decocare/*.py decocare/*/*.py)
test:
python -m doctest -v ${TESTS}
python3 -m doctest -v ${TESTS}

install:
python setup.py develop
python3 setup.py develop
install decocare/etc/80-medtronic-carelink.rules /etc/udev/rules.d/
udevadm control --reload-rules

ci-install:
python setup.py develop
python3 -V
python3 setup.py develop

ci-test: ci-install test
# do the travis dance

docs:
(cd doc; make)
travis: test
# do the travis dance

.PHONY: test docs
16 changes: 8 additions & 8 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ This only needs to be done once:
```bash
$ easy_install decocare
# or
$ pip install decocare
$ pip3 install decocare
```

### From source
```bash
git clone https://github.com/bewest/decoding-carelink.git
cd decoding-carelink
sudo python ez_setup.py # only if you rarely use python
sudo python setup.py develop
sudo python3 ez_setup.py # only if you rarely use python
sudo python3 setup.py develop
```

### Contribute your logs
Expand Down Expand Up @@ -722,23 +722,23 @@ Each experiment is saved in the `./logs` directory, which is tracked by git.
Source a bunch of helper functions, notably:

##### `run_stick`_
Runs `python decocare/stick.py /dev/ttyUSB0`
Runs `python3 decocare/stick.py /dev/ttyUSB0`
and saves results in `logs/stick.log`.
When run by `status-quo.sh`, it creates
`./logs/baseline.stick.log` before continuing.
At end of experiments, it records `./logs/postmortem.stick.log`

##### `run_session`_
Runs `python decocare/session.py /dev/ttyUSB0 <SERIAL>`
Runs `python3 decocare/session.py /dev/ttyUSB0 <SERIAL>`
and saves results in `logs/session.log`.

##### `run_commands`_
Runs `python decocare/commands.py /dev/ttyUSB0 <SERIAL>`
Runs `python3 decocare/commands.py /dev/ttyUSB0 <SERIAL>`
and saves results in `logs/commands.log`.

##### `run_download`_

Runs `python decocare/download.py /dev/ttyUSB0 <SERIAL>`
Runs `python3 decocare/download.py /dev/ttyUSB0 <SERIAL>`
and saves results in `logs/download.log`.

The download script is configured to save each page of historical data as a raw
Expand All @@ -757,7 +757,7 @@ is saved in `./status-quo.log`.
#### `run_regress`
After `. bin/common`, `export SERIAL=511888` with your serial number.

Runs `python list_history.py` on each binary file found in `logs/`, saves
Runs `python3 list_history.py` on each binary file found in `logs/`, saves
results in `./analysis/<SERIAL>/...`.

This is what I use to render the markdown files in analysis.
Expand Down
23 changes: 12 additions & 11 deletions analysis/experiments/basal-hist-2006/munge.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/python

import sys


def main(ifile, ofile):
B = ifile.read( )
end = len(B)
cur = 0
while cur < end:
ofile.write(B[cur+2:cur+10])
cur += 10
B = ifile.read()
end = len(B)
cur = 0
while cur < end:
ofile.write(B[cur + 2 : cur + 10])
cur += 10


if __name__ == '__main__':
ifile = open(sys.argv[1], 'r', 10)
ofile = open(sys.argv[2], 'w')
main(ifile, ofile)
if __name__ == "__main__":
ifile = open(sys.argv[1], 10)
ofile = open(sys.argv[2], "w")
main(ifile, ofile)

#####
# EOF
Loading