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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

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

The installation of torchvision appears unnecessary for this test suite as the smoke test only imports and uses PyTorch core functionality. Consider removing torchvision to reduce installation time and dependencies.

Suggested change
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install torch --index-url https://download.pytorch.org/whl/cpu

Copilot uses AI. Check for mistakes.
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest --ignore=tests/run_all_test.py
pytest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,7 @@ cython_debug/

# not ignore requirements.txt
!*requirements.txt

# keep datasets in test
!tests/smoke_test/datasets/
!tests/smoke_test/datasets/**/*.npy
2 changes: 0 additions & 2 deletions tests/basicts_test/test_launcher.py

This file was deleted.

Empty file added tests/datasets_test/__init__.py
Empty file.
12 changes: 0 additions & 12 deletions tests/run_all_test.py

This file was deleted.

Empty file added tests/smoke_test/__init__.py
Empty file.
36 changes: 36 additions & 0 deletions tests/smoke_test/datasets/ETTh1_mini/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "ETTh1_mini",
"domain": "electricity transformer temperature",
"frequency (minutes)": 60,
"shape": [
720,
7
],
"timestamps_shape": [
720,
4
],
"timestamps_description": [
"time of day",
"day of week",
"day of month",
"day of year"
],
"num_time_steps": 720,
"num_vars": 7,
"has_graph": false,
"regular_settings": {
"train_val_test_ratio": [
0.6,
0.2,
0.2
],
"norm_each_channel": true,
"rescale": false,
"metrics": [
"MAE",
"MSE"
],
"null_val": NaN
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

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

Invalid JSON syntax: NaN is not a valid JSON value. It should be either null, a number, a string like \"NaN\", or removed if not needed. JSON parsers will fail to parse this file.

Suggested change
"null_val": NaN
"null_val": null

Copilot uses AI. Check for mistakes.
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added tests/smoke_test/datasets/ETTh1_mini/val_data.npy
Binary file not shown.
Binary file not shown.
37 changes: 37 additions & 0 deletions tests/smoke_test/test_dlinear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# pylint: disable=wrong-import-position

import os
import sys

sys.path.append(os.path.abspath(__file__ + "/../../../src/"))
os.chdir(os.path.abspath(os.path.join(os.path.dirname(__file__))))

from basicts.configs import BasicTSForecastingConfig
from basicts.launcher import BasicTSLauncher
from basicts.models.DLinear import DLinear
from basicts.models.DLinear.config.dlinear_config import DLinearConfig


def test_dlinear_smoke_test():
output_len = 64
input_len = 64
dlinear_config = DLinearConfig(
input_len=input_len,
output_len=output_len,
individual=False,
)

BasicTSLauncher.launch_training(
BasicTSForecastingConfig(
model=DLinear,
dataset_name="ETTh1_mini",
model_config=dlinear_config,
gpus=None,
num_epochs=5,
input_len=input_len,
output_len=output_len,
)
)

if __name__ == "__main__":
test_dlinear_smoke_test()