Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 6 additions & 5 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ on:
- dev
pull_request:
branches:
- main
- dev

jobs:
flake8-linting:
ruff-linting:
runs-on: ubuntu-latest

steps:
Expand All @@ -19,12 +20,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version: "3.13"

- name: Install Flake8
- name: Install Ruff
run: |
pip install flake8 flake8-pyproject
pip install ruff

- name: Run linting
run: |
flake8 .
ruff check .
21 changes: 6 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ repos:
- id: check-yaml

# hooks for linting code
- repo: https://github.com/psf/black
rev: 24.8.0
- repo: local
hooks:
- id: black
args: [
--line-length=120, # refer to pyproject.toml
]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
args: [
--max-line-length=120, # refer to pyproject.toml
--extend-ignore=E203,E231
]
- id: ruff
name: ruff
entry: ruff check --config pyproject.toml --force-exclude
language: unsupported
types_or: [python, pyi]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<a href="https://deepwiki.com/WenjieDu/PyPOTS">
<img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg">
</a>
<a href="https://github.com/psf/black">
<img alt="Code Style" src="https://img.shields.io/badge/Code_Style-black-000000">
<a href="https://github.com/astral-sh/ruff">
<img alt="Code Style" src="https://img.shields.io/badge/Code_Style-Ruff-D7FF64?logo=ruff">
</a>
<a href="https://anaconda.org/conda-forge/pypots">
<img alt="Conda downloads" src="https://pypots.com/figs/downloads_badges/conda_pypots_downloads.svg">
Expand Down Expand Up @@ -268,8 +268,8 @@ conda update conda-forge::pypots # update pypots to the latest version
# via docker
docker run -it --name pypots wenjiedu/pypots # docker will auto pull our built image and run a instance for you
# after things settled, you can run python in the container to access the well-configured environment for running pypots
# if you'd like to detach from the container, press ctrl-P + ctrl-Q
# run `docker attach pypots` to enter the container again.
# if you'd like to detach from the container, press ctrl-P + ctrl-Q
# run `docker attach pypots` to enter the container again.
```

## ❖ Usage
Expand All @@ -295,15 +295,15 @@ data = preprocess_physionet2012(subset='set-a',rate=0.1) # Our ecosystem libs wi
train_X, val_X, test_X = data["train_X"], data["val_X"], data["test_X"]
print(train_X.shape) # (n_samples, n_steps, n_features)
print(val_X.shape) # samples (n_samples) in train set and val set are different, but they have the same sequence len (n_steps) and feature dim (n_features)
print(f"We have {calc_missing_rate(train_X):.1%} values missing in train_X")
print(f"We have {calc_missing_rate(train_X):.1%} values missing in train_X")
train_set = {"X": train_X} # in training set, simply put the incomplete time series into it
val_set = {
"X": val_X,
"X_ori": data["val_X_ori"], # in validation set, we need ground truth for evaluation and picking the best model checkpoint
}
test_set = {"X": test_X} # in test set, only give the testing incomplete time series for model to impute
test_X_ori = data["test_X_ori"] # test_X_ori bears ground truth for evaluation
indicating_mask = np.isnan(test_X) ^ np.isnan(test_X_ori) # mask indicates the values that are missing in X but not in X_ori, i.e. where the gt values are
indicating_mask = np.isnan(test_X) ^ np.isnan(test_X_ori) # mask indicates the values that are missing in X but not in X_ori, i.e. where the gt values are

from pypots.imputation import SAITS # import the model you want to use
from pypots.nn.functional import calc_mae
Expand Down Expand Up @@ -522,7 +522,7 @@ Fröhlich, H. (2019).
[An empirical evaluation of generic convolutional and recurrent networks for sequence modeling](https://arxiv.org/abs/1803.01271).
*arXiv 2018*.
[^36]: Project Gungnir, the world 1st LLM for time-series multitask modeling, will meet you soon. 🚀 Missing values and
variable lengths in your datasets? Hard to perform multitask learning with your time series? Not problems no longer.
variable lengths in your datasets? Hard to perform multitask learning with your time series? Not problems no longer.
Join our waitlist right now to receive the latest news and be the first to try it when it's released!
<a href="https://time-series.ai"><img src="https://pypots.com/figs/timeseriesai/logo.png" width="20px">Time-Series.AI</a>
[^37]: Wang, S., Wu, H., Shi, X., Hu, T., Luo, H., Ma, L., ... & ZHOU, J. (2024).
Expand Down Expand Up @@ -579,4 +579,4 @@ Join our waitlist right now to receive the latest news and be the first to try i
*arXiv 2024*.
[^55]: Zhang, F., Du, W., Zhang, H., Yu, K., & Qu, S. (2026).
[HELIX: Hybrid Encoding with Learnable Identity and Cross-dimensional Synthesis for Time Series Imputation](https://openreview.net/forum?id=FN20iuPnEU).
*ICML 2026*.
*ICML 2026*.
8 changes: 4 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<a href="https://deepwiki.com/WenjieDu/PyPOTS">
<img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg">
</a>
<a href="https://github.com/psf/black">
<img alt="Code Style" src="https://img.shields.io/badge/Code_Style-black-000000">
<a href="https://github.com/astral-sh/ruff">
<img alt="Code Style" src="https://img.shields.io/badge/Code_Style-Ruff-D7FF64?logo=ruff">
</a>
<a href="https://anaconda.org/conda-forge/pypots">
<img alt="Conda downloads" src="https://pypots.com/figs/downloads_badges/conda_pypots_downloads.svg">
Expand Down Expand Up @@ -258,7 +258,7 @@ conda update conda-forge::pypots # 更新为最新版本
# via docker
docker run -it --name pypots wenjiedu/pypots # docker会自动拉取我们构建好的镜像并为你运行一个实例
# 运行结束后, 你可以在该容器中运行python即可使用我们为运行pypots配置好的环境
# 如果你想退出该容器, 先按ctrl-P然后按ctrl-Q即可退出
# 如果你想退出该容器, 先按ctrl-P然后按ctrl-Q即可退出
# 运行命令`docker attach pypots`可以重新进入该容器
```

Expand Down Expand Up @@ -560,4 +560,4 @@ test recently ;-) Follow us, and stay tuned!
*arXiv 2024*.
[^55]: Zhang, F., Du, W., Zhang, H., Yu, K., & Qu, S. (2026).
[HELIX: Hybrid Encoding with Learnable Identity and Cross-dimensional Synthesis for Time Series Imputation](https://openreview.net/forum?id=FN20iuPnEU).
*ICML 2026*.
*ICML 2026*.
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ Welcome to PyPOTS docs!
:alt: Ask DeepWiki
:target: https://deepwiki.com/WenjieDu/PyPOTS

.. image:: https://img.shields.io/badge/Code_Style-black-000000
.. image:: https://img.shields.io/badge/Code_Style-ruff-D7FF64
:alt: Code Style
:target: https://github.com/psf/black
:target: https://github.com/astral-sh/ruff

.. image:: https://pypots.com/figs/downloads_badges/conda_pypots_downloads.svg
:alt: Conda downloads
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/autoformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import Autoformer

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/autoformer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from typing import Union, Optional

import torch
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from abc import abstractmethod
from typing import Union, Optional

Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/crossformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import Crossformer

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/dlinear/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import DLinear

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/dlinear/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from typing import Union, Optional

import torch
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/etsformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import ETSformer

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/fedformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import FEDformer

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/film/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import FiLM

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/imputeformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import ImputeFormer

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/imputeformer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from typing import Union, Optional

import torch
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/informer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import Informer

__all__ = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import NonstationaryTransformer

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/patchtst/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import PatchTST

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/patchtst/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from typing import Union, Optional

import torch
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/pyraformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import Pyraformer

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/reformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import Reformer

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/reformer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from typing import Union, Optional

import torch
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/saits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import SAITS

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/saits/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from typing import Union, Optional

import torch
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/scinet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import SCINet

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/scinet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from typing import Union, Optional

import torch
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/segrnn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import SegRNN

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/segrnn/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from typing import Union, Optional

import torch
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/tefn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import TEFN

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/tefn/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


import logging
from typing import Union, Optional

Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/timemixer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import TimeMixer

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/timemixerpp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from .model import TimeMixerPP

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/timemixerpp/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


from typing import Union, Optional

import torch
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/timesnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import TimesNet

__all__ = [
Expand Down
1 change: 0 additions & 1 deletion pypots/anomaly_detection/transformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# Created by Yiyuan Yang <yyy1997sjz@gmail.com>
# License: BSD-3-Clause


from .model import Transformer

__all__ = [
Expand Down
Loading
Loading