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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "julia"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
20 changes: 0 additions & 20 deletions .github/workflows/jlpkgbutler-butler-workflow.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/jlpkgbutler-ci-master-workflow.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/jlpkgbutler-ci-pr-workflow.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/jlpkgbutler-codeformat-pr-workflow.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/jlpkgbutler-compathelper-workflow.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/jlpkgbutler-docdeploy-workflow.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/jlpkgbutler-tagbot-workflow.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/juliaci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Julia CI

on:
push: {branches: [main,master]}
pull_request: {types: [opened,synchronize,reopened,ready_for_review,converted_to_draft]}
issue_comment: {types: [created]}
workflow_dispatch: {inputs: {feature: {type: choice, description: What to run, options: [DocDeploy,LintAndTest,TagBot]}}}

jobs:
julia-ci:
uses: julia-testitems/testitem-workflow/.github/workflows/juliaci.yml@v2
with:
include-all-compatible-minor-versions: true
include-rc-versions: true
permissions: write-all
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
*.jl.*.cov
*.jl.mem
.vscode
docs/build/
docs/Manifest.toml
test-output*.*
Manifest.toml
1 change: 0 additions & 1 deletion .jlpkgbutler.toml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The StatFiles.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2017-2019: David Anthoff.
> Copyright (c) 2017-2026: David Anthoff.
>
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
11 changes: 6 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "StatFiles"
uuid = "1463e38c-9381-5320-bcd4-4134955f093a"
version = "0.8.1-DEV"
version = "1.0.0-DEV"

[deps]
DataValues = "e7dc6d0d-1eca-5fa6-8ad6-5aecde8b7ea5"
Expand All @@ -13,18 +13,19 @@ TableTraits = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
TableTraitsUtils = "382cd787-c1b6-5bf2-a167-d5b971a19bda"

[extras]
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Test", "TestItemRunner"]

[compat]
DataValues = "0.4.4"
DataValues = "0.4.4, 0.5, 1"
FileIO = "1"
IterableTables = "0.8.3, 0.9, 0.10, 0.11, 1"
IteratorInterfaceExtensions = "0.1.1, 1"
ReadStat = "0.4.1, 1"
TableShowUtils = "0.1.1, 0.2"
TableShowUtils = "0.1.1, 0.2, 0.3, 1"
TableTraits = "0.3.1, 0.4, 1"
TableTraitsUtils = "0.2.1, 0.3, 0.4, 1"
julia = "1"
julia = "1.3"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# StatFiles

[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![Build Status](https://travis-ci.org/queryverse/StatFiles.jl.svg?branch=master)](https://travis-ci.org/queryverse/StatFiles.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/lx7qmion1a8dggls/branch/master?svg=true)](https://ci.appveyor.com/project/queryverse/statfiles-jl/branch/master)
[![Build Status](https://github.com/queryverse/StatFiles.jl/actions/workflows/juliaci.yml/badge.svg?branch=main)](https://github.com/queryverse/StatFiles.jl/actions/workflows/juliaci.yml)
[![codecov.io](http://codecov.io/github/queryverse/StatFiles.jl/coverage.svg?branch=master)](http://codecov.io/github/queryverse/StatFiles.jl?branch=master)

## Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "~0.24"
Documenter = "1"
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ using Documenter, StatFiles
makedocs(
modules = [StatFiles],
sitename = "StatFiles.jl",
analytics="UA-132838790-1",
format = Documenter.HTML(analytics = "UA-132838790-1"),
warnonly = [:missing_docs],
pages = [
"Introduction" => "index.md"
]
Expand Down
71 changes: 3 additions & 68 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,70 +1,5 @@
using StatFiles
using IteratorInterfaceExtensions
using TableTraits
using DataValues
using Test
using TestItemRunner

@testset "StatFiles" begin
include("test_statfiles.jl")

ar = load("types.dta") |> IteratorInterfaceExtensions.getiterator |> collect

@test length(ar) == 3
@test ar[1] == (vfloat=DataValue{Float32}(3.14), vdouble=DataValue(3.14), vlong=DataValue{Int32}(2), vint=DataValue{Int16}(2), vbyte=DataValue{Int8}(2), vstring=DataValue("2"))
@test ar[2] == (vfloat=DataValue{Float32}(7.), vdouble=DataValue(7.), vlong=DataValue{Int32}(7), vint=DataValue{Int16}(7), vbyte=DataValue{Int8}(7), vstring=DataValue("7"))
@test ar[3] == (vfloat=DataValue{Float32}(), vdouble=DataValue{Float64}(), vlong=DataValue{Int32}(), vint=DataValue{Int16}(), vbyte=DataValue{Int8}(), vstring=DataValue(""))
@test TableTraits.isiterabletable(load("types.dta")) == true
@test IteratorInterfaceExtensions.isiterable(load("types.dta")) == true

ar = load("types.sas7bdat") |> IteratorInterfaceExtensions.getiterator |> collect

@test length(ar) == 3
@test ar[1] == (vfloat=DataValue{Float32}(3.14), vdouble=DataValue(3.14), vlong=DataValue{Int32}(2), vint=DataValue{Int16}(2), vbyte=DataValue{Int8}(2), vstring=DataValue("2"))
@test ar[2] == (vfloat=DataValue{Float32}(7.), vdouble=DataValue(7.), vlong=DataValue{Int32}(7), vint=DataValue{Int16}(7), vbyte=DataValue{Int8}(7), vstring=DataValue("7"))
@test ar[3] == (vfloat=DataValue{Float32}(), vdouble=DataValue{Float64}(), vlong=DataValue{Int32}(), vint=DataValue{Int16}(), vbyte=DataValue{Int8}(), vstring=DataValue(""))
@test TableTraits.isiterabletable(load("types.sas7bdat")) == true
@test IteratorInterfaceExtensions.isiterable(load("types.sas7bdat")) == true

ar = load("types.sav") |> IteratorInterfaceExtensions.getiterator |> collect

@test length(ar) == 3
@test ar[1] == (vfloat=DataValue{Float32}(3.14), vdouble=DataValue(3.14), vlong=DataValue{Int32}(2), vint=DataValue{Int16}(2), vbyte=DataValue{Int8}(2), vstring=DataValue("2"))
@test ar[2] == (vfloat=DataValue{Float32}(7.), vdouble=DataValue(7.), vlong=DataValue{Int32}(7), vint=DataValue{Int16}(7), vbyte=DataValue{Int8}(7), vstring=DataValue("7"))
@test ar[3] == (vfloat=DataValue{Float32}(), vdouble=DataValue{Float64}(), vlong=DataValue{Int32}(), vint=DataValue{Int16}(), vbyte=DataValue{Int8}(), vstring=DataValue(""))
@test TableTraits.isiterabletable(load("types.sav")) == true
@test IteratorInterfaceExtensions.isiterable(load("types.sav")) == true

end

@testset "Show" begin

ar = load("types.dta")

@test sprint((stream,data)->show(stream, "text/html", data), ar) == "<table><thead><tr><th>vfloat</th><th>vdouble</th><th>vlong</th><th>vint</th><th>vbyte</th><th>vstring</th></tr></thead><tbody><tr><td>3.14</td><td>3.14</td><td>2</td><td>2</td><td>2</td><td>&quot;2&quot;</td></tr><tr><td>7.0</td><td>7.0</td><td>7</td><td>7</td><td>7</td><td>&quot;7&quot;</td></tr><tr><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>&quot;&quot;</td></tr></tbody></table>"
@test sprint((stream,data)->show(stream, "application/vnd.dataresource+json", data), ar) ==
"{\"schema\":{\"fields\":[{\"name\":\"vfloat\",\"type\":\"number\"},{\"name\":\"vdouble\",\"type\":\"number\"},{\"name\":\"vlong\",\"type\":\"integer\"},{\"name\":\"vint\",\"type\":\"integer\"},{\"name\":\"vbyte\",\"type\":\"integer\"},{\"name\":\"vstring\",\"type\":\"string\"}]},\"data\":[{\"vfloat\":3.14,\"vdouble\":3.14,\"vlong\":2,\"vint\":2,\"vbyte\":2,\"vstring\":\"2\"},{\"vfloat\":7.0,\"vdouble\":7.0,\"vlong\":7,\"vint\":7,\"vbyte\":7,\"vstring\":\"7\"},{\"vfloat\":null,\"vdouble\":null,\"vlong\":null,\"vint\":null,\"vbyte\":null,\"vstring\":\"\"}]}"
@test sprint(show, ar) == "3x6 STATA file\nvfloat │ vdouble │ vlong │ vint │ vbyte │ vstring\n───────┼─────────┼───────┼──────┼───────┼────────\n3.14 │ 3.14 │ 2 │ 2 │ 2 │ \"2\" \n7.0 │ 7.0 │ 7 │ 7 │ 7 │ \"7\" \n#NA │ #NA │ #NA │ #NA │ #NA │ \"\" "

@test showable("text/html", ar) == true
@test showable("application/vnd.dataresource+json", ar) == true

ar = load("types.sas7bdat")

@test sprint((stream,data)->show(stream, "text/html", data), ar) == "<table><thead><tr><th>vfloat</th><th>vdouble</th><th>vlong</th><th>vint</th><th>vbyte</th><th>vstring</th></tr></thead><tbody><tr><td>3.14</td><td>3.14</td><td>2.0</td><td>2.0</td><td>2.0</td><td>&quot;2&quot;</td></tr><tr><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>&quot;7&quot;</td></tr><tr><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>&quot;&quot;</td></tr></tbody></table>"
@test sprint((stream,data)->show(stream, "application/vnd.dataresource+json", data), ar) ==
"{\"schema\":{\"fields\":[{\"name\":\"vfloat\",\"type\":\"number\"},{\"name\":\"vdouble\",\"type\":\"number\"},{\"name\":\"vlong\",\"type\":\"number\"},{\"name\":\"vint\",\"type\":\"number\"},{\"name\":\"vbyte\",\"type\":\"number\"},{\"name\":\"vstring\",\"type\":\"string\"}]},\"data\":[{\"vfloat\":3.140000104904175,\"vdouble\":3.14,\"vlong\":2.0,\"vint\":2.0,\"vbyte\":2.0,\"vstring\":\"2\"},{\"vfloat\":7.0,\"vdouble\":7.0,\"vlong\":7.0,\"vint\":7.0,\"vbyte\":7.0,\"vstring\":\"7\"},{\"vfloat\":null,\"vdouble\":null,\"vlong\":null,\"vint\":null,\"vbyte\":null,\"vstring\":\"\"}]}"
@test sprint(show, ar) == "3x6 SAS file\nvfloat │ vdouble │ vlong │ vint │ vbyte │ vstring\n───────┼─────────┼───────┼──────┼───────┼────────\n3.14 │ 3.14 │ 2.0 │ 2.0 │ 2.0 │ \"2\" \n7.0 │ 7.0 │ 7.0 │ 7.0 │ 7.0 │ \"7\" \n#NA │ #NA │ #NA │ #NA │ #NA │ \"\" "

@test showable("text/html", ar) == true
@test showable("application/vnd.dataresource+json", ar) == true

ar = load("types.sav")

@test sprint((stream,data)->show(stream, "text/html", data), ar) == "<table><thead><tr><th>vfloat</th><th>vdouble</th><th>vlong</th><th>vint</th><th>vbyte</th><th>vstring</th></tr></thead><tbody><tr><td>3.14</td><td>3.14</td><td>2.0</td><td>2.0</td><td>2.0</td><td>&quot;2&quot;</td></tr><tr><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>&quot;7&quot;</td></tr><tr><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>&quot;&quot;</td></tr></tbody></table>"
@test sprint((stream,data)->show(stream, "application/vnd.dataresource+json", data), ar) ==
"{\"schema\":{\"fields\":[{\"name\":\"vfloat\",\"type\":\"number\"},{\"name\":\"vdouble\",\"type\":\"number\"},{\"name\":\"vlong\",\"type\":\"number\"},{\"name\":\"vint\",\"type\":\"number\"},{\"name\":\"vbyte\",\"type\":\"number\"},{\"name\":\"vstring\",\"type\":\"string\"}]},\"data\":[{\"vfloat\":3.140000104904175,\"vdouble\":3.14,\"vlong\":2.0,\"vint\":2.0,\"vbyte\":2.0,\"vstring\":\"2\"},{\"vfloat\":7.0,\"vdouble\":7.0,\"vlong\":7.0,\"vint\":7.0,\"vbyte\":7.0,\"vstring\":\"7\"},{\"vfloat\":null,\"vdouble\":null,\"vlong\":null,\"vint\":null,\"vbyte\":null,\"vstring\":\"\"}]}"
@test sprint(show, ar) == "3x6 SPSS file\nvfloat │ vdouble │ vlong │ vint │ vbyte │ vstring\n───────┼─────────┼───────┼──────┼───────┼────────\n3.14 │ 3.14 │ 2.0 │ 2.0 │ 2.0 │ \"2\" \n7.0 │ 7.0 │ 7.0 │ 7.0 │ 7.0 │ \"7\" \n#NA │ #NA │ #NA │ #NA │ #NA │ \"\" "

@test showable("text/html", ar) == true
@test showable("application/vnd.dataresource+json", ar) == true

end
@run_package_tests
Loading
Loading