From b7677692f3c1cc084ad8866d80e44964ae6ffffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Mon, 1 Feb 2021 14:30:24 +0100 Subject: [PATCH 1/4] Add DataAPI.invrefpool --- src/PooledArrays.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PooledArrays.jl b/src/PooledArrays.jl index cc49416..fa4b9d0 100644 --- a/src/PooledArrays.jl +++ b/src/PooledArrays.jl @@ -159,6 +159,7 @@ PooledArray(t::Type, r::Type) = PooledArray(Array(t,0), r) DataAPI.refarray(pa::PooledArray) = pa.refs DataAPI.refvalue(pa::PooledArray, i::Integer) = pa.pool[i] DataAPI.refpool(pa::PooledArray) = pa.pool +DataAPI.invrefpool(pa::PooledArray) = pa.invpool Base.size(pa::PooledArray) = size(pa.refs) Base.length(pa::PooledArray) = length(pa.refs) From de36434d00f622ce89c9891306746079244148cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Mon, 1 Feb 2021 14:31:10 +0100 Subject: [PATCH 2/4] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 1b6c1f7..16135f7 100644 --- a/Project.toml +++ b/Project.toml @@ -6,7 +6,7 @@ version = "1.0.0" DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" [compat] -DataAPI = "1" +DataAPI = "1.5" julia = "1" [extras] From 28e2389e86c259fe119f66e8e9dc509eb8c55bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Mon, 1 Feb 2021 14:32:46 +0100 Subject: [PATCH 3/4] Update runtests.jl --- test/runtests.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index a503773..60c99b7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,6 @@ using Test using PooledArrays -using DataAPI: refarray, refvalue, refpool +using DataAPI: refarray, refvalue, refpool, invrefpool @testset "PooledArrays" begin a = rand(10) @@ -87,7 +87,8 @@ using DataAPI: refarray, refvalue, refpool @test refvalue(s, refarray(s)[i]) == s[i] end @test refpool(s) == ["a", "b"] - + @test invrefpool(s) == Dict("a" => 1, "b" => 2) + @testset "push!" begin xs = PooledArray([10, 20, 30]) @test xs === push!(xs, -100) From 27b68107417afccfbc10d3ac9ae219047f2c1531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Mon, 1 Feb 2021 14:34:10 +0100 Subject: [PATCH 4/4] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 16135f7..b3036bb 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "PooledArrays" uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" -version = "1.0.0" +version = "1.1.0" [deps] DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"