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

Merge additional pydocstyle error fixes into development docs #1208

Merged
merged 51 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c4cf883
Fix _fh.py docstrings
RNKuhns Jul 18, 2021
0c1148c
Remove __init_ from class_with_call doc template
RNKuhns Jul 23, 2021
88bc778
Update api reference files .rst files
RNKuhns Jul 23, 2021
1a5a084
Tweak docstrings
RNKuhns Jul 23, 2021
fcb049d
more pydocstyle docs fixes
RNKuhns Jul 24, 2021
1bc1371
Merge branch 'update_docs' into fix_docs
RNKuhns Jul 24, 2021
d4b92a0
Update doc python object templates
RNKuhns Jul 24, 2021
caf6ff4
Switch to numpydoc extension and pydata theme
RNKuhns Jul 24, 2021
b139b08
Merge branch 'fix_docs' of https://github.com/RNKuhns/sktime into fix…
RNKuhns Jul 24, 2021
016aeb6
Update doc requirements
RNKuhns Jul 24, 2021
3b8e203
Remove autosummary
RNKuhns Jul 24, 2021
8cc66c0
Change docstring example to examples
RNKuhns Jul 24, 2021
8cb6cbf
Classification doc tweaks
RNKuhns Jul 24, 2021
f8f17a2
Series transformer docstring tweaks
RNKuhns Jul 24, 2021
d40217b
Change State docstring heading moved to notes
RNKuhns Jul 24, 2021
aa7a74a
Annotation docstring tweaks
RNKuhns Jul 24, 2021
a98e8c3
Tweak dataset docstrings
RNKuhns Jul 24, 2021
cf2b3e3
Additional docstring tweak
RNKuhns Jul 24, 2021
ab5f5c8
add twitter and discord icons
mloning Jul 25, 2021
3b27bb5
add edit-this-page button
mloning Jul 25, 2021
9f4f587
remove estimator from init
mloning Jul 25, 2021
61eedf4
More docstring tweaks based on numpydoc warnings
RNKuhns Jul 25, 2021
bbcff93
Merge branch 'fix_docs' of https://github.com/RNKuhns/sktime into fix…
RNKuhns Jul 25, 2021
795f53b
More numpydoc warning fixes
RNKuhns Jul 25, 2021
4dbc909
Add validation checks when building docs with numpydoc
RNKuhns Jul 25, 2021
bb9e141
Restructuring content
mloning Jul 25, 2021
b2163b8
remove estimator table since it's auto-generated
mloning Jul 25, 2021
dc4352a
Merge branch 'fix_docs' of https://github.com/RNKuhns/sktime into fix…
mloning Jul 25, 2021
12ea108
Add getting started doc page
RNKuhns Jul 25, 2021
979deac
Fix annotation pydocstyle errors
RNKuhns Jul 26, 2021
6ffb33f
Add module docstring in _meta.py
RNKuhns Jul 26, 2021
ce4b176
Fix pydocstyle errors in _rise.py
RNKuhns Jul 26, 2021
eb1f754
Fix pydocstyle errors in datasets
RNKuhns Jul 26, 2021
e82cca6
Fix pydocstyle error in regression/__init__.py
RNKuhns Jul 26, 2021
ef5caef
Fix pydocstyle errors in regression module
RNKuhns Jul 26, 2021
1777f7d
Fix pydocstyle errors in registry
RNKuhns Jul 26, 2021
6d69875
Fix pydocstyle errors in performance_metrics
RNKuhns Jul 26, 2021
efe6e10
Fix series_as_features ensemble pydocstyle errors
RNKuhns Jul 26, 2021
37cff90
Fix pydocstyle errors in forecasting base
RNKuhns Jul 26, 2021
88abca0
Tweak language in performance_metrics docs
RNKuhns Jul 26, 2021
dd908fb
Merge branch 'fix_docs' into forecasting_docstrings
RNKuhns Jul 26, 2021
ab3af32
Merge pull request #4 from RNKuhns/forecasting_docstrings
RNKuhns Jul 26, 2021
b0732d2
More pydocstyle error fixes in forecasting module
RNKuhns Jul 26, 2021
cee41cd
Still more pydocstyle error fixes in forecasting
RNKuhns Jul 26, 2021
e0272fa
Fix pydocstyle errors in forecasting model_evaluation
RNKuhns Jul 26, 2021
7810a09
Forecasting adapter pydocstyle error fixes
RNKuhns Jul 26, 2021
5fd7f69
Merge branch with pydocstyle error fixes
RNKuhns Jul 26, 2021
3581d14
Streamline getting started and fix code blocks
RNKuhns Jul 26, 2021
253a8d9
Add autodoc option to order members by source code
RNKuhns Jul 26, 2021
11c0cd4
Update quickstart
RNKuhns Jul 26, 2021
cca38a9
Merge branch 'docs-dev' into docs-dev
mloning Jul 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source/api_reference/performance_metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Forecasting

.. currentmodule:: sktime.performance_metrics.forecasting

Tunable Classes
~~~~~~~~~~~~~~~
Classes
~~~~~~~

.. autosummary::
:toctree: modules/auto_generated/
Expand Down
12 changes: 11 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,17 @@

# generate autosummary even if no references
autosummary_generate = True
autodoc_default_options = {"members": True, "inherited-members": True}

# members and inherited-members default to showing methods/attributes, etc
# from a class that are created in the class or inherited
# member-order says to order the documentation in the order the members
# were defined in the source code
autodoc_default_options = {
"members": True,
"inherited-members": True,
"member-order": "bysource",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is nice! so we should make sure fit, predict, transform and update are at the top in the code, right?

}

# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = False

Expand Down
14 changes: 14 additions & 0 deletions docs/source/get_involved.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _get_involved:

Get involved
============

.. toctree::
:maxdepth: 1

contributing
developer_guide
mentoring
roadmap
code_of_conduct
governance
72 changes: 36 additions & 36 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ Installation
* environments with python version 3.6, 3.7, or 3.8.
* operating systems Mac OS X, Unix-like OS, Windows 8.1 and higher

We appreciate community contributions towards compatibility with python 3.9, or other operating systems.

``sktime`` releases are available via ``PyPI`` and ``conda`` .

``sktime`` releases are available via PyPI and you can install ``sktime`` with its core dependencies via ``pip`` using:
To install ``sktime`` with its core dependencies via ``pip`` use:

.. code-block:: bash

pip install sktime

To install ``sktime`` with maximum dependencies, including soft dependencies, install with the ``all_extras`` modifier:
To install ``sktime`` via ``pip`` with maximum dependencies, including soft dependencies, install using the ``all_extras`` modifier:

.. code-block:: bash

pip install sktime[all_extras]


``sktime`` releases are also available via ``conda`` from ``conda-forge`` and can be installed using:
To install ``sktime`` via ``conda`` from ``conda-forge`` use:

.. code-block:: bash

conda install -c conda-forge sktime

This will install ``sktime`` with core dependencies, excluding soft dependencies.

Currently, there is no easy route to install ``sktime`` with maximum dependencies via ``conda``. Community contributions towards this, e.g., via conda metapackages, would be appreciated.
There is not currently a easy route to install ``sktime`` with maximum dependencies via ``conda``. Community contributions towards this, e.g., via conda metapackages, would be appreciated.

For more detailed installation instructions see our more detailed `installation`_ instructions.

Expand All @@ -52,45 +52,45 @@ For more information on the terminology used by ``sktime`` see INSERT LINK TO OU

Quickstart
----------
The code snippets below are designed to introduce ``sktime's`` functionality so you can start using its functionality quickly. For more detailed information see the `tutorials`_, `user_guide`_ and `api_reference`_ in ``sktime's`` `user_documentation`_.
The code snippets below are designed to introduce ``sktime's`` functionality so you can start using its functionality quickly. For more detailed information see the :ref:`tutorials`, :ref:`user_guide` and :ref:`api_reference` in ``sktime's`` :ref:`user_documentation`.

Forecasting
~~~~~~~~~~~

```python
from sktime.datasets import load_airline
from sktime.forecasting.base import ForecastingHorizon
from sktime.forecasting.model_selection import temporal_train_test_split
from sktime.forecasting.theta import ThetaForecaster
from sktime.performance_metrics.forecasting import mean_absolute_percentage_error

y = load_airline()
y_train, y_test = temporal_train_test_split(y)
fh = ForecastingHorizon(y_test.index, is_relative=False)
forecaster = ThetaForecaster(sp=12) # monthly seasonal periodicity
forecaster.fit(y_train)
y_pred = forecaster.predict(fh)
mean_absolute_percentage_error(y_test, y_pred)
>>> 0.08661467738190656
```
.. code-block:: python

from sktime.datasets import load_airline
from sktime.forecasting.base import ForecastingHorizon
from sktime.forecasting.model_selection import temporal_train_test_split
from sktime.forecasting.theta import ThetaForecaster
from sktime.performance_metrics.forecasting import mean_absolute_percentage_error

y = load_airline()
y_train, y_test = temporal_train_test_split(y)
fh = ForecastingHorizon(y_test.index, is_relative=False)
forecaster = ThetaForecaster(sp=12) # monthly seasonal periodicity
forecaster.fit(y_train)
y_pred = forecaster.predict(fh)
mean_absolute_percentage_error(y_test, y_pred)
>>> 0.08661467738190656

Time Series Classification
~~~~~~~~~~~~~~~~~~~~~~~~~~

```python
from sktime.classification.interval_based import TimeSeriesForestClassifier
from sktime.datasets import load_arrow_head
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score

X, y = load_arrow_head(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y)
classifier = TimeSeriesForestClassifier()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
accuracy_score(y_test, y_pred)
>>> 0.8679245283018868
```
.. code-block:: python

from sktime.classification.interval_based import TimeSeriesForestClassifier
from sktime.datasets import load_arrow_head
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score

X, y = load_arrow_head(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y)
classifier = TimeSeriesForestClassifier()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
accuracy_score(y_test, y_pred)
>>> 0.8679245283018868

Time Series Clustering
~~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ From here, you can navigate to:
:maxdepth: 1

getting_started
users
developers
user_documentation
get_involved
about
16 changes: 16 additions & 0 deletions docs/source/user_documentation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _user_documentation:

User Documentation
==================

.. toctree::
:maxdepth: 1

installation
tutorials
user_guide
estimator_overview
api_reference
changelog
roadmap
related_software
2 changes: 2 additions & 0 deletions sktime/annotation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
"""Implements time series annotation."""
4 changes: 4 additions & 0 deletions sktime/annotation/adapters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements adapters for time series annotation."""

__all__ = ["PyODAnnotator"]

from sktime.annotation.adapters._pyod import PyODAnnotator
8 changes: 5 additions & 3 deletions sktime/annotation/adapters/_pyod.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements outlier detection from pyOD."""

import numpy as np
from sktime.annotation.base._base import BaseSeriesAnnotator

Expand All @@ -10,7 +14,7 @@


class PyODAnnotator(BaseSeriesAnnotator):
"""Transformer that applies outlier detector from pyOD
"""Transformer that applies outlier detector from pyOD.

Parameters
----------
Expand Down Expand Up @@ -51,7 +55,6 @@ def _fit(self, X, Y=None):
-----
Create fitted model that sets attributes ending in "_".
"""

X_np = X.to_numpy()

if len(X_np.shape) == 1:
Expand All @@ -74,7 +77,6 @@ def _predict(self, X):
Y : pd.Series - annotations for sequence X
exact format depends on annotation type
"""

fmt = self.fmt
labels = self.labels

Expand Down
4 changes: 4 additions & 0 deletions sktime/annotation/base/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements base classes for annotation in sktime."""

__all__ = ["BaseSeriesAnnotator"]

from sktime.annotation.base._base import BaseSeriesAnnotator
11 changes: 5 additions & 6 deletions sktime/annotation/base/_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""
Base class template for annotator base type for time series stream
Base class template for annotator base type for time series stream.

class name: BaseSeriesAnnotator

Expand Down Expand Up @@ -77,6 +79,7 @@ def fit(self, X, Y=None):
Training data to fit model to (time series).
Y : pd.Series, optional
Ground truth annotations for training if annotator is supervised.

Returns
-------
self :
Expand Down Expand Up @@ -119,7 +122,6 @@ def predict(self, X):
Y : pd.Series
Annotations for sequence X exact format depends on annotation type.
"""

self.check_is_fitted()

X = check_series(X)
Expand All @@ -131,7 +133,7 @@ def predict(self, X):
return Y

def update(self, X, Y=None):
"""update model with new data and optional ground truth annotations
"""Update model with new data and optional ground truth annotations.

Parameters
----------
Expand All @@ -149,7 +151,6 @@ def update(self, X, Y=None):
-----
Updates fitted model that updates attributes ending in "_".
"""

self.check_is_fitted()

X = check_series(X)
Expand Down Expand Up @@ -183,7 +184,6 @@ def update_predict(self, X):
-----
Updates fitted model that updates attributes ending in "_".
"""

X = check_series(X)

self.update(X=X)
Expand Down Expand Up @@ -252,7 +252,6 @@ def _update(self, X, Y=None):
-----
Updates fitted model that updates attributes ending in "_".
"""

# default/fallback: re-fit to all data
self._fit(self._X, self._Y)

Expand Down
1 change: 1 addition & 0 deletions sktime/base/_meta.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements meta estimator for estimators composed of other estimators."""

__author__ = ["Markus Löning"]
__all__ = ["_HeterogenousMetaEstimator"]
Expand Down
9 changes: 6 additions & 3 deletions sktime/classification/interval_based/_rise.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _make_estimator(base_estimator, random_state=None):


def _select_interval(min_interval, max_interval, series_length, rng, method=3):
"""private function used to select an interval for a single tree."""
"""Private function used to select an interval for a single tree."""
interval = np.empty(2, dtype=int)
if method == 0:
interval[0] = rng.randint(series_length - min_interval)
Expand Down Expand Up @@ -308,7 +308,9 @@ def fit(self, X, y):
return self

def predict(self, X):
"""Find predictions for all cases in X. Built on top of `predict_proba.
"""Find predictions for all cases in X.

Built on top of `predict_proba`.

Parameters
----------
Expand Down Expand Up @@ -538,7 +540,8 @@ def matrix_acf(x, num_cases, max_lag):


def ps(x, sign=1, n=None, pad="mean"):
"""
"""Power spectrum transformer.

Power spectrum transform, currently calculated using np function.
It would be worth looking at ff implementation, see difference in speed
to java.
Expand Down
3 changes: 1 addition & 2 deletions sktime/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,7 @@ def load_uschange(y_name="Consumption"):


def load_PBS_dataset():
"""
Load the Pharmaceutical Benefit Scheme univariate time series dataset [1].
"""Load the Pharmaceutical Benefit Scheme univariate time series dataset [1].

Returns
-------
Expand Down
1 change: 1 addition & 0 deletions sktime/datasets/tsc_dataset_names.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-

"""
List of datasets available from the timeseriesclassification.com archive.

Expand Down
5 changes: 4 additions & 1 deletion sktime/forecasting/all/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# !/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Import all time series forecasting functionality available in sktime."""

__author__ = ["Markus Löning"]
__all__ = [
"ForecastingHorizon",
Expand Down
4 changes: 4 additions & 0 deletions sktime/forecasting/base/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# -*- coding: utf-8 -*-
# !/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements base classes for forecasting in sktime."""

__all__ = [
"ForecastingHorizon",
"BaseForecaster",
Expand Down