JuliaPlots/Plots.jl

[FR] `append!` cannot accept collections (as would be expected from the name)

Open

#4 825 ouverte le 19 sept. 2023

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)Julia (381 forks)batch import
enhancementgood first issue

Métriques du dépôt

Stars
 (1 943 stars)
Métriques de merge PR
 (Merge moyen 13j 6h) (2 PRs mergées en 30 j)

Description

The signature of the append! method through which all others pass accepts only Real..., meaning it cannot actually add multiple datapoints to a series. It is my understanding that in Julia, append! is generally meant to be the bulk equivalent of push!, but because of this signature, append! for plots is just a less flexible version of push!.

The problematic method definition: https://github.com/JuliaPlots/Plots.jl/blob/7cd27c470e10d8364ab935935eb58a97eae55ce3/src/utils.jl#L810C1-L810C90 image

If I understand correctly, just making the type of args less restrictive, to include vectors, would fix this. The signature of the previous method should probably also be changed for consistency but that would be a breaking change.

Guide contributeur