Skip to content

Commit

Permalink
Merge pull request #54 from maestroque/integrate-physutils
Browse files Browse the repository at this point in the history
Integrate physutils - Physio object usage
  • Loading branch information
maestroque authored Aug 25, 2024
2 parents 2f0550b + 6266b6f commit 087bd4e
Show file tree
Hide file tree
Showing 14 changed files with 651 additions and 163 deletions.
14 changes: 14 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@
"review",
"userTesting"
]
},
{
"login": "maestroque",
"name": "George Kikas",
"avatar_url": "https://avatars.githubusercontent.com/u/74024609?v=4",
"profile": "https://github.com/maestroque",
"contributions": [
"code",
"ideas",
"infra",
"docs",
"bug",
"review"
]
}
],
"contributorsPerLine": 8,
Expand Down
28 changes: 14 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ orbs:
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
test37: # This is the name of the job, feel free to change it to better match what you're trying to do!
test39: # This is the name of the job, feel free to change it to better match what you're trying to do!
# These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/
# You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub
# A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python
# The executor is the environment in which the steps below will be executed - below will use a python 3.6.14 container
# Change the version below to your required version of python
docker:
- image: cimg/python:3.7
- image: cimg/python:3.9
working_directory: /tmp/src/phys2denoise
resource_class: medium
# Checkout the code as the first step. This is a dedicated CircleCI step.
Expand All @@ -46,7 +46,7 @@ jobs:
command: |
pytest --cov=./phys2denoise
mkdir /tmp/src/coverage
mv ./.coverage /tmp/src/coverage/.coverage.py37
mv ./.coverage /tmp/src/coverage/.coverage.py39
- store_artifacts:
path: /tmp/src/coverage
# Persist the specified paths (workspace/echo-output) into the workspace for use in downstream job.
Expand All @@ -56,11 +56,11 @@ jobs:
root: /tmp
# Must be relative path from root
paths:
- src/coverage/.coverage.py37
- src/coverage/.coverage.py39

test310:
test311:
docker:
- image: cimg/python:3.10
- image: cimg/python:3.11
working_directory: /tmp/src/phys2denoise
resource_class: medium
steps:
Expand All @@ -75,17 +75,17 @@ jobs:
command: |
pytest --cov=./phys2denoise
mkdir /tmp/src/coverage
mv ./.coverage /tmp/src/coverage/.coverage.py310
mv ./.coverage /tmp/src/coverage/.coverage.py311
- store_artifacts:
path: /tmp/src/coverage
- persist_to_workspace:
root: /tmp
paths:
- src/coverage/.coverage.py310
- src/coverage/.coverage.py311

style_check:
docker:
- image: cimg/python:3.7
- image: cimg/python:3.9
working_directory: /tmp/src/phys2denoise
resource_class: small
steps:
Expand All @@ -105,7 +105,7 @@ jobs:
merge_coverage:
working_directory: /tmp/src/phys2denoise
docker:
- image: cimg/python:3.10
- image: cimg/python:3.11
resource_class: small
steps:
- attach_workspace:
Expand Down Expand Up @@ -133,13 +133,13 @@ workflows:
# Inside the workflow, you define the jobs you want to run.
jobs:
- style_check
- test37:
- test39:
requires:
- style_check
- test310:
- test311:
requires:
- style_check
- merge_coverage:
requires:
- test37
- test310
- test39
- test311
8 changes: 6 additions & 2 deletions docs/user_guide/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ example shows how to compute the heart rate and the heart rate variability using
from phys2denoise.metrics.chest_belt import respiratory_variance_time
# Given that the respiratory signal is stored in `data`, the peaks in `peaks`, the troughs in `troughs`
# Given that the respiratory signal is stored in `data` (which is not a physio.Physio instance), the peaks in `peaks`, the troughs in `troughs`
# and the sample rate in `sample_rate`
_, rvt = respiratory_variance_time(data, peaks, troughs, sample_rate)
rvt = respiratory_variance_time(data, peaks, troughs, sample_rate)
The computed respiratory variance time is stored in the variable ``rvt``. An internal check is performed to verify if the input data is a Physio object or not
determining the appropriate output format. If the input is not a ``Physio`` object, the output will be a numpy array only containing the computed metric. Otherwise,
the output will be a tuple with the updated Physio object and the computed metric.
Loading

0 comments on commit 087bd4e

Please sign in to comment.