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
48 changes: 48 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.0'
- '1'
- 'nightly'
os:
- ubuntu-latest
- windows-latest
- macos-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# StructArrays

[![Build Status](https://travis-ci.org/JuliaArrays/StructArrays.jl.svg?branch=master)](https://travis-ci.org/JuliaArrays/StructArrays.jl)
[![CI](https://github.com/JuliaArrays/StructArrays.jl/workflows/CI/badge.svg?branch=master)](https://github.com/JuliaArrays/StructArrays.jl/actions?query=workflow%3ACI+branch%3Amaster)
[![codecov.io](http://codecov.io/github/JuliaArrays/StructArrays.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaArrays/StructArrays.jl?branch=master)

This package introduces the type `StructArray` which is an `AbstractArray` whose elements are `struct` (for example `NamedTuples`, or `ComplexF64`, or a custom user defined `struct`). While a `StructArray` iterates `structs`, the layout is column based (meaning each field of the `struct` is stored in a separate `Array`).
Expand Down
37 changes: 30 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -628,12 +628,19 @@ end
io = IOBuffer()
Base.showarg(io, rows, true)
str = String(take!(io))
@test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2}) with eltype LazyRow{Complex{Float64}}"
if VERSION < v"1.6-"
@test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2}) with eltype LazyRow{Complex{Float64}}"
else
@test str == "LazyRows(::Matrix{Float64}, ::Matrix{Float64}) with eltype LazyRow{ComplexF64}"
end
io = IOBuffer()
Base.showarg(io, rows, false)
str = String(take!(io))
@test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2})"

if VERSION < v"1.6-"
@test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2})"
else
@test str == "LazyRows(::Matrix{Float64}, ::Matrix{Float64})"
end
s = StructArray((rand(10, 10), rand(10, 10)))
rows = LazyRows(s)
@test IndexStyle(rows) isa IndexLinear
Expand All @@ -653,11 +660,19 @@ end
io = IOBuffer()
Base.showarg(io, rows, true)
str = String(take!(io))
@test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2}) with eltype LazyRow{Tuple{Float64,Float64}}"
if VERSION < v"1.6-"
@test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2}) with eltype LazyRow{Tuple{Float64,Float64}}"
else
@test str == "LazyRows(::Matrix{Float64}, ::Matrix{Float64}) with eltype LazyRow{Tuple{Float64, Float64}}"
end
io = IOBuffer()
Base.showarg(io, rows, false)
str = String(take!(io))
@test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2})"
if VERSION < v"1.6-"
@test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2})"
else
@test str == "LazyRows(::Matrix{Float64}, ::Matrix{Float64})"
end
end

@testset "refarray" begin
Expand Down Expand Up @@ -687,11 +702,19 @@ end
io = IOBuffer()
Base.showarg(io, s, true)
str = String(take!(io))
@test str == "StructArray(::Array{Int64,1}, ::Array{Int64,1}) with eltype Complex{Int64}"
if VERSION < v"1.6-"
@test str == "StructArray(::Array{Int64,1}, ::Array{Int64,1}) with eltype Complex{Int64}"
else
@test str == "StructArray(::Vector{Int64}, ::Vector{Int64}) with eltype Complex{Int64}"
end
io = IOBuffer()
Base.showarg(io, s, false)
str = String(take!(io))
@test str == "StructArray(::Array{Int64,1}, ::Array{Int64,1})"
if VERSION < v"1.6-"
@test str == "StructArray(::Array{Int64,1}, ::Array{Int64,1})"
else
@test str == "StructArray(::Vector{Int64}, ::Vector{Int64})"
end
end

@testset "append!!" begin
Expand Down