bluecast.tests.test_base_classes

Tests for base_classes module functionality.

Module Contents

Classes

SimpleSampler

A simple class that can be pickled for testing.

TestXgboostBaseModel

Test the XgboostBaseModel base class functionality.

TestCatboostBaseModel

Test the CatboostBaseModel base class functionality.

TestBaseClassesIntegration

Integration tests for base classes functionality.

class bluecast.tests.test_base_classes.SimpleSampler(seed)

A simple class that can be pickled for testing.

class bluecast.tests.test_base_classes.TestXgboostBaseModel

Test the XgboostBaseModel base class functionality.

xgboost_base_model()

Create a basic XgboostBaseModel instance for testing.

test_create_optuna_study_basic(xgboost_base_model)

Test basic optuna study creation without database backend.

test_create_optuna_study_with_sampler_and_pruner(xgboost_base_model)

Test optuna study creation with sampler and pruner.

test_create_optuna_study_with_database_backend(xgboost_base_model)

Test optuna study creation with database backend configuration.

test_create_optuna_study_with_database_backend_and_tpe_sampler(xgboost_base_model)

Test optuna study creation with database backend and TPESampler (which doesn’t save state due to no seed attr).

test_create_optuna_study_with_database_backend_and_simple_sampler_with_seed(xgboost_base_model)

Test optuna study creation with database backend and simple sampler that has seed attribute.

test_create_optuna_study_with_database_backend_and_sampler_without_seed(xgboost_base_model)

Test optuna study creation with database backend and sampler without seed attribute.

test_create_optuna_study_sampler_save_error_handling(xgboost_base_model)

Test error handling when sampler state saving fails.

test_create_optuna_study_with_database_backend_none(xgboost_base_model)

Test optuna study creation when database backend path is None.

test_create_optuna_study_with_database_backend_non_string(xgboost_base_model)

Test optuna study creation when database backend path is not a string.

test_create_optuna_study_load_if_exists_with_database(xgboost_base_model)

Test that load_if_exists is set to True when using database backend.

class bluecast.tests.test_base_classes.TestCatboostBaseModel

Test the CatboostBaseModel base class functionality.

catboost_base_model()

Create a basic CatboostBaseModel instance for testing.

test_catboost_create_optuna_study_basic(catboost_base_model)

Test basic optuna study creation for CatBoost without database backend.

test_catboost_create_optuna_study_with_database_backend(catboost_base_model)

Test CatBoost optuna study creation with database backend configuration.

test_catboost_create_optuna_study_with_database_backend_and_simple_sampler(catboost_base_model)

Test CatBoost optuna study creation with database backend and simple sampler with seed.

test_catboost_create_optuna_study_sampler_save_error_handling(catboost_base_model)

Test CatBoost error handling when sampler state saving fails.

class bluecast.tests.test_base_classes.TestBaseClassesIntegration

Integration tests for base classes functionality.

test_xgboost_database_backend_file_creation_with_error_handling()

Test database backend creation with error handling for permission issues.

test_sampler_replacement_strategy_with_simple_sampler()

Test that .db is correctly replaced with _sampler.pkl in path.

test_study_kwargs_construction()

Test that study kwargs are constructed correctly.

test_tpe_sampler_behavior_documentation()

Test to document the current TPESampler behavior (no accessible seed attribute).