Skip to content

Fix issues #224 and #225: Parallel Documentation and add Unit Tests#283

Open
kshitij-maths wants to merge 4 commits intomathLab:masterfrom
kshitij-maths:parallel-docs-test
Open

Fix issues #224 and #225: Parallel Documentation and add Unit Tests#283
kshitij-maths wants to merge 4 commits intomathLab:masterfrom
kshitij-maths:parallel-docs-test

Conversation

@kshitij-maths
Copy link
Copy Markdown
Member

Description

This PR resolves the issues found in the Parallel Reduced Order Model (ROM) module. It modernizes the ezyrb.parallel implementation to align with the current EZyRB (v1.3.3) API and introduces a dedicated unit test suite.

Fixes and Improvements

1. API Synchronization (#224)

  • Attribute Update: Replaced deprecated .parameters and .snapshots calls with parameters_matrix and snapshots_matrix to match the core Database structure.
  • Matrix Orientation: Implemented the "Transpose Sandwich" in the fit() and predict() methods. This ensures that data is passed to the POD and RBF engines in the correct $(n_features, n_samples)$ orientation.
  • Signature Cleanup: Removed legacy arguments (scaler_red, database) from internal method calls that were causing TypeError during parallel task distribution.

2. Documentation & Quality (#225)

  • Mathematical Docstrings: Added LaTeX-formatted documentation to the predict() method $(\mu \in \mathbb{R}^d \rightarrow u(\mu)).$
  • Future-Proofing: Updated Delaunay imports from scipy.spatial.qhull to scipy.spatial to maintain compatibility with SciPy 2.0.
  • New Test Suite: Created tests/test_parallel.py which covers:
    • test_initialization: Verifies proper object construction and attribute mapping.
    • test_fit: Confirms the parallel training workflow and generation of reduction modes.
    • test_predict_scalar: Tests the "Transpose Sandwich" logic for a single parametric input.
    • test_predict_db: Mathematically verifies accuracy by predicting a full database and comparing against original snapshots.
    • test_wrong_dimensions: Ensures the model correctly raises exceptions for mismatched input data.

Verification Results

pytest -v tests/test_parallel.py

  • Result: 5/5 parallel tests passed.

Related Issues

This PR resolves issues #224 and #225

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