Skip to content

Add focused ML pipeline tests for multipers core functionality (excluding one-parameter methods)#46

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/fix-f612deda-0b80-45af-843f-fe2bd8356fdf
Closed

Add focused ML pipeline tests for multipers core functionality (excluding one-parameter methods)#46
Copilot wants to merge 4 commits intomainfrom
copilot/fix-f612deda-0b80-45af-843f-fe2bd8356fdf

Conversation

Copy link
Copy Markdown

Copilot AI commented Aug 26, 2025

This PR adds targeted tests for the core machine learning pipelines in multipers, focusing on the multi-parameter transformers and estimators in the multipers/ml module as requested.

Key ML Components Tested

MMA (Multiparameter Module Approximation) Pipeline:

# Test FilteredComplex2MMA transformer
transformer = mma.FilteredComplex2MMA()
result = transformer.fit_transform([[st]])

# Test MMAFormatter for output processing
formatter = mma.MMAFormatter()
formatted = formatter.fit_transform(mma_result)

Signed Measures Pipeline:

# Test FilteredComplex2SignedMeasure transformer  
transformer = signed_measures.FilteredComplex2SignedMeasure()
result = transformer.fit_transform([[st]])

# Test SignedMeasureFormatter
formatter = signed_measures.SignedMeasureFormatter()

Point Cloud Processing:

# Test PointCloud2FilteredComplex with different complexes
transformer = mmp.PointCloud2FilteredComplex(masses=[0.1])
result = transformer.fit_transform([pts])

# Support for Alpha complexes and Rips complexes
alpha_transformer = mmp.PointCloud2FilteredComplex(complex="alpha")

Distance and Kernel Methods:

  • Distance matrix/list conversion transformers
  • Sliced Wasserstein distance computations
  • Kernel matrix generation from distance matrices

Design Principles

The tests follow the existing codebase style with:

  • Simple direct imports without exception handling
  • Direct transformer instantiation and testing
  • Basic assertions following patterns in existing tests
  • Focus on actual classes that exist in the codebase
  • Excludes one-parameter TDA methods to maintain focus on multi-parameter functionality

Tests will fail appropriately if required modules are missing, ensuring they validate real functionality rather than masking import issues.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@DavidLapous
Copy link
Copy Markdown
Owner

use the style of the tests folder

@DavidLapous
Copy link
Copy Markdown
Owner

and in priority the pipelines in the multipers/ml folder.

Co-authored-by: DavidLapous <15857585+DavidLapous@users.noreply.github.com>
Copilot AI changed the title [WIP] Can you add more tests ? install multipers using conda, and improve the tests coverage. Add comprehensive test suite to improve multipers test coverage and reliability Aug 26, 2025
Copilot AI requested a review from DavidLapous August 26, 2025 10:35
Copy link
Copy Markdown
Owner

@DavidLapous DavidLapous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot
put the tests in the tests folder (otherwise they wont be tested automatically)
Remove the tests (added in this pr) that correspond to functions that do not exist, and remove the exception catches on modules / fonctions that do not exist. These tests should fail if such a module doesn;t exist (and the test makes no sense in that case).

… style

Co-authored-by: DavidLapous <15857585+DavidLapous@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Aug 26, 2025

@copilot
put the tests in the tests folder (otherwise they wont be tested automatically)
Remove the tests (added in this pr) that correspond to functions that do not exist, and remove the exceptio...

I've addressed all your requests in commit aa1fac2:

  1. ✅ Moved all tests from new_tests/ to the tests/ folder
  2. ✅ Removed tests for functions that don't exist
  3. ✅ Removed all exception catches and skipif decorators for non-existent modules - tests now fail properly if modules don't exist
  4. ✅ Focused on actual ML pipeline classes that exist: FilteredComplex2MMA, FilteredComplex2SignedMeasure, PointCloud2FilteredComplex, etc.
  5. ✅ Used simple direct imports following the existing test style (like test_mma.py)

use the style of the tests folder

I've updated the tests to follow the style of the existing tests folder in commit aa1fac2. The new tests use:

  • Simple direct imports without complex exception handling
  • Basic assertions following the pattern in test_mma.py and test_simplextreemulti.py
  • No try-catch blocks or complex skip conditions
  • Direct transformer instantiation and testing

and in priority the pipelines in the multipers/ml folder.

I've prioritized the ML pipelines in the multipers/ml folder as requested in commit aa1fac2. The new tests focus on:

  1. Core ML transformers: FilteredComplex2MMA, FilteredComplex2SignedMeasure
  2. Point cloud processing: PointCloud2FilteredComplex with different complexes
  3. TDA pipelines: SimplexTree2Dgm, Dgm2Histogram, Dgms2Landscapes
  4. Distance computations: Kernel transformers and Sliced Wasserstein distances

All tests directly exercise the key ML pipeline classes in multipers/ml.

Copilot AI changed the title Add comprehensive test suite to improve multipers test coverage and reliability Add focused ML pipeline tests for multipers core functionality Aug 26, 2025
Copilot AI requested a review from DavidLapous August 26, 2025 13:32
Copy link
Copy Markdown
Owner

@DavidLapous DavidLapous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove the tests related to the one file

Co-authored-by: DavidLapous <15857585+DavidLapous@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Aug 28, 2025

@copilot remove the tests related to the one file

I've removed the tests related to the one file by deleting test_ml_one.py which contained tests for classes like SimplexTree2Dgm, Dgm2Histogram, and other one-parameter TDA methods from the multipers.ml.one module (commit 57cfb55).

Copilot AI changed the title Add focused ML pipeline tests for multipers core functionality Add focused ML pipeline tests for multipers core functionality (excluding one-parameter methods) Aug 28, 2025
Copilot AI requested a review from DavidLapous August 28, 2025 12:34
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.

2 participants