Fallback `reconstruct` method provides incorrect error message

Open
#238 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
data

Research direction

Start at src/types.jl#L27, where the fallback reconstruct method is defined. Reproduce the call with a valid PCA and a y value that is not an AbstractVecOrMat, then inspect the surrounding dispatch behavior. Done means the fallback reports the invalid argument or operation accurately instead of claiming reconstruct is undefined for PCA.

Written by the indexing model from the issue text.

Description

Given a valid pca::PCA, calling reconstruct(pca, y) with y that is not an AbstractVecOrMat will call the fallback method, which errors saying

'reconstruct' is not defined for PCA{T}

when it's not true. This should be handled differently.

https://github.com/JuliaStats/MultivariateStats.jl/blob/b7dc36e8b75c897575e8b5b7e864e415b00e6445/src/types.jl#L27

Dominant language
Julia
Stars
387
Forks
83
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaStats/MultivariateStats.jl

All issues in JuliaStats/MultivariateStats.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.