Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,18 @@ jobs:
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
- uses: coverallsapp/github-action@master
- uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info
files: lcov.info
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
finish:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
1 change: 0 additions & 1 deletion src/metadata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const typemap = Dict{Tuple{Char, Int}, DataType}(
('U', 1) => Char,
)
sizemapf(x::Type{<:Number}) = sizeof(x)
sizemapf(x::Type{<:Complex{T}}) where T = sizeof(T)
typecharf(::Type{<:Signed}) = 'i'
typecharf(::Type{<:Unsigned}) = 'u'
typecharf(::Type{<:AbstractFloat}) = 'f'
Expand Down
22 changes: 17 additions & 5 deletions test/python.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ numeric_dtypes = (UInt8, UInt16, UInt32, UInt64,
dtypes = (numeric_dtypes...,
MaxLengthString{10,UInt8},MaxLengthString{10,UInt32},
String)
dtypesp = ("uint8","uint16","uint32","uint64",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably does not matter too much for testing, but should these globals be const or at least have a type binding?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, they could also be Vector{String} instead of tuples.
I wonder which is faster for the compiler.

"int8","int16","int32","int64",
"float16","float32","float64",
"complex64", "complex128","bool","S10","U10", "O")
compressors = (
"no"=>NoCompressor(),
"blosc"=>BloscCompressor(cname="zstd"),
Expand Down Expand Up @@ -79,6 +83,19 @@ open(pjulia*".zip";write=true) do io
Zarr.writezip(io, g)
end

@testset "reading in julia" begin
g = zopen(pjulia)
#Test group attributes
@test g.attrs == groupattrs
for (t, co) in Iterators.product(dtypes, compressors)
compstr,comp = co
arname = string("a",t,compstr)
ar = g[arname]
@test ar.attrs == Dict("This is a nested attribute"=>Dict("a"=>5))
@test ar == testarrays[t]
end
end

# Test reading in python
for julia_path in (pjulia, pjulia*".zip")
g = zarr.open_group(julia_path)
Expand All @@ -89,11 +106,6 @@ for julia_path in (pjulia, pjulia*".zip")
@test gatts["Int attribute"] == 5
@test gatts["Float attribute"] == 10.5

dtypesp = ("uint8","uint16","uint32","uint64",
"int8","int16","int32","int64",
"float16","float32","float64",
"complex64", "complex128","bool","S10","U10", "O")

#Test accessing arrays from python and reading data
for i=1:length(dtypes), co in compressors
compstr,comp = co
Expand Down
Loading