Add comprehensive test suite for lorepy plotting functions #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR significantly expands the test coverage for the lorepy package by adding a comprehensive test suite with 50+ test cases covering all major functions and edge cases.
Key Changes
New Test Infrastructure (
tests/conftest.py)binary_sample_data: Two-class classification dataset with confoundersmulticlass_sample_data: Three-class classification datasetdata_with_nan: Dataset with missing values for NaN handling testssmall_deterministic_data: Small, reproducible dataset for precise testingfitted_logistic_model/fitted_multiclass_model: Pre-fitted classifierssingle_class_data,empty_dataframe: Edge case datasetsstring_class_labels: Non-integer class labelscustom_colormap: Matplotlib colormap for visualization testsExpanded Test Coverage (
tests/test_plot.py)Reorganized and expanded from ~130 to ~523 lines with structured test classes:
TestPrepareData (7 tests)
TestGetAreaDf (7 tests)
TestGetDotsDf (7 tests)
TestLoreplot (15 tests)
TestEdgeCases (8 tests)
Implementation Details
https://claude.ai/code/session_01VQDpjboqTU7pr11X9tVWCX