From 4f02821980136485bf665afd5481bff0eb14ef59 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Tue, 7 Nov 2023 15:19:26 +0100 Subject: [PATCH 01/20] create julia_helpers.jl * a helper to convert Julia Awkward array to Python --- src/pycall/julia_helpers.jl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/pycall/julia_helpers.jl diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl new file mode 100644 index 0000000..39478ae --- /dev/null +++ b/src/pycall/julia_helpers.jl @@ -0,0 +1,25 @@ +using PyCall +using AwkwardArray + +const ak = pyimport("awkward") +const np = pyimport("numpy") + +function julia_array_to_numpy(array) + py_array = PyObject(array) + np.array(py_array) +end + +### convert a Julia AwkwardArray to a Python Awkward Array +### via buffers +function julia_array_to_python(array) + form, len, containers = AwkwardArray.to_buffers(array) + + numpy_arrays = Dict{String, Any}() + + for (key, value) in containers + numpy_arrays[key] = np.array(value, dtype=np.uint8) + end + + ### a bytes-like object is required + return ak.from_buffers(form, len, numpy_arrays) +end From 6471bb2a73cc8b1805ed0252c0a8d9450289dcc2 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Tue, 7 Nov 2023 16:26:30 +0100 Subject: [PATCH 02/20] type lock to a PrimitiveArray --- src/pycall/julia_helpers.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl index 39478ae..9bc755b 100644 --- a/src/pycall/julia_helpers.jl +++ b/src/pycall/julia_helpers.jl @@ -1,10 +1,11 @@ using PyCall using AwkwardArray +using AwkwardArray: PrimitiveArray const ak = pyimport("awkward") const np = pyimport("numpy") -function julia_array_to_numpy(array) +function julia_array_to_numpy(array::PrimitiveArray) py_array = PyObject(array) np.array(py_array) end From 8c12c515663b91c963b8d7714af6732335ce74da Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Tue, 7 Nov 2023 16:49:44 +0100 Subject: [PATCH 03/20] fix: use np.asarray --- src/pycall/julia_helpers.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl index 9bc755b..18c312a 100644 --- a/src/pycall/julia_helpers.jl +++ b/src/pycall/julia_helpers.jl @@ -18,7 +18,7 @@ function julia_array_to_python(array) numpy_arrays = Dict{String, Any}() for (key, value) in containers - numpy_arrays[key] = np.array(value, dtype=np.uint8) + numpy_arrays[key] = np.asarray(value, dtype=np.uint8) end ### a bytes-like object is required From 9db61ebc08e43d1c74bf6d7682fc0db3ef1d94ea Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 9 Nov 2023 10:29:12 +0100 Subject: [PATCH 04/20] convert only vectors of uint8 --- src/pycall/julia_helpers.jl | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl index 18c312a..e3a5ff8 100644 --- a/src/pycall/julia_helpers.jl +++ b/src/pycall/julia_helpers.jl @@ -1,26 +1,22 @@ using PyCall using AwkwardArray -using AwkwardArray: PrimitiveArray const ak = pyimport("awkward") const np = pyimport("numpy") -function julia_array_to_numpy(array::PrimitiveArray) +function _as_numpy(array::AbstractVector{UInt8}) py_array = PyObject(array) - np.array(py_array) + np.array(py_array, dtype=np.uint8) end -### convert a Julia AwkwardArray to a Python Awkward Array -### via buffers function julia_array_to_python(array) form, len, containers = AwkwardArray.to_buffers(array) - numpy_arrays = Dict{String, Any}() + py_buffers = Dict{String, Any}() - for (key, value) in containers - numpy_arrays[key] = np.asarray(value, dtype=np.uint8) + for (key, buffer) in containers + numpy_arrays[key] = _as_numpy(buffer) end - ### a bytes-like object is required - return ak.from_buffers(form, len, numpy_arrays) + return ak.from_buffers(form, len, py_buffers) end From 51400df75400d532b7df26d0829ea88623261c9e Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 9 Nov 2023 10:32:26 +0100 Subject: [PATCH 05/20] use np.asarray instead --- src/pycall/julia_helpers.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl index e3a5ff8..52f9ed2 100644 --- a/src/pycall/julia_helpers.jl +++ b/src/pycall/julia_helpers.jl @@ -6,7 +6,7 @@ const np = pyimport("numpy") function _as_numpy(array::AbstractVector{UInt8}) py_array = PyObject(array) - np.array(py_array, dtype=np.uint8) + np.asarray(py_array, dtype=np.uint8) end function julia_array_to_python(array) From 858fb0b8bec6d8ba4a0f663672fab856410e7210 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 9 Nov 2023 10:34:54 +0100 Subject: [PATCH 06/20] check if PyCall is installed --- src/pycall/julia_helpers.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl index 52f9ed2..4e97eea 100644 --- a/src/pycall/julia_helpers.jl +++ b/src/pycall/julia_helpers.jl @@ -1,3 +1,8 @@ +if !haskey(Pkg.installed(), "PyCall") + println("PyCall is not installed. Installing...") + Pkg.add("PyCall") +end + using PyCall using AwkwardArray From b3ed9fe7ba5065ab5a6b7839d4788353a97a05ff Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 9 Nov 2023 10:38:23 +0100 Subject: [PATCH 07/20] check PyCall installation --- src/pycall/julia_helpers.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl index 4e97eea..6c75230 100644 --- a/src/pycall/julia_helpers.jl +++ b/src/pycall/julia_helpers.jl @@ -1,4 +1,6 @@ -if !haskey(Pkg.installed(), "PyCall") +import Pkg + +if !haskey(Pkg.installed(), "PyCall") # FIXME: Pkg.installed() is deprecated! println("PyCall is not installed. Installing...") Pkg.add("PyCall") end From ba38b107fe7e1f7ff9d3de318fc456e7a93965a8 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 9 Nov 2023 10:45:37 +0100 Subject: [PATCH 08/20] check for PyCall in Main? --- src/pycall/julia_helpers.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl index 6c75230..2fb5303 100644 --- a/src/pycall/julia_helpers.jl +++ b/src/pycall/julia_helpers.jl @@ -1,6 +1,6 @@ import Pkg -if !haskey(Pkg.installed(), "PyCall") # FIXME: Pkg.installed() is deprecated! +if !isdefined(Main, :PyCall) println("PyCall is not installed. Installing...") Pkg.add("PyCall") end From b4658d00d045918f0e4b8dea942edf42f00d342e Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 9 Nov 2023 10:49:44 +0100 Subject: [PATCH 09/20] move the import in --- src/pycall/julia_helpers.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl index 2fb5303..fab3c5d 100644 --- a/src/pycall/julia_helpers.jl +++ b/src/pycall/julia_helpers.jl @@ -1,7 +1,8 @@ -import Pkg - if !isdefined(Main, :PyCall) println("PyCall is not installed. Installing...") + + import Pkg + Pkg.add("PyCall") end From 7c117d85b7bb9e383a0a5cc26b3d7459502d15a6 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 9 Nov 2023 10:52:23 +0100 Subject: [PATCH 10/20] Update and rename julia_helpers.jl to AwkwardPyCall.jl --- src/pycall/AwkwardPyCall.jl | 27 +++++++++++++++++++++++++++ src/pycall/julia_helpers.jl | 30 ------------------------------ 2 files changed, 27 insertions(+), 30 deletions(-) delete mode 100644 src/pycall/julia_helpers.jl diff --git a/src/pycall/AwkwardPyCall.jl b/src/pycall/AwkwardPyCall.jl index a4e8f67..1e002c6 100644 --- a/src/pycall/AwkwardPyCall.jl +++ b/src/pycall/AwkwardPyCall.jl @@ -1,7 +1,19 @@ module AwkwardPyCall +<<<<<<< HEAD using PyCall using JSON +======= +if !isdefined(Main, :PyCall) + println("PyCall is not installed. Installing...") + + import Pkg + + Pkg.add("PyCall") +end + +using PyCall +>>>>>>> bd3c0dd (Update and rename julia_helpers.jl to AwkwardPyCall.jl) using AwkwardArray const ak = pyimport("awkward") @@ -9,20 +21,33 @@ const np = pyimport("numpy") function _as_numpy(array::AbstractVector{UInt8}) py_array = PyObject(array) +<<<<<<< HEAD np.asarray(py_array, dtype = np.uint8) +======= + np.asarray(py_array, dtype=np.uint8) +>>>>>>> bd3c0dd (Update and rename julia_helpers.jl to AwkwardPyCall.jl) end function julia_array_to_python(array) form, len, containers = AwkwardArray.to_buffers(array) +<<<<<<< HEAD py_buffers = Dict{String,Any}() for (key, buffer) in containers py_buffers[key] = _as_numpy(buffer) +======= + + py_buffers = Dict{String, Any}() + + for (key, buffer) in containers + numpy_arrays[key] = _as_numpy(buffer) +>>>>>>> bd3c0dd (Update and rename julia_helpers.jl to AwkwardPyCall.jl) end return ak.from_buffers(form, len, py_buffers) end +<<<<<<< HEAD function _as_julia(py_buffer) uint8_buffer = reinterpret(UInt8, py_buffer) @@ -41,3 +66,5 @@ function python_array_to_julia(py_array) end end # module +======= +>>>>>>> bd3c0dd (Update and rename julia_helpers.jl to AwkwardPyCall.jl) diff --git a/src/pycall/julia_helpers.jl b/src/pycall/julia_helpers.jl deleted file mode 100644 index fab3c5d..0000000 --- a/src/pycall/julia_helpers.jl +++ /dev/null @@ -1,30 +0,0 @@ -if !isdefined(Main, :PyCall) - println("PyCall is not installed. Installing...") - - import Pkg - - Pkg.add("PyCall") -end - -using PyCall -using AwkwardArray - -const ak = pyimport("awkward") -const np = pyimport("numpy") - -function _as_numpy(array::AbstractVector{UInt8}) - py_array = PyObject(array) - np.asarray(py_array, dtype=np.uint8) -end - -function julia_array_to_python(array) - form, len, containers = AwkwardArray.to_buffers(array) - - py_buffers = Dict{String, Any}() - - for (key, buffer) in containers - numpy_arrays[key] = _as_numpy(buffer) - end - - return ak.from_buffers(form, len, py_buffers) -end From ac22346a3472c90411e23e86300092cfe4a2322c Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 9 Nov 2023 10:56:38 +0100 Subject: [PATCH 11/20] try reexport AwkwardArray --- src/pycall/AwkwardPyCall.jl | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/pycall/AwkwardPyCall.jl b/src/pycall/AwkwardPyCall.jl index 1e002c6..a4e8f67 100644 --- a/src/pycall/AwkwardPyCall.jl +++ b/src/pycall/AwkwardPyCall.jl @@ -1,19 +1,7 @@ module AwkwardPyCall -<<<<<<< HEAD using PyCall using JSON -======= -if !isdefined(Main, :PyCall) - println("PyCall is not installed. Installing...") - - import Pkg - - Pkg.add("PyCall") -end - -using PyCall ->>>>>>> bd3c0dd (Update and rename julia_helpers.jl to AwkwardPyCall.jl) using AwkwardArray const ak = pyimport("awkward") @@ -21,33 +9,20 @@ const np = pyimport("numpy") function _as_numpy(array::AbstractVector{UInt8}) py_array = PyObject(array) -<<<<<<< HEAD np.asarray(py_array, dtype = np.uint8) -======= - np.asarray(py_array, dtype=np.uint8) ->>>>>>> bd3c0dd (Update and rename julia_helpers.jl to AwkwardPyCall.jl) end function julia_array_to_python(array) form, len, containers = AwkwardArray.to_buffers(array) -<<<<<<< HEAD py_buffers = Dict{String,Any}() for (key, buffer) in containers py_buffers[key] = _as_numpy(buffer) -======= - - py_buffers = Dict{String, Any}() - - for (key, buffer) in containers - numpy_arrays[key] = _as_numpy(buffer) ->>>>>>> bd3c0dd (Update and rename julia_helpers.jl to AwkwardPyCall.jl) end return ak.from_buffers(form, len, py_buffers) end -<<<<<<< HEAD function _as_julia(py_buffer) uint8_buffer = reinterpret(UInt8, py_buffer) @@ -66,5 +41,3 @@ function python_array_to_julia(py_array) end end # module -======= ->>>>>>> bd3c0dd (Update and rename julia_helpers.jl to AwkwardPyCall.jl) From 8bfc234066c68ba5f96f25947b8a16c1db0e5af0 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Mon, 20 Nov 2023 18:14:58 +0100 Subject: [PATCH 12/20] Update AwkwardPyCall.jl --- src/pycall/AwkwardPyCall.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pycall/AwkwardPyCall.jl b/src/pycall/AwkwardPyCall.jl index a4e8f67..eef9fe9 100644 --- a/src/pycall/AwkwardPyCall.jl +++ b/src/pycall/AwkwardPyCall.jl @@ -1,6 +1,7 @@ module AwkwardPyCall using PyCall + using JSON using AwkwardArray From 7d1d8ce4069490969fb530628f4ab2812ffde879 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Wed, 22 Nov 2023 12:27:57 +0100 Subject: [PATCH 13/20] test: add tests --- src/pycall/AwkwardPyCall.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pycall/AwkwardPyCall.jl b/src/pycall/AwkwardPyCall.jl index eef9fe9..d31ff33 100644 --- a/src/pycall/AwkwardPyCall.jl +++ b/src/pycall/AwkwardPyCall.jl @@ -1,7 +1,5 @@ module AwkwardPyCall - using PyCall - using JSON using AwkwardArray From 66d193aa2154d070ec3f6399e1e3a777faa75875 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Mon, 27 Nov 2023 14:53:09 +0100 Subject: [PATCH 14/20] fix: remove global constants --- src/pycall/AwkwardPyCall.jl | 9 +++------ test/runpytests.jl | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/pycall/AwkwardPyCall.jl b/src/pycall/AwkwardPyCall.jl index d31ff33..0654bec 100644 --- a/src/pycall/AwkwardPyCall.jl +++ b/src/pycall/AwkwardPyCall.jl @@ -3,12 +3,9 @@ using PyCall using JSON using AwkwardArray -const ak = pyimport("awkward") -const np = pyimport("numpy") - function _as_numpy(array::AbstractVector{UInt8}) py_array = PyObject(array) - np.asarray(py_array, dtype = np.uint8) + pyimport("numpy").asarray(py_array, dtype = pyimport("numpy").uint8) end function julia_array_to_python(array) @@ -20,7 +17,7 @@ function julia_array_to_python(array) py_buffers[key] = _as_numpy(buffer) end - return ak.from_buffers(form, len, py_buffers) + return pyimport("awkward").from_buffers(form, len, py_buffers) end function _as_julia(py_buffer) @@ -29,7 +26,7 @@ function _as_julia(py_buffer) end function python_array_to_julia(py_array) - form, len, containers = ak.to_buffers(py_array) + form, len, containers = pyimport("awkward").to_buffers(py_array) julia_buffers = Dict{String,AbstractVector{UInt8}}() for (key, buffer) in containers diff --git a/test/runpytests.jl b/test/runpytests.jl index ad55339..8b21a3d 100644 --- a/test/runpytests.jl +++ b/test/runpytests.jl @@ -22,8 +22,6 @@ using JSON include("../src/pycall/AwkwardPyCall.jl") -import Main.AwkwardPyCall: ak - import Main.AwkwardPyCall: julia_array_to_python # Test julia_array_to_python function @@ -38,14 +36,16 @@ import Main.AwkwardPyCall: julia_array_to_python # Test case 2: Check if the awkward array has the correct layout py_array = julia_array_to_python(array) @test typeof(py_array) == PyObject - @test ak.to_list(py_array) == [[1.1, 2.2, 3.3], [], [4.4, 5.5]] + @test pyimport("awkward").to_list(py_array) == [[1.1, 2.2, 3.3], [], [4.4, 5.5]] + + end import Main.AwkwardPyCall: python_array_to_julia # Test python_array_to_julia function @testset "python_array_to_julia tests" begin - py_array = ak.Array([[1.1, 2.2, 3.3], [], [4.4, 5.5]]) + py_array = pyimport("awkward").Array([[1.1, 2.2, 3.3], [], [4.4, 5.5]]) # Test case 1: Check if the function returns an awkward array @test isa( From d246290cadf88c35113b11425aeed6de75acf965 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Mon, 27 Nov 2023 17:29:10 +0100 Subject: [PATCH 15/20] fix: cleanup --- .github/workflows/CI.yml | 11 ++++------- test/runpytests.jl | 12 ------------ test/runtests.jl | 3 +++ 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e9cbeb3..dc6ac30 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -50,11 +50,6 @@ jobs: - name: Build Julia package uses: julia-actions/julia-buildpkg@v1 - - name: Run Julia tests - uses: julia-actions/julia-runtest@v1 - with: - project: . - - name: Install Python dependencies run: | python -m pip install -r requirements/pycall.txt @@ -62,8 +57,10 @@ jobs: - name: Install PyCall dependencies run: julia -e 'import Pkg; Pkg.add("PyCall"); Pkg.build("PyCall")' - - name: Run PyCall tests - run: julia --code-coverage --project=tests test/runpytests.jl + - name: Run Julia tests + uses: julia-actions/julia-runtest@v1 + with: + project: . - name: Generate and upload code coverage uses: julia-actions/julia-processcoverage@v1 diff --git a/test/runpytests.jl b/test/runpytests.jl index 8b21a3d..ba35789 100644 --- a/test/runpytests.jl +++ b/test/runpytests.jl @@ -3,18 +3,6 @@ using Test using Pkg -# FIXME: remove after AwkwardArray is released -function add_unreleased_AwkwardArray_package() - # Specify the Git URL of the AwkwardArray package - git_url = "https://github.com/JuliaHEP/AwkwardArray.jl" - - # Use Pkg to add the package - Pkg.add(PackageSpec(url = git_url)) -end - -# Call the function to add the unreleased AwkwardArray package -add_unreleased_AwkwardArray_package() - using AwkwardArray Pkg.add("JSON") diff --git a/test/runtests.jl b/test/runtests.jl index ff3dc20..83a8a43 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3166,4 +3166,7 @@ end @test df.x == AwkwardArray.to_vector(awt[:x]) @test df.y == AwkwardArray.to_vector(awt[:y]) end + + include("./runpytests.jl") + end # @testset "AwkwardArray.jl" From 3693a211add9385cb5ce9d52a6104c841e5474be Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Mon, 27 Nov 2023 17:58:00 +0100 Subject: [PATCH 16/20] fix: add PyCall --- test/runpytests.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/runpytests.jl b/test/runpytests.jl index ba35789..2ae8320 100644 --- a/test/runpytests.jl +++ b/test/runpytests.jl @@ -8,6 +8,9 @@ using AwkwardArray Pkg.add("JSON") using JSON +Pkg.add("PyCall") +using PyCall + include("../src/pycall/AwkwardPyCall.jl") import Main.AwkwardPyCall: julia_array_to_python From 5b8370b914269ab3e692f93413fc38c2c48bddf8 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Tue, 28 Nov 2023 10:03:21 +0100 Subject: [PATCH 17/20] fix: revert changes --- .github/workflows/CI.yml | 3 +++ test/runtests.jl | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index dc6ac30..f57ee91 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -57,6 +57,9 @@ jobs: - name: Install PyCall dependencies run: julia -e 'import Pkg; Pkg.add("PyCall"); Pkg.build("PyCall")' + - name: Run PyCall tests + run: julia --code-coverage --project=tests test/runpytests.jl + - name: Run Julia tests uses: julia-actions/julia-runtest@v1 with: diff --git a/test/runtests.jl b/test/runtests.jl index 83a8a43..7bfa93f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3167,6 +3167,4 @@ end @test df.y == AwkwardArray.to_vector(awt[:y]) end - include("./runpytests.jl") - end # @testset "AwkwardArray.jl" From de9addf28485c62cd1adc033bd130f11a813cf5e Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Tue, 28 Nov 2023 10:07:26 +0100 Subject: [PATCH 18/20] fix: add AwkwardArray --- test/runpytests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/runpytests.jl b/test/runpytests.jl index 2ae8320..bae5c88 100644 --- a/test/runpytests.jl +++ b/test/runpytests.jl @@ -3,6 +3,7 @@ using Test using Pkg +Pkg.add("AwkwardArray") using AwkwardArray Pkg.add("JSON") From 7ef8e6c29e2358ffa76ab7ca871dec25954cb531 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Tue, 28 Nov 2023 10:11:32 +0100 Subject: [PATCH 19/20] fix: include AwkwardArray --- test/runpytests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runpytests.jl b/test/runpytests.jl index bae5c88..4615f55 100644 --- a/test/runpytests.jl +++ b/test/runpytests.jl @@ -3,7 +3,7 @@ using Test using Pkg -Pkg.add("AwkwardArray") +include("../src/AwkwardArray.jl") using AwkwardArray Pkg.add("JSON") From 49e3b7be154e6cac0ceb45fd57488c02419793de Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Tue, 28 Nov 2023 10:22:14 +0100 Subject: [PATCH 20/20] fix: revert changes --- .github/workflows/CI.yml | 10 +++++----- test/runpytests.jl | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f57ee91..e9cbeb3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -50,6 +50,11 @@ jobs: - name: Build Julia package uses: julia-actions/julia-buildpkg@v1 + - name: Run Julia tests + uses: julia-actions/julia-runtest@v1 + with: + project: . + - name: Install Python dependencies run: | python -m pip install -r requirements/pycall.txt @@ -60,11 +65,6 @@ jobs: - name: Run PyCall tests run: julia --code-coverage --project=tests test/runpytests.jl - - name: Run Julia tests - uses: julia-actions/julia-runtest@v1 - with: - project: . - - name: Generate and upload code coverage uses: julia-actions/julia-processcoverage@v1 diff --git a/test/runpytests.jl b/test/runpytests.jl index 4615f55..8b21a3d 100644 --- a/test/runpytests.jl +++ b/test/runpytests.jl @@ -3,15 +3,23 @@ using Test using Pkg -include("../src/AwkwardArray.jl") +# FIXME: remove after AwkwardArray is released +function add_unreleased_AwkwardArray_package() + # Specify the Git URL of the AwkwardArray package + git_url = "https://github.com/JuliaHEP/AwkwardArray.jl" + + # Use Pkg to add the package + Pkg.add(PackageSpec(url = git_url)) +end + +# Call the function to add the unreleased AwkwardArray package +add_unreleased_AwkwardArray_package() + using AwkwardArray Pkg.add("JSON") using JSON -Pkg.add("PyCall") -using PyCall - include("../src/pycall/AwkwardPyCall.jl") import Main.AwkwardPyCall: julia_array_to_python