Skip to content

Decouple config from tests#111

Open
isaacaka wants to merge 4 commits intorefactor_clifrom
decouple_config_from_tests
Open

Decouple config from tests#111
isaacaka wants to merge 4 commits intorefactor_clifrom
decouple_config_from_tests

Conversation

@isaacaka
Copy link
Copy Markdown
Collaborator

@isaacaka isaacaka commented Mar 26, 2026

Change Description

This PR decouples the tests from the dimensionality reduction and forecasting config files and begins to allow parameterisation of tests across custom methods.

Task List

  • Replace module-level config loading in conftest.py with parameterized fixtures.
  • Move PCA-specific tests from test_simulation.py and test_prediction.py into test_pca.py with local fixtures
  • Derive steps from x_pred.shape[0] instead, matching how DirectForecaster works.
  • Remove overly strict isinstance(y_hat, np.ndarray) checks in tests

Replace module-level config loading in conftest.py with parameterized
fixtures. dr_technique and forecast_technique are now pulled directly
from the dimensionality_reduction_techniques and forecast_techniques
dicts, creating a cross-product with existing indirect parametrization.
Tests will now automatically cover any technique registered in those
dicts.

Note: This will cause a large increase in the number of test cases and
cause some DR and forecasting techniques specific tests to fail or
error.
Move PCA-specific tests from test_simulation.py and test_prediction.py
into test_pca.py with local fixtures that hardcode
DimensionalityReductionPCA, bypassing the conftest cross-product. Bundle
(technique, comp) pairs in conftest's dr_technique fixture so each DR
class gets an appropriate comp value — fixes KernelPCA
InvalidParameterError from receiving a float. Remove unused
dummy_sim_array fixture from test_simulation.py.
RecursiveForecaster hardcoded steps=30, ignoring the caller's
forecast horizon. This caused shape mismatches when the caller
requested a different number of steps. Derive steps from
x_pred.shape[0] instead, matching how DirectForecaster works.

Remove overly strict isinstance(y_hat, np.ndarray) checks in
tests — shape and value assertions already cover checking for array-like
data structures.
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@isaacaka isaacaka changed the base branch from main to refactor_cli March 26, 2026 15:08
@isaacaka isaacaka requested review from SimonSadler and ma595 March 26, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant