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
4 changes: 4 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
steps:
- uses: actions/checkout@v6

- run: git remote set-branches origin 'main'

- run: git fetch --depth 1

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ dependencies = [
"einops>=0.6.0,<0.8.0",
"fsspec>=2022.5.0,<2024.4.0; python_version == '3.8'",
"rich",
"scikit-base",
]


Expand Down
9 changes: 9 additions & 0 deletions tests/test_autoint.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/usr/bin/env python
"""Tests for `pytorch_tabular` package."""

from skbase.utils.git_diff import _is_module_changed
import pytest

from pytorch_tabular import TabularModel
from pytorch_tabular.config import DataConfig, OptimizerConfig, TrainerConfig
from pytorch_tabular.models import AutoIntConfig


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.autoint"),
reason="run test only if autoint module is changed",
)
@pytest.mark.parametrize("multi_target", [True, False])
@pytest.mark.parametrize(
"continuous_cols", [["AveRooms", "AveBedrms", "Population", "AveOccup", "Latitude", "Longitude"]]
Expand Down Expand Up @@ -78,6 +83,10 @@ def test_regression(
assert pred_df.shape[0] == test.shape[0]


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.autoint"),
reason="run test only if autoint module is changed",
)
@pytest.mark.parametrize("multi_target", [False, True])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_danet.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
"""Tests for `pytorch_tabular` package."""

from skbase.utils.git_diff import _is_module_changed
import pytest

from pytorch_tabular import TabularModel
Expand All @@ -10,6 +11,10 @@
# from pytorch_tabular.categorical_encoders import CategoricalEmbeddingTransformer


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.danet"),
reason="run test only if danet module is changed",
)
@pytest.mark.parametrize("multi_target", [True, False])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down Expand Up @@ -80,6 +85,10 @@ def test_regression(
assert pred_df.shape[0] == test.shape[0]


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.danet"),
reason="run test only if danet module is changed",
)
@pytest.mark.parametrize("multi_target", [False, True])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_ft_transformer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
"""Tests for `pytorch_tabular` package."""

from skbase.utils.git_diff import _is_module_changed
import pytest

from pytorch_tabular import TabularModel
Expand All @@ -9,6 +10,10 @@
from pytorch_tabular.models import FTTransformerConfig


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.ft_transformer"),
reason="run test only if ft_transformer module is changed",
)
@pytest.mark.parametrize("multi_target", [True, False])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down Expand Up @@ -86,6 +91,10 @@ def test_regression(
assert pred_df.shape[0] == test.shape[0]


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.ft_transformer"),
reason="run test only if ft_transformer module is changed",
)
@pytest.mark.parametrize("multi_target", [False, True])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_gandalf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
"""Tests for `pytorch_tabular` package."""

from skbase.utils.git_diff import _is_module_changed
import pytest

from pytorch_tabular import TabularModel
Expand All @@ -10,6 +11,10 @@
# from pytorch_tabular.categorical_encoders import CategoricalEmbeddingTransformer


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.gandalf"),
reason="run test only if gandalf module is changed",
)
@pytest.mark.parametrize("multi_target", [True, False])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down Expand Up @@ -80,6 +85,10 @@ def test_regression(
assert pred_df.shape[0] == test.shape[0]


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.gandalf"),
reason="run test only if gandalf module is changed",
)
@pytest.mark.parametrize("multi_target", [False, True])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_gate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
"""Tests for `pytorch_tabular` package."""

from skbase.utils.git_diff import _is_module_changed
import pytest

from pytorch_tabular import TabularModel
Expand All @@ -10,6 +11,10 @@
# from pytorch_tabular.categorical_encoders import CategoricalEmbeddingTransformer


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.gate"),
reason="run test only if gate module is changed",
)
@pytest.mark.parametrize("multi_target", [True, False])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down Expand Up @@ -85,6 +90,10 @@ def test_regression(
assert pred_df.shape[0] == test.shape[0]


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.gate"),
reason="run test only if gate module is changed",
)
@pytest.mark.parametrize("multi_target", [False, True])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_model_stacking.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
from skbase.utils.git_diff import _is_module_changed
import pytest
import torch
from sklearn.preprocessing import PowerTransformer
Expand Down Expand Up @@ -50,6 +51,10 @@ def get_model_configs(task):
return [model_config(task) for model_config in all_model_configs]


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.stacking"),
reason="run test only if stacking module is changed",
)
@pytest.mark.parametrize("multi_target", [True, False])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down Expand Up @@ -163,6 +168,10 @@ def test_regression(
assert pred_df.shape[0] == test.shape[0]


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.stacking"),
reason="run test only if stacking module is changed",
)
@pytest.mark.parametrize("multi_target", [False, True])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_tabnet.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/usr/bin/env python
"""Tests for `pytorch_tabular` package."""

from skbase.utils.git_diff import _is_module_changed
import pytest

from pytorch_tabular import TabularModel
from pytorch_tabular.config import DataConfig, OptimizerConfig, TrainerConfig
from pytorch_tabular.models import TabNetModelConfig


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.tabnet"),
reason="run test only if tabnet module is changed",
)
@pytest.mark.parametrize("multi_target", [True, False])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down Expand Up @@ -78,6 +83,10 @@ def test_regression(
assert pred_df.shape[0] == test.shape[0]


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.tabnet"),
reason="run test only if tabnet module is changed",
)
@pytest.mark.parametrize("multi_target", [False, True])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_tabtransformer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
"""Tests for `pytorch_tabular` package."""

from skbase.utils.git_diff import _is_module_changed
import pytest

from pytorch_tabular import TabularModel
Expand All @@ -9,6 +10,10 @@
from pytorch_tabular.models import TabTransformerConfig


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.tab_transformer"),
reason="run test only if tab_transformer module is changed",
)
@pytest.mark.parametrize("multi_target", [True, False])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down Expand Up @@ -84,6 +89,10 @@ def test_regression(
assert pred_df.shape[0] == test.shape[0]


@pytest.mark.skipif(
not _is_module_changed("pytorch_tabular.models.tab_transformer"),
reason="run test only if tab_transformer module is changed",
)
@pytest.mark.parametrize("multi_target", [False, True])
@pytest.mark.parametrize(
"continuous_cols",
Expand Down