Skip to content

Conversation

@anurag-mds
Copy link

@anurag-mds anurag-mds commented Dec 27, 2025

Summary

This PR addresses the issue #238 by improving the error handling in the fallback reconstruct method for dimensionality reduction models. Now, whenever it is called with an input which is not an AbstractVecOrMat of real numbers, an ArgumentError is thrown with a clear message which helps user to know the invalid input type and the expected input type.


This closes the issue #238


Approach

Following is the way of my approach which ensures users receive clear, actionable feedback and aligns with Julia's best practices for error handling.
  • Confirmed that the fallback reconstruct method previously gave a misleading error when it was called with an invalid input type.

  • Replace the generic error with a more meaningful, specific and reasonable error which clearly states the received and expected types.

  • Updated the necessary documentation and docstring for it.

  • Added and verified tests to ensure the new error is raised for invalid input types.


Tests

All tests pass.

Notes

I have attached images showing that the tests are passing

Images:


image
image
image
Feedbacks are welcome.
@anurag-mds anurag-mds closed this Dec 27, 2025
@anurag-mds anurag-mds reopened this Dec 27, 2025
@anurag-mds
Copy link
Author

Maintainers,
This PR is ready for review. It replaces a misleading fallback error in reconstruct with an explicit ArgumentError and adds tests covering invalid input types, closing #238.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant