Skip to content

Commit

Permalink
Merge branch 'main' into splitter_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fkiraly committed Mar 23, 2024
2 parents d7c4de4 + e813b77 commit 5132e7b
Show file tree
Hide file tree
Showing 341 changed files with 8,470 additions and 4,320 deletions.
111 changes: 111 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2320,6 +2320,8 @@
"avatar_url": "https://avatars.githubusercontent.com/MBristle",
"profile": "https://github.com/MBristle",
"contributions": [
"bug",
"test",
"doc"
]
},
Expand Down Expand Up @@ -2604,6 +2606,115 @@
"bug",
"code"
]
},
{
"login": "ShreeshaM07",
"name": "Shreesha M",
"avatar_url": "https://avatars.githubusercontent.com/u/120820143?s=400&v=4",
"profile": "https://github.com/ShreeshaM07",
"contributions": [
"bug",
"code",
"test"
]
},
{
"login": "geetu040",
"name": "Armaghan",
"avatar_url": "https://avatars.githubusercontent.com/u/90601662?s=96&v=4",
"profile": "https://github.com/geetu040",
"contributions": [
"code",
"doc",
"maintenance"
]
},
{
"login": "Xinyu-Wu-0000",
"name": "Xinyu Wu",
"avatar_url": "https://avatars.githubusercontent.com/u/57612792?v=4",
"profile": "https://github.com/Xinyu-Wu-0000",
"contributions": [
"bug",
"code",
"test"
]
},
{
"login": "meraldoantonio",
"name": "Meraldo Antonio",
"avatar_url": "https://avatars.githubusercontent.com/u/37468543?v=4",
"profile": "https://github.com/meraldoantonio",
"contributions": [
"doc"
]
},
{
"login": "memeo-pro",
"name": "Yash Edake",
"avatar_url": "https://avatars.githubusercontent.com/memeo-pro",
"profile": "https://github.com/MEMEO-PRO",
"contributions": [
"maintenance",
"bug"
]
},
{
"login": "deysanjeeb",
"name": "Sanjeeb Dey",
"avatar_url": "https://avatars.githubusercontent.com/u/39940629?v=4",
"profile": "https://github.com/deysanjeeb",
"contributions": [
"maintenance"
]
},
{
"login": "ianspektor",
"name": "Ian Spektor",
"avatar_url": "https://avatars.githubusercontent.com/u/49082859?v=4",
"profile": "https://github.com/ianspektor",
"contributions": [
"code",
"doc"
]
},
{
"login": "javiber",
"name": "Javier Berneche",
"avatar_url": "https://avatars.githubusercontent.com/u/3588715?v=4",
"profile": "https://github.com/javiber",
"contributions": [
"code",
"doc"
]
},
{
"login": "fnhirwa",
"name": "Felix Hirwa Nshuti",
"avatar_url": "https://avatars.githubusercontent.com/u/67042527?s=64&v=4",
"profile": "https://github.com/fnhirwa",
"contributions": [
"code",
"maintenance"
]
},
{
"login": "vandit98",
"name": "Vandit Tyagi",
"avatar_url": "https://avatars.githubusercontent.com/u/91458535?v=4",
"profile": "https://github.com/vandit98",
"contributions": [
"doc"
]
},
{
"login": "manuel-munoz-aguirre",
"name": "Manuel Muñoz Aguirre",
"avatar_url": "https://avatars.githubusercontent.com/u/5576458?v=4",
"profile": "https://github.com/manuel-munoz-aguirre",
"contributions": [
"doc"
]
}
]
}
7 changes: 0 additions & 7 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,3 @@ comment: false
# enable codecov to report to GitHub status checks
github_checks:
annotations: false

# group coverage reports
flags:
complete:
paths:
- ".*"
carryforward: true
13 changes: 0 additions & 13 deletions .github/workflows/cancel.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
code-quality:
name: code-quality
Expand All @@ -23,7 +27,7 @@ jobs:
run: python3 -m pip install pre-commit
- id: changed-files
name: identify modified files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v43
- name: run pre-commit hooks on modified files
run: pre-commit run --color always --files ${{ steps.changed-files.outputs.all_changed_files }} --show-diff-on-failure
- name: check missing __init__ files
Expand Down
98 changes: 55 additions & 43 deletions CONTRIBUTORS.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sktime is a library for time series analysis in Python. It provides a unified in
| **Open Source** | [![BSD 3-clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/sktime/sktime/blob/main/LICENSE) |
| **Tutorials** | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/sktime/sktime/main?filepath=examples) [![!youtube](https://img.shields.io/static/v1?logo=youtube&label=YouTube&message=tutorials&color=red)](https://www.youtube.com/playlist?list=PLKs3UgGjlWHqNzu0LEOeLKvnjvvest2d0) |
| **Community** | [![!discord](https://img.shields.io/static/v1?logo=discord&label=discord&message=chat&color=lightgreen)](https://discord.com/invite/54ACzaFsn7) [![!slack](https://img.shields.io/static/v1?logo=linkedin&label=LinkedIn&message=news&color=lightblue)](https://www.linkedin.com/company/scikit-time/) |
| **CI/CD** | [![github-actions](https://img.shields.io/github/actions/workflow/status/sktime/sktime/wheels.yml?logo=github)](https://github.com/sktime/sktime/actions/workflows/wheels.yml) [![!codecov](https://img.shields.io/codecov/c/github/sktime/sktime?label=codecov&logo=codecov&flag=complete)](https://codecov.io/gh/sktime/sktime) [![readthedocs](https://img.shields.io/readthedocs/sktime?logo=readthedocs)](https://www.sktime.net/en/latest/?badge=latest) [![platform](https://img.shields.io/conda/pn/conda-forge/sktime)](https://github.com/sktime/sktime) |
| **CI/CD** | [![github-actions](https://img.shields.io/github/actions/workflow/status/sktime/sktime/wheels.yml?logo=github)](https://github.com/sktime/sktime/actions/workflows/wheels.yml) [![!codecov](https://img.shields.io/codecov/c/github/sktime/sktime?label=codecov&logo=codecov)](https://codecov.io/gh/sktime/sktime) [![readthedocs](https://img.shields.io/readthedocs/sktime?logo=readthedocs)](https://www.sktime.net/en/latest/?badge=latest) [![platform](https://img.shields.io/conda/pn/conda-forge/sktime)](https://github.com/sktime/sktime) |
| **Code** | [![!pypi](https://img.shields.io/pypi/v/sktime?color=orange)](https://pypi.org/project/sktime/) [![!conda](https://img.shields.io/conda/vn/conda-forge/sktime)](https://anaconda.org/conda-forge/sktime) [![!python-versions](https://img.shields.io/pypi/pyversions/sktime)](https://www.python.org/) [![!black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) |
| **Downloads**| [![Downloads](https://static.pepy.tech/personalized-badge/sktime?period=week&units=international_system&left_color=grey&right_color=blue&left_text=weekly%20(pypi))](https://pepy.tech/project/sktime) [![Downloads](https://static.pepy.tech/personalized-badge/sktime?period=month&units=international_system&left_color=grey&right_color=blue&left_text=monthly%20(pypi))](https://pepy.tech/project/sktime) [![Downloads](https://static.pepy.tech/personalized-badge/sktime?period=total&units=international_system&left_color=grey&right_color=blue&left_text=cumulative%20(pypi))](https://pepy.tech/project/sktime) |
| **Citation** | [![!zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.3749000.svg)](https://doi.org/10.5281/zenodo.3749000) |
Expand Down
120 changes: 120 additions & 0 deletions build_tools/check_backticks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)

"""Test script to check for invalid use of single-backticks."""

__author__ = ["geetu040"]

import argparse
import ast
import glob
import re


def find_py_files(folder_path):
"""Find all Python files in a given folder path."""
return glob.glob(f"{folder_path}/**/*.py", recursive=True)


def extract_docstrings(filename):
"""Extract docstrings from a Python file."""
# create abstract syntax tree from the file
with open(filename) as f:
tree = ast.parse(f.read())

# walk through all nodes in the tree
docstrings = {}
for node in ast.walk(tree):
if (
isinstance(node, ast.Expr)
and isinstance(node.value, ast.Constant)
and isinstance(node.value.value, str)
):
# if the node is an expression and
# its value is a constant and
# constant's value is a string
# the node represents a docstring
# See https://docs.python.org/3/library/ast.html#abstract-grammar
docstring = node.value.value
lineno = node.value.lineno
docstrings[lineno] = docstring

return docstrings


def find_invalid_backtick_text(docstring):
"""Find invalid backtick text in a docstring."""
# remove all multiple backticks to avoid interference
# we are looking only for invalid single-backtick
docstring = re.sub(r"`{2,}.*?`{2,}", "", docstring, flags=re.DOTALL)

all_backtick_text = re.findall(r"`.*?`", docstring, flags=re.DOTALL)
# expressions like :math:`d(x, y):= (x-y)^2` are valid cases
valid_backtick_text = re.findall(r":.*?:(`.*?`)", docstring, flags=re.DOTALL)

# find all the invalid backtick code snippets
invalid_backtick_text = set()
for text in all_backtick_text:
if text in valid_backtick_text:
continue
# rst hyperlinks are valid cases
if re.match(r"`.*?<http.*?>`", text, flags=re.DOTALL):
continue
invalid_backtick_text.add(text)

return invalid_backtick_text


def main():
"""Execute the main function of the script."""
# parse command line arguments
parser = argparse.ArgumentParser(
description="Test script to check for invalid use of single-backticks."
)
parser.add_argument(
"folder_path",
nargs="?",
default="./sktime",
help="Folder path to search for Python files",
)
args = parser.parse_args()

folder_path = args.folder_path
results = {}

# list all the python files in the project
py_files = find_py_files(folder_path)

for file in py_files:
docstrings = extract_docstrings(file)
results_on_file = {}

for lineno, docstring in docstrings.items():
invalid_backtick_text = find_invalid_backtick_text(docstring)

if len(invalid_backtick_text) > 0:
results_on_file[lineno] = invalid_backtick_text

if len(results_on_file) > 0:
results[file] = results_on_file

# print the lines along with the invalid backticks text
print(f'Results in "{folder_path}"') # noqa: T201
if len(results) > 0:
print(f"Total Files with invalid backticks: {len(results)}") # noqa: T201
for filename, result in results.items():
for lineno, errors in result.items():
print(f"{filename}:{lineno} {' '.join(errors)}") # noqa: T201
else:
print("No invalid backticks found") # noqa: T201


if __name__ == "__main__":
"""
Usage: defaults to "./sktime"
python build_tools/check_backticks.py
Usage: folder path as argument
python build_tools/check_backticks.py sktime/classification/distance_based
"""
main()
5 changes: 3 additions & 2 deletions build_tools/docker/py310.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM python:3.10.10-bullseye
FROM python:3.10-slim

WORKDIR /usr/src/sktime

COPY . .

RUN apt-get update && apt-get install --no-install-recommends -y build-essential gcc git && apt-get clean
RUN python -m pip install -U pip
RUN python -m pip install .[all_extras,dev,binder]
RUN python -m pip install .[all_extras_pandas2,dev,binder]
5 changes: 3 additions & 2 deletions build_tools/docker/py311.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM python:3.11.2-bullseye
FROM python:3.11-slim

WORKDIR /usr/src/sktime

COPY . .

RUN apt-get update && apt-get install --no-install-recommends -y build-essential gcc git && apt-get clean
RUN python -m pip install -U pip
RUN python -m pip install .[all_extras,dev,binder]
RUN python -m pip install .[all_extras_pandas2,dev,binder]
9 changes: 9 additions & 0 deletions build_tools/docker/py312.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.12-slim

WORKDIR /usr/src/sktime

COPY . .

RUN apt-get update && apt-get install --no-install-recommends -y build-essential gcc git && apt-get clean
RUN python -m pip install -U pip
RUN python -m pip install .[all_extras_pandas2,dev,binder]
5 changes: 3 additions & 2 deletions build_tools/docker/py38.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM python:3.8.16-bullseye
FROM python:3.8-slim

WORKDIR /usr/src/sktime

COPY . .

RUN apt-get update && apt-get install --no-install-recommends -y build-essential gcc git && apt-get clean
RUN python -m pip install -U pip
RUN python -m pip install .[all_extras,dev,binder]
RUN python -m pip install .[all_extras_pandas2,dev,binder]
5 changes: 3 additions & 2 deletions build_tools/docker/py39.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM python:3.9.16-bullseye
FROM python:3.9-slim

WORKDIR /usr/src/sktime

COPY . .

RUN apt-get update && apt-get install --no-install-recommends -y build-essential gcc git && apt-get clean
RUN python -m pip install -U pip
RUN python -m pip install .[all_extras,dev,binder]
RUN python -m pip install .[all_extras_pandas2,dev,binder]
3 changes: 2 additions & 1 deletion docs/source/api_reference/forecasting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Deep learning based forecasters
:toctree: auto_generated/
:template: class.rst

CINNForecaster
cINNForecaster

.. currentmodule:: sktime.forecasting.neuralforecast

Expand All @@ -378,6 +378,7 @@ Deep learning based forecasters
:template: class.rst

NeuralForecastRNN
NeuralForecastLSTM


Intermittent time series forecasters
Expand Down
5 changes: 4 additions & 1 deletion docs/source/api_reference/regression.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ Deep learning
:template: class.rst

CNNRegressor
CNTCRegressor
FCNRegressor
LSTMRegressor
InceptionTimeRegressor
LSTMFCNRegressor
MACNNRegressor
MCDCNNRegressor
MLPRegressor
SimpleRNNRegressor
Expand Down
Loading

0 comments on commit 5132e7b

Please sign in to comment.