Skip to content

Commit

Permalink
[MNT] update pre commit hook versions and corresponding changes (skti…
Browse files Browse the repository at this point in the history
…me#4680)

Closes sktime#4676.

What this PR does:

1. Update hook versions.
2. Apply code formatting changes identified by `black`. (affected ~140
files)
3. Apply docstring length/style changes identified by
`flake8`+`pydocstyle`. (affected ~180 files)

Notes for reviewers:

* For the 3rd point above, used `docformatter` locally to automate few
docstring changes, and these are part of
d736b66.
* In few places where it was unable to solve the issues (mostly `D205`
and `D400`), used my own judgement to modify docstrings slightly to
avoid lint failures. These possibly biased changes are part of
ae526ad, and should be reviewed
carefully.
  • Loading branch information
yarnabrina authored and CTFallon committed Jun 21, 2023
1 parent a24131a commit 0b181d9
Show file tree
Hide file tree
Showing 307 changed files with 1,390 additions and 1,936 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.4.0
hooks:
- id: check-added-large-files
args: ["--maxkb=1000"]
Expand All @@ -22,27 +22,27 @@ repos:
name: isort

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.3.0
hooks:
- id: black
language_version: python3
# args: [--line-length 79]

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
exclude: docs/conf.py
additional_dependencies: [flake8-bugbear, flake8-print]

- repo: https://github.com/mgedmin/check-manifest
rev: "0.47"
rev: "0.49"
hooks:
- id: check-manifest
stages: [manual]

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.2.2
rev: 1.7.0
hooks:
- id: nbqa-black
args: [--nbqa-mutate, --nbqa-dont-skip-bad-cells]
Expand All @@ -55,15 +55,15 @@ repos:
additional_dependencies: [flake8==3.8.3]

- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
rev: 6.3.0
hooks:
- id: pydocstyle
args: ["--config=setup.cfg"]

# We use the Python version instead of the original version which seems to require Docker
# https://github.com/koalaman/shellcheck-precommit
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
rev: v0.9.0.5
hooks:
- id: shellcheck
name: shellcheck
1 change: 0 additions & 1 deletion build_tools/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def render_changelog(prs, assigned): # noqa


if __name__ == "__main__":

categories = [
{"title": "Enhancements", "labels": ["feature", "enhancement"]},
{"title": "Fixes", "labels": ["bug", "fix", "bugfix"]},
Expand Down
3 changes: 1 addition & 2 deletions build_tools/make_release.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""
Do-nothing script for making a release.
"""Do-nothing script for making a release.
This idea comes from here:
- https://blog.danslimmon.com/2019/07/15/do-nothing-scripting-the-key-to
Expand Down
2 changes: 1 addition & 1 deletion docs/source/about/citation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
If you use sktime in a scientific publication, we would appreciate
citations to the following papers:

* [Markus Löning, Anthony Bagnall, Sajaysurya Ganesh, Viktor Kazakov, Jason Lines, Franz Király (2019): sktime: A Unified Interface for Machine Learning with Time Series](http://learningsys.org/neurips19/assets/papers/sktime_ml_systems_neurips2019.pdf)
* [Markus Löning, Anthony Bagnall, Sajaysurya Ganesh, Viktor Kazakov, Jason Lines, Franz Király (2019): "sktime: A Unified Interface for Machine Learning with Time Series"](http://learningsys.org/neurips19/assets/papers/sktime_ml_systems_neurips2019.pdf)
* [Markus Löning, Tony Bagnall, Sajaysurya Ganesh, George Oastler, Jason Lines, ViktorKaz, …, Aadesh Deshmukh (2020). sktime/sktime. Zenodo. http://doi.org/10.5281/zenodo.3749000](http://doi.org/10.5281/zenodo.3749000)
2 changes: 1 addition & 1 deletion docs/source/about/funding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ of the initial development under the UKRI Strategic Priorities Fund
Systems <https://www.turing.ac.uk/events/tools-practices-and-systems-data-science-and-artificial-intelligence-scoping-workshop>`__
theme within that grant.

Markus Lönings contributions between 2019 and 2021 were supported by:
Markus Löning's contributions between 2019 and 2021 were supported by:

* the `UK Economic and Social Research Council (ESRC) <https://esrc.ukri.org>`_,
* the `Consumer Data Research Centre (CDRC) <https://www.cdrc.ac.uk>`_,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/about/showcase.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Community Showcase
- Gives insights on importance of skime over scikit-learn, Proper Data Model for Time Series, and Highlights on unique features of sktime like sktime API, Code Examples of Time Series Models
- :user:`Alexandra Amidon <lynnssi>`
* - `Why start using sktime for forecasting? <https://medium.com/@jlenczuk/why-start-using-sktime-for-forecasting-8d6881c0a518>`_
- Overview of sktimes features that distinguish it from other forecasting frameworks
- Overview of sktime's features that distinguish it from other forecasting frameworks
- :user:`Joanna Lenczuk <joanlenczuk>`
* - `Time Series Analysis with sktime on AWS SageMaker <https://datachef.co/blog/time-series-analysis-sktime-sagemaker/>`_
- This guide explains the procedure of using sktime as a toolbox for time series analysis on the AWS SageMaker environment.
Expand Down
4 changes: 1 addition & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""Configuration file for the Sphinx documentation builder."""

import os
Expand Down Expand Up @@ -305,8 +304,7 @@ def _make_estimator_overview(app):
from sktime.registry import all_estimators

def _process_author_info(author_info):
"""
Process author information from source code files.
"""Process author information from source code files.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/enhancement_proposals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Description
An sktime enhancement proposal (STEP) is a software design document providing information to the sktime community.
The proposal should provide a rationale and concise technical specification of proposed design.

We collect and discuss proposals in sktimes STEP `repository`_.
We collect and discuss proposals in sktime's STEP `repository`_.

.. _repository: https://github.com/sktime/enhancement-proposals

Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/reporting_bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ rules before submitting:

.. note::

To find out more about how to take part in sktimes community, check out our `governance
To find out more about how to take part in sktime's community, check out our `governance
guidelines <https://www.sktime.net/en/latest/governance.html>`__.
6 changes: 3 additions & 3 deletions docs/source/developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ New developers should:

Further special topics are listed below.

sktime follows `scikit-learn <https://scikit-learn.org/stable/>`_\ s API whenever possible.
If youre new to scikit-learn, take a look at their `getting-started guide <https://scikit-learn.org/stable/getting_started.html>`_.
If youre already familiar with scikit-learn, you may still learn something new from their `developers guide <https://scikit-learn.org/stable/developers/index.html>`_.
sktime follows `scikit-learn <https://scikit-learn.org/stable/>`_\ 's API whenever possible.
If you're new to scikit-learn, take a look at their `getting-started guide <https://scikit-learn.org/stable/getting_started.html>`_.
If you're already familiar with scikit-learn, you may still learn something new from their `developers' guide <https://scikit-learn.org/stable/developers/index.html>`_.

.. toctree::
:maxdepth: 1
Expand Down
6 changes: 3 additions & 3 deletions docs/source/developer_guide/coding_standards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Additional configurations can be found in
- Avoid multiple statements on one line. Prefer a line return after a
control flow statement (``if``/``for``).
- Use absolute imports for references inside sktime.
- Dont use ``import *`` in the source code. It is considered
- Don't use ``import *`` in the source code. It is considered
harmful by the official Python recommendations. It makes the code
harder to read as the origin of symbols is no longer explicitly
referenced, but most important, it prevents using a static analysis
Expand Down Expand Up @@ -110,8 +110,8 @@ API design
============

The general design approach of sktime is described in the
paper `Designing Machine Learning Toolboxes: Concepts, Principles and
Patterns <https://arxiv.org/abs/2101.04938>`__.
paper `"Designing Machine Learning Toolboxes: Concepts, Principles and
Patterns" <https://arxiv.org/abs/2101.04938>`__.

.. note::

Expand Down
2 changes: 1 addition & 1 deletion docs/source/developer_guide/git_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Git and GitHub workflow
=======================

The preferred workflow for contributing to sktimes repository is to
The preferred workflow for contributing to sktime's repository is to
fork the `main
repository <https://github.com/sktime/sktime/>`__ on
GitHub, clone, and develop on a new branch.
Expand Down
6 changes: 3 additions & 3 deletions docs/source/get_involved/code_of_conduct.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ hope you will consider to be appropriate community guidelines:
unsure whether your behaviour towards another person is welcome, ask
them. If someone tells you to stop, do so.
- **Respect the privacy and safety of others**. Do not take photographs
of others without their permission. Do not share other participants
of others without their permission. Do not share other participant's
personal experiences without their express permission. Note that
posting (or threatening to post) personally identifying information
of others without their consent ("doxing") is a form of harassment.
- **Be considerate of others participation**. Everyone should have an
- **Be considerate of others' participation**. Everyone should have an
opportunity to be heard. In update sessions, please keep comments
succinct so as to allow maximum engagement by all participants. Do
not interrupt others on the basis of disagreement; hold such comments
Expand All @@ -135,7 +135,7 @@ hope you will consider to be appropriate community guidelines:
crucial for fairness and diversity of our community, as well as its scientific quality.
Free speech and constant scrutiny directed at those in power is also essential to ensure
accountability and fair operations of our community, and to prevent groupthink or in-group dynamics.
- **Dont be a bystander**. If you see something inappropriate
- **Don't be a bystander**. If you see something inappropriate
happening, speak up. If you don't feel comfortable intervening but
feel someone should, please feel free to ask a member of the Code of
Conduct response team for support.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/get_involved/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Recommended steps for first time contributors, or to get started with regular co
1. Say hello (in the lobby on `Discord`_)!
2. Get set up for development, see `instructions in the developer guide <https://www.sktime.net/en/stable/developer_guide.html>`_.
3. Pick a good first issue to work on, see a collection `in this summary issue <https://github.com/sktime/sktime/issues/1147>`_ , or from `this list <https://github.com/sktime/sktime/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22>`_
suggestion: pick something small with simple content to learn the process
suggestion: pick something small with simple content to learn the "process"
4. Feel free to attend the regular community collab sessions or one of the topic specific stand-ups and tech sessions (see schedule on `Discord`_)
5. Once your first PR is merged and youve seen how things work, you could consider contributing more regularly: optionally, continue attending the Friday community collaboration sessions and stand-ups; or, optionally, `apply for mentoring <https://www.sktime.net/en/stable/get_involved/mentoring.html#mentoring>`_
5. Once your first PR is merged and you've seen how things work, you could consider contributing more regularly: optionally, continue attending the Friday community collaboration sessions and stand-ups; or, optionally, `apply for mentoring <https://www.sktime.net/en/stable/get_involved/mentoring.html#mentoring>`_

.. _Discord: https://discord.com/invite/54ACzaFsn7

Expand Down
28 changes: 14 additions & 14 deletions docs/source/get_involved/governance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Rights and responsibilities
* - Right/responsibility
- Description
* - Direct access
- Being a core developer allows contributors to more easily carry on with their project related activities by giving them direct access to the projects repository.
- Being a core developer allows contributors to more easily carry on with their project related activities by giving them direct access to the project's repository.
* - Issue/PR management
- Core developers are responsible for reviewing and managing issues and pull requests. This includes commenting on issues, reviewing code contributions, merging approved pull requests, and closing issues once resolved.
* - Decision making
Expand All @@ -228,7 +228,7 @@ they have been nominated, there will be a vote by the current core
developers.

Voting on appointments is one of the few activities that takes
place on the projects private communication channels. The vote will be
place on the project's private communication channels. The vote will be
anonymous.

While it is expected that most votes will be unanimous, a 2/3 majority of
Expand Down Expand Up @@ -438,11 +438,11 @@ used by the sktime project. We clarify:
* how decisions are made, and
* who participates in the decision making.

sktimes decision-making process is designed to take into account
sktime's decision-making process is designed to take into account
feedback from all community members and strives to find consensus, while
avoiding deadlocks when no consensus can be found.

All discussion and votes takes place on the projects `issue
All discussion and votes takes place on the project's `issue
tracker <https://github.com/sktime/sktime/issues>`__,
`pull requests <https://github.com/sktime/sktime/pulls>`__ or an :ref:`steps`. Some
sensitive discussions and appointment votes occur on private chats.
Expand Down Expand Up @@ -475,7 +475,7 @@ corresponding decision making process is described in more detail below.
Stage 1: lazy consensus with veto right
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sktime uses a consensus seeking process for making decisions. The
sktime uses a "consensus seeking" process for making decisions. The
community tries to find a resolution that has no open objections among
core developers.

Expand Down Expand Up @@ -573,7 +573,7 @@ comparison with alternative solutions, as outlined in our
A complete STEP must always include at least a high-level design for the proposed change,
not just a wishlist of features.

Usually, we collect and discuss proposals in sktimes `repository for
Usually, we collect and discuss proposals in sktime's `repository for
enhancement-proposals <https://github.com/sktime/enhancement-proposals>`__.

For smaller changes, such as punctual changes to the API or governance documents,
Expand Down Expand Up @@ -632,7 +632,7 @@ If algorithms require major dependencies, we encourage to create a
separate companion repository. For smaller
dependencies which are limited to a few files, we encourage to use soft
dependencies, which are only required for particular modules, but not
for most of sktimes functionality and not for installing sktime.
for most of sktime's functionality and not for installing sktime.

.. _acknowledging-contributions:

Expand All @@ -644,11 +644,11 @@ developers, users, educators, and other stakeholders. We value all kinds
of contributions and are committed to recognising each of them fairly.

We follow the `all-contributors <https://allcontributors.org>`__
specification to recognise all contributors, including those that dont
specification to recognise all contributors, including those that don't
contribute code. Please see `our list of all
contributors <https://github.com/sktime/sktime/blob/main/CONTRIBUTORS.md>`__.

If you think, weve missed anything, please let us know or open a PR
If you think, we've missed anything, please let us know or open a PR
with the appropriate changes to
`sktime/.all-contributorsrc <https://github.com/sktime/sktime/blob/main/.all-contributorsrc>`__.

Expand All @@ -659,7 +659,7 @@ All contributors acknowledge that they have all the rights to the code
they contribute to make it available under this license.

The project belongs to the sktime community, and all parts of it are
always considered work in progress so that they can evolve over time
always considered "work in progress" so that they can evolve over time
with newer contributions.

.. _outlook:
Expand All @@ -668,7 +668,7 @@ Outlook
-------

We are open to improvement suggestions for our governance model. Once
the community grows more and sktimes code base becomes more
the community grows more and sktime's code base becomes more
consolidated, we will consider the following changes:

- Allow for more time to discuss changes, and more time to cast vote
Expand All @@ -681,17 +681,17 @@ In addition, we plan to add more roles for managing/coordinating
specific project:

* Community manager (mentorship, outreach, social media, etc),
* Sub-councils for project-specific technical leadership (e.g.  for documentation, learning tasks, continuous integration)
* Sub-councils for project-specific technical leadership (e.g. for documentation, learning tasks, continuous integration)

.. _references:

References
----------

Our governance model is inspired by various existing governance
structures. In particular, wed like to acknowledge:
structures. In particular, we'd like to acknowledge:

* scikit-learns `governance model <https://www.sktime.net/en/latest/governance.html>`__
* scikit-learn's `governance model <https://www.sktime.net/en/latest/governance.html>`__
* `The Turing Way <https://github.com/alan-turing-institute/the-turing-way>`__ project
* `The Art of Community <https://www.jonobacon.com/books/artofcommunity/>`__ by Jono Bacon
* The `astropy <https://www.astropy.org>`__ project
Expand Down
2 changes: 1 addition & 1 deletion docs/source/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ sktime.

Tabular
Is a setting where each :term:`timepoint` of the :term:`univariate time series` being measured for each instance are treated as features and
stored as a primitive data type in the DataFrames cells. E.g., there are N :term:`instances <instance>` of time series and each has T
stored as a primitive data type in the DataFrame's cells. E.g., there are N :term:`instances <instance>` of time series and each has T
:term:`timepoints <timepoint>`, this would yield a pandas DataFrame with shape (N, T): N rows, T columns.

Framework
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To run the user guide notebooks interactively, you can
`launch them on binder <https://mybinder.org/v2/gh/sktime/sktime/main?filepath=examples>`_
without having to install anything.

We assume basic familiarity with `scikit-learn`_. If you havent worked with scikit-learn before, check out their
We assume basic familiarity with `scikit-learn`_. If you haven't worked with scikit-learn before, check out their
`getting-started guide`_.

The notebook files can be found `here <https://github.com/sktime/sktime/blob/main/examples>`_.
Expand Down
4 changes: 2 additions & 2 deletions examples/feature_extraction_with_tsfresh.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
}
],
"source": [
"#  binary classification task\n",
"# binary classification task\n",
"np.unique(y_train)"
]
},
Expand Down Expand Up @@ -936,7 +936,7 @@
}
],
"source": [
"#  multivariate input data\n",
"# multivariate input data\n",
"X_train.head()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/minirocket.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@
"\n",
"\n",
"### 4.1 Load japanese_vowels as unequal length dataset\n",
"Japanese vowels is a a UCI Archive dataset. 9 Japanese-male speakers were recorded saying the vowels ‘a’ and ‘e’. \n",
"Japanese vowels is a a UCI Archive dataset. 9 Japanese-male speakers were recorded saying the vowels 'a' and 'e'. \n",
"The raw recordings are preprocessed to get a 12-dimensional (multivariate) classification probem. The series lengths are between 7 and 29. "
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/plateau_finder.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
}
],
"source": [
"#  find plateaus\n",
"# find plateaus\n",
"t = PlateauFinder()\n",
"Xt = t.fit_transform(X)\n",
"Xt"
Expand Down
2 changes: 1 addition & 1 deletion examples/segmentation_with_clasp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
"source": [
"# ClaSP - Window Size Selection\n",
"\n",
"ClaSP takes the window size 𝑤 as a hyper-parameter. This parameter has data-dependent effects on ClaSPs performance. When chosen too small, all windows tend to appear similar; when chosen too large, windows have a higher chance to overlap adjacent segments, blurring their discriminative power. \n",
"ClaSP takes the window size 𝑤 as a hyper-parameter. This parameter has data-dependent effects on ClaSP's performance. When chosen too small, all windows tend to appear similar; when chosen too large, windows have a higher chance to overlap adjacent segments, blurring their discriminative power. \n",
"\n",
"A simple, yet effective method for choosing the window size is the dominant frequency of the Fourier Transform."
]
Expand Down
Loading

0 comments on commit 0b181d9

Please sign in to comment.