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

Add .pre-commit-config.yaml #67

Merged
merged 15 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion docs/user_guide/physio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
The ``Physio`` data object
--------------------------

The primary funtionality of :py:mod:`peakdet` relies on its operations being
The primary functionality of :py:mod:`peakdet` relies on its operations being
performed on physiological data loaded into a :py:class:`peakdet.Physio`
object. So, before we get into using :py:mod:`peakdet`, its best to understand
a little bit about this helper class!
Expand Down
12 changes: 9 additions & 3 deletions peakdet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@
from peakdet.analytics import HRV
from peakdet.external import load_rtpeaks
from peakdet.io import load_history, load_physio, save_history, save_physio
from peakdet.operations import (delete_peaks, edit_physio, filter_physio,
interpolate_physio, peakfind_physio,
plot_physio, reject_peaks)
from peakdet.operations import (
delete_peaks,
edit_physio,
filter_physio,
interpolate_physio,
peakfind_physio,
plot_physio,
reject_peaks,
)
from peakdet.physio import Physio

from ._version import get_versions
Expand Down
2 changes: 1 addition & 1 deletion peakdet/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
# TAG-NUM-gHEX
mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe)
if not mo:
# unparseable. Maybe git-describe is misbehaving?
# unparsable. Maybe git-describe is misbehaving?
pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out
return pieces

Expand Down
4 changes: 2 additions & 2 deletions peakdet/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def interpolate_physio(data, target_fs, *, kind="cubic"):
@utils.make_operation()
def peakfind_physio(data, *, thresh=0.2, dist=None):
"""
Performs peak and trough detection on `data`
Performs peak and through detection on `data`

Parameters
----------
Expand Down Expand Up @@ -139,7 +139,7 @@ def peakfind_physio(data, *, thresh=0.2, dist=None):
heights = np.percentile(heights["peak_heights"], 1)
locs, heights = signal.find_peaks(data[:], distance=cdist, height=heights)
data._metadata["peaks"] = locs
# perform trough detection based on detected peaks
# perform through detection based on detected peaks
maestroque marked this conversation as resolved.
Show resolved Hide resolved
data._metadata["troughs"] = utils.check_troughs(data, data.peaks)

return data
Expand Down
2 changes: 1 addition & 1 deletion peakdet/physio.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
Helper class for holding physiological data and associated metadata inforamtion
Helper class for holding physiological data and associated metadata information
"""

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion peakdet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def check_troughs(data, peaks, troughs=None):
Returns
-------
troughs : np.ndarray
Indices of trough locations in `data`, dependent on `peaks`
Indices of through locations in `data`, dependent on `peaks`
"""
# If there's a through after all peaks, keep it.
if troughs is not None and troughs[-1] > peaks[-1]:
Expand Down