Skip to content

Commit

Permalink
Merge pull request #67 from maestroque/add-pre-commit
Browse files Browse the repository at this point in the history
Add .pre-commit-config.yaml
  • Loading branch information
smoia authored Jun 6, 2024
2 parents f25c645 + 945267f commit be45064
Show file tree
Hide file tree
Showing 33 changed files with 1,065 additions and 740 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_BUGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ assignees:

## Specifications
<!--- Point out the version of peakdet you are running and your OS version -->
- Python version:
- phys2bids version:
- Python version:
- peakdet version:
- Platform:

## Possible solution
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_DISCUSSION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Discussion
about: Use this template to start a discussion issue, i.e. an issue that
about: Use this template to start a discussion issue, i.e. an issue meant to open a community debate over a topic
title: ''
labels: Discussion
assignees: ''
Expand All @@ -22,6 +22,6 @@ I'm opening this discussion because/I think that/I noticed that...
<!--- Repeat the concept in a very few, short (max 3) questions -->
<!--- Remember that the aim is not to give a "tldr", but to help address salient points. -->

-
-
-
-
-
-
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_GENERAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ assignees: ''
## Next Steps
<!--- Provide possible steps to take in order to address the issue -->

*
*
*
*
*
*
13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE_MEETING.md

This file was deleted.

39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: ["-L", "trough,troughs"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
51 changes: 28 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys

import matplotlib as mpl
mpl.use('Agg')

mpl.use("Agg")

# -- Project information -----------------------------------------------------

# Add project name, copyright holder, and author(s)
project = 'peakdet'
copyright = '2018, peakdet developers'
author = 'Ross Markello'
project = "peakdet"
copyright = "2018, peakdet developers"
author = "Ross Markello"

# Import project to get version info
sys.path.insert(0, os.path.abspath(os.path.pardir))
import peakdet # noqa

# The short X.Y version
version = peakdet.__version__
# The full version, including alpha/beta/rc tags
Expand All @@ -34,14 +37,14 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
"matplotlib.sphinxext.plot_directive",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
]

# Generate the API documentation when building
Expand All @@ -50,13 +53,13 @@
autoclass_content = "class"

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -68,17 +71,18 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import sphinx_rtd_theme # noqa
html_theme = 'sphinx_rtd_theme'

html_theme = "sphinx_rtd_theme"
html_show_sourcelink = False

# Theme options are theme-specific and customize the look and feel of a theme
Expand All @@ -89,18 +93,18 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'peakdetdoc'
htmlhelp_basename = "peakdetdoc"

# -- Extension configuration -------------------------------------------------
intersphinx_mapping = {
'matplotlib': ('https://matplotlib.org', None),
'numpy': ('https://docs.scipy.org/doc/numpy', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
"matplotlib": ("https://matplotlib.org", None),
"numpy": ("https://docs.scipy.org/doc/numpy", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
}

doctest_global_setup = """
Expand All @@ -110,6 +114,7 @@
"""

from peakdet.tests.utils import get_test_data_path # noqa

plot_working_directory = get_test_data_path()
plot_include_source = True
plot_formats = [("png", 90)]
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
pandas
sphinx>=1.2
sphinx_rtd_theme

2 changes: 1 addition & 1 deletion docs/user_guide/loading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ with the built-in :py:mod:`peakdet` IO functions.

The :py:meth:`peakdet.load_physio` function is the most simple of these
functions, and accepts data stored as single-column text file. For example, if
we have a file `ECG.csv` that we might normally load with :py:mod:`numpy`:
we have a file ``ECG.csv`` that we might normally load with :py:mod:`numpy`:

.. doctest::

Expand Down
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
44 changes: 31 additions & 13 deletions peakdet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
__all__ = [
'delete_peaks', 'edit_physio', 'filter_physio', 'interpolate_physio',
'peakfind_physio', 'plot_physio', 'reject_peaks',
'load_physio', 'save_physio', 'load_history', 'save_history',
'load_rtpeaks', 'Physio', 'HRV', '__version__'
"delete_peaks",
"edit_physio",
"filter_physio",
"interpolate_physio",
"peakfind_physio",
"plot_physio",
"reject_peaks",
"load_physio",
"save_physio",
"load_history",
"save_history",
"load_rtpeaks",
"Physio",
"HRV",
"__version__",
]

from peakdet.analytics import (HRV)
from peakdet.external import (load_rtpeaks)
from peakdet.io import (load_physio, save_physio, load_history, save_history)
from peakdet.operations import (delete_peaks, edit_physio, filter_physio,
interpolate_physio, peakfind_physio,
plot_physio, reject_peaks)
from peakdet.physio import (Physio)
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.physio import Physio

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

__version__ = get_versions()["version"]
del get_versions
Loading

0 comments on commit be45064

Please sign in to comment.