Skip to content

Commit

Permalink
Move tests/ to project root
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegrabowski committed Jul 19, 2024
1 parent 51704bd commit 4cd007c
Show file tree
Hide file tree
Showing 36 changed files with 18 additions and 25 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
is_conditional_dependent,
marginalize,
)
from pymc_experimental.tests.utils import equal_computations_up_to_root
from tests.utils import equal_computations_up_to_root


@pytest.fixture
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
SARIMAX_STATE_STRUCTURES,
SHORT_NAME_TO_LONG,
)
from pymc_experimental.tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
from tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
rng,
)
from pymc_experimental.tests.statespace.utilities.test_helpers import (
from tests.statespace.utilities.test_helpers import (
load_nile_test_data,
make_stationary_params,
simulate_from_numpy_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from pymc_experimental.statespace import BayesianVARMAX
from pymc_experimental.statespace.utils.constants import SHORT_NAME_TO_LONG
from pymc_experimental.tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
from tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
rng,
)

Expand All @@ -25,7 +25,7 @@
@pytest.fixture(scope="session")
def data():
df = pd.read_csv(
"pymc_experimental/tests/statespace/test_data/statsmodels_macrodata_processed.csv",
"tests/statespace/test_data/statsmodels_macrodata_processed.csv",
index_col=0,
parse_dates=True,
).astype(floatX)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
NO_FREQ_INFO_WARNING,
NO_TIME_INDEX_WARNING,
)
from pymc_experimental.tests.statespace.utilities.test_helpers import (
load_nile_test_data,
)
from tests.statespace.utilities.test_helpers import load_nile_test_data

function_names = ["pandas_date_freq", "pandas_date_nofreq", "pandas_nodate", "numpy", "pytensor"]
expected_warning = [
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
OBS_STATE_DIM,
TIME_DIM,
)
from pymc_experimental.tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
from tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
rng,
)
from pymc_experimental.tests.statespace.utilities.test_helpers import (
from tests.statespace.utilities.test_helpers import (
delete_rvs_from_model,
fast_eval,
load_nile_test_data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
UnivariateFilter,
)
from pymc_experimental.statespace.filters.kalman_filter import BaseFilter
from pymc_experimental.tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
from tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
rng,
)
from pymc_experimental.tests.statespace.utilities.test_helpers import (
from tests.statespace.utilities.test_helpers import (
get_expected_shape,
get_sm_state_from_output_name,
initialize_filter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
from numpy.testing import assert_allclose

from pymc_experimental.statespace.core.representation import PytensorRepresentation
from pymc_experimental.tests.statespace.utilities.shared_fixtures import TEST_SEED
from pymc_experimental.tests.statespace.utilities.test_helpers import (
fast_eval,
make_test_inputs,
)
from tests.statespace.utilities.shared_fixtures import TEST_SEED
from tests.statespace.utilities.test_helpers import fast_eval, make_test_inputs

floatX = pytensor.config.floatX
atol = 1e-12 if floatX == "float64" else 1e-6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
MATRIX_NAMES,
SMOOTHER_OUTPUT_NAMES,
)
from pymc_experimental.tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
from tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
rng,
)
from pymc_experimental.tests.statespace.utilities.test_helpers import (
from tests.statespace.utilities.test_helpers import (
fast_eval,
load_nile_test_data,
make_test_inputs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
SHOCK_DIM,
SHORT_NAME_TO_LONG,
)
from pymc_experimental.tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
from tests.statespace.utilities.shared_fixtures import ( # pylint: disable=unused-import
rng,
)
from pymc_experimental.tests.statespace.utilities.test_helpers import (
from tests.statespace.utilities.test_helpers import (
assert_pattern_repeats,
simulate_from_numpy_model,
unpack_symbolic_matrices_with_params,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@
MATRIX_NAMES,
SHORT_NAME_TO_LONG,
)
from pymc_experimental.tests.statespace.utilities.statsmodel_local_level import (
LocalLinearTrend,
)
from tests.statespace.utilities.statsmodel_local_level import LocalLinearTrend

floatX = pytensor.config.floatX


def load_nile_test_data():
from importlib.metadata import version

nile = pd.read_csv("pymc_experimental/tests/statespace/test_data/nile.csv", dtype={"x": floatX})
nile = pd.read_csv("tests/statespace/test_data/nile.csv", dtype={"x": floatX})
major, minor, rev = map(int, version("pandas").split("."))
if major >= 2 and minor >= 2 and rev >= 0:
freq_str = "YS-JAN"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4cd007c

Please sign in to comment.