Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

axVal2Index doesn't throw error, when there are two identical values by fuzzy=false #77

Open
felixcremer opened this issue Sep 1, 2021 · 0 comments

Comments

@felixcremer
Copy link
Member

I am testing the Axis functions and I found, that axVal2Index only throws an error, when it finds a fuzzy match for multiple objects, and not when it finds a perfect match for multiple objects. I am not sure, how problematic it is, but I find it odd.

julia>     multiplevalax = CategoricalAxis("MultVal", ["One", "Two", "One"])
MultVal             Axis with 3 elements: One Two One 

julia> YAXArrays.Cubes.Axes.axVal2Index(multiplevalax, "One", fuzzy=true)
1

julia> YAXArrays.Cubes.Axes.axVal2Index(multiplevalax, "one", fuzzy=true)
ERROR: Could not find unique value of one in MultVal             Axis with 3 elements: One Two One 
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] axVal2Index(axis::CategoricalAxis{String, :MultVal, Vector{String}}, v::String; fuzzy::Bool)
   @ YAXArrays.Cubes.Axes ~/.julia/dev/YAXArrays/src/Cubes/Axes.jl:167
 [3] top-level scope
   @ REPL[287]:1
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

No branches or pull requests

1 participant