Skip to content

Commit

Permalink
Merge pull request #7 from Saskia-K/master
Browse files Browse the repository at this point in the history
SignalEntry with csv file + refactorings + deprecations
  • Loading branch information
Saskia-K authored Oct 13, 2023
2 parents 6c22c5e + 62ce756 commit 8a0a42b
Show file tree
Hide file tree
Showing 12 changed files with 963 additions and 804 deletions.
1 change: 0 additions & 1 deletion .coverage

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8, 3.9, 3.11]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests with Python versions 3.8 and 3.11

name: Testing

on:
[push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest coverage # flake8
pip install -r test-requirements.txt
pip install -r requirements.txt
- name: Test with pytest
run: |
coverage run -m pytest
coverage report -m --skip-covered --include=./unisens/* --precision=2
- name: Test with unittest
run: |
coverage run -m unittest discover -p '*_test.py'
coverage report -m --skip-covered --include=./unisens/* --precision=2
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ target/
profile_default/
ipython_config.py

# IntelliJ IDEA
.idea/
*.pyc

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
Expand Down Expand Up @@ -133,6 +137,8 @@ dmypy.json

# pytype static type analyzer
.pytype/
/test/Example_001/test.xml
/test/Example_002/test.xml
/test/Example_003/test.xml
/test/Example_001/
/test/Example_002/
/test/Example_003/

*tmp/
4 changes: 2 additions & 2 deletions API-OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ u = unisens.Unisens('c:/unisens', makenew=True, autosave=True, readonly=False)

## SignalEntry

SignalEntries can be used to store continuous numeric data with high frequency, e.g. ECG signals. They are saved in binary format. It is possible to save multiple channels. Things like sample frequency and other meta information can be saved in them as well. Data must be of size `[1, N]`.
SignalEntries can be used to store continuous numeric data with high frequency, e.g. ECG signals. They are saved in binary or csv format. It is possible to save multiple channels. Things like sample frequency and other meta information can be saved in them as well. Data must be of size `[1, N]`.

```Python
from unisens import Unisens, SignalEntry
Expand All @@ -143,7 +143,7 @@ u.save()
```

## ValuesEntry
`ValuesEntry` is used for low-frequency continuously sampled data, e.g. Temperature or RR intervals. It is basically equivalent to `SignalEntry` except that it saves data in CSV (text) format, and not binary. Data must be of size `[1, N]`.
`ValuesEntry` is used for low-frequency continuously sampled data, e.g. Temperature or RR intervals. It is basically equivalent to `SignalEntry` except that it saves data in CSV (text) format, and not binary. Data must be of size `[N, 1]`, i.e. column-wise, with indices in the first column. The integer indices are matched with the sample rate and the unisens timestamp start to display correctly in the Un isensViewer.

```Python
from unisens import Unisens, ValuesEntry
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(name='pyunisens',
python_requires='>=3.6',
version='1.03',
version='1.5.0',
description='A python implementation of the Unisens standard',
url='http://github.com/Unisens/pyUnisens',
author='skjerns',
Expand Down
Empty file added test/__init__.py
Empty file.
Loading

0 comments on commit 8a0a42b

Please sign in to comment.