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

Contradiction in plot_topoplot signature #227

Closed
vladdez opened this issue Aug 12, 2024 · 6 comments · Fixed by #219
Closed

Contradiction in plot_topoplot signature #227

vladdez opened this issue Aug 12, 2024 · 6 comments · Fixed by #219
Labels
bug Something isn't working question Further information is requested

Comments

@vladdez
Copy link
Collaborator

vladdez commented Aug 12, 2024

Why I see this error

julia>     plot_topoplot(dat[:, 50, 1])
ERROR: AssertionError: No positions found, did you forget to provide them via positions=XX, or labels=YY?

if according to signature positions are kwargs plot_topoplot(data; positions = nothing, labels = nothing, kwargs...)?
Some logical error here

@vladdez vladdez added bug Something isn't working question Further information is requested labels Aug 12, 2024
@vladdez
Copy link
Collaborator Author

vladdez commented Aug 12, 2024

#219

@behinger
Copy link
Member

A comment form the off: this behavior mimicks topoplots.jl behavior where positions is a positional argument as well.

If we change it here, we could also change it there. There reason it is not one in topo plots.jl, is that the second positional argument is "labels", not sure we support the labels still?

@vladdez
Copy link
Collaborator Author

vladdez commented Aug 13, 2024

  1. can I implement that? (actually I already did 😅)
  2. what do you mean by support? UM or Topoplots? Labels as i remember do not work in the last one since a long time.

@vladdez vladdez mentioned this issue Aug 14, 2024
@vladdez vladdez changed the title Contradiction in plot_opoplot signature Contradiction in plot_topoplot signature Aug 14, 2024
@behinger
Copy link
Member

behinger commented Sep 2, 2024

So right now you should be able to do:

plot_topoplots(data;positions=pos)
or
plot_topoplot(data;labels=labels)

Whereas in TopoPlots.jl afaik the interface is crap:
eeg_topoplot(data::Vector{<: Real}, labels::Vector{<: AbstractString})

and you have to provide dummy labels if you don't have them (which I think should change - but communication there is a difficult to say the least).

Now we could say we want to have positions as a positional argument, but I dont yet see the reason why we would want that.

@vladdez
Copy link
Collaborator Author

vladdez commented Sep 4, 2024

So there are only two options:

  1. we adjust to signature in TopoPlots.jl
  2. Topoplots.jl will change their signature

Which is better then?
P.S. of course we can keep it as it is, but it is will be just a source of constant errors.

@behinger
Copy link
Member

behinger commented Sep 4, 2024

I thought about it again: I really think labels as keyword and positions as positional is the best way to go.

I will make a PR for TopoPlots.jl

vladdez added a commit that referenced this issue Sep 11, 2024
fixed issues with more general data input #213:
- data inputs for `plot_channelimage(::DataFrame)`, `plot_erpgrid(::DataFrame)`, `plot_parallelcoordinates(::Matrix)`, `plot_topoplot(::Vector)`
- mistakes in signatures for `plot_butterfly` and `plot_erp`, moving some actions inside code from signatures
- updated docstrings
- adding sorting methods in arguments for channel image, arguments `sorting_variables` and `sorting_reverse`
- more tests for checking length mismatch of arguments in `plot_topoplot`, `plot_erpgrid` and `plot_channelimage`
- adding `ch_names::Vector{String}` into arguments for `plot_erpgrid`

Other
- fixed #227 
- fixed #218 
- fixed #221 
- typos in docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants