Skip to content

Commit

Permalink
[ENH] address readthedocs build failures (#242)
Browse files Browse the repository at this point in the history
This PR solves the readthedocs build issue by:

* isolating some `numpy` imports
* adding the test dep set as required for readthedocs builds to avoid
import failures (pytest)
  • Loading branch information
fkiraly authored Oct 26, 2023
1 parent bb49045 commit 12a1884
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ python:
path: .
extra_requirements:
- docs
- test
build:
os: ubuntu-20.04
tools:
Expand Down
4 changes: 2 additions & 2 deletions skbase/utils/tests/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
- test_is_scalar_nan_output to verify _is_scalar_nan outputs expected value for
different inputs.
"""
import numpy as np

from skbase.utils._check import _is_scalar_nan

__author__ = ["RNKuhns"]


def test_is_scalar_nan_output():
"""Test that _is_scalar_nan outputs expected value for different inputs."""
import numpy as np

assert _is_scalar_nan(np.nan) is True
assert _is_scalar_nan(float("nan")) is True
assert _is_scalar_nan(None) is False
Expand Down
12 changes: 8 additions & 4 deletions skbase/utils/tests/test_deep_equals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""Tests for deep_equals utility."""
from copy import deepcopy

import numpy as np
import pytest

from skbase.utils.deep_equals import deep_equals
Expand All @@ -14,13 +13,18 @@
[],
((((())))),
[([([([()])])])],
np.array([2, 3, 4]),
np.array([2, 4, 5]),
3.5,
4.2,
np.nan,
]

if _check_soft_dependencies("numpy", severity="none"):
import numpy as np

EXAMPLES += [
np.array([2, 3, 4]),
np.array([2, 4, 5]),
np.nan,
]

if _check_soft_dependencies("pandas", severity="none"):
import pandas as pd
Expand Down

0 comments on commit 12a1884

Please sign in to comment.