(Feature suggestion) SortedMultiSet
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Bắt đầu bằng cách xem xét các triển khai SortedSet và SortedMultiDict hiện có cùng các API của chúng. Xác định SortedMultiSet nên xử lý các khóa so sánh trùng lặp, việc chèn/xóa/tìm kiếm hiệu quả và việc xóa theo giá trị như thế nào; issue không xác định các tệp hoặc bài kiểm thử, vì vậy cần có sự thống nhất với maintainer về tiêu chí hoàn thành.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I think that this package is missing a SortedMultiSet type. As an example, let's say we want to collect a list of persons, sorted by age, as stored in an ages dictionary:
ages = Dict(:bob => 1, :sam => 2, :joe => 1)
and perform efficient insertions/deletions and searching on this list. My first reflex is using a SortedSet for this; however: SortedSet(keys(ages), Base.Order.By(x->ages[x])) merges the keys :bob: and :joe. (*)
There are two ways to work around this limitation right now:
SortedSet((age, person) for (person, age) in ages);SortedMultiDict(age => person for (person, age) in ages).
However, both of them are somewhat memory-inefficient (they store information equivalent to a full copy of the ages database, as well as quite cumbersome to use (neither implementation allows a simple delete!(set, :bob) call). The second inconvenient may be fixed by writing a simple wrapper over either type (possibly the SortedMultiDict, which is somewhat more efficient), but the first one cannot be fixed except by writing a new structure.
(Also, keep in mind that the example I gave here is of course much simplified. In particular, the comparison values are numbers, and thus quite compact in memory. There could probably be some use cases where the comparison keys are big data structures, hence the fact that we don't want to copy all of them).
(*) in my view this is simply a bad design choice in the definition of SortedSet, because only equal values should be merged, i.e. a set should be allowed to be sorted according to a preorder, but it is likely much too late to change this.
- Ngôn ngữ chính
- Julia
- Star
- 747
- Fork
- 261
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của JuliaCollections/DataStructures.jl
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
append!(l1::MutableLinkedList, l2::MutableLinkedList) fails for empty l2Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
JuliaCollections/DataStructures.jl#997 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
several `mutable struct` type definitions do not require mutability, review and adjustCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Tất cả issue của JuliaCollections/DataStructures.jl
Issue tương tự
-
lux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
JuliaGraphs/GraphNeuralNetworks.jl#732 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
Add project: Typst_jll.jlCó thể đã có người làm @github-actions đã nhận 1 ngày trước. Đang mởadd-project
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
YDX-2147483647/best-of-typst#590 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100