Skip to content

Commit

Permalink
Update Compat Bounds (#36)
Browse files Browse the repository at this point in the history
* Fix tests: don't rely on Random.seed!

random number generation can change across julia implementations

* Update compat bounds

* Update version for new bugfix release
  • Loading branch information
jacobadenbaum authored Jul 18, 2023
1 parent cb72854 commit f3eb5dc
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "TexTables"
uuid = "ebf5ac4f-3ec1-555f-9ac9-3d72ed88c471"
version = "0.2.6"
version = "0.2.7"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand All @@ -14,15 +14,15 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"

[compat]
Compat = "^3.0"
Compat = "3, 4"
DataFrames = "0.21, 0.22, 1.0"
DataStructures = "0.17, 0.18"
Distributions = "0.20, 0.21, 0.22, 0.23, 0.24, 0.25"
Formatting = "^0.3.3, 0.4"
GLM = "^1.0"
Parameters = "0.12"
StatsBase = "0.33"
StatsModels = "0.6"
StatsBase = "0.33, 0.34"
StatsModels = "0.6, 0.7"
julia = "1"

[extras]
Expand Down
12 changes: 9 additions & 3 deletions test/composite_tables.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Baseline check
using Random

Random.seed!(1234)
x = randn(10)
x = [0.8673472019512456, -0.9017438158568171, -0.4944787535042339,
-0.9029142938652416, 0.8644013132535154, 2.2118774995743475,
0.5328132821695382, -0.27173539603462066, 0.5023344963886675,
-0.5169836206932686]
x2 = [-0.5605013381807765, -0.019291781689849075, 0.12806443451512645,
1.852782957725545, -0.8277634318169205, 0.11009612632217552,
-0.2511757400198831, 0.3697140350317453, 0.07211635315125874,
-1.503429457351051]
y = [Symbol(:key, i) for i=1:10]
t1 = TableCol("test", y, x)
t2 = TableCol("test2", y[2:9], x[2:9])
t3 = TableCol("test3", y, x, randn(10) .|> abs .|> sqrt)
t3 = TableCol("test3", y, x, x2 .|> abs .|> sqrt)
sub_tab1= hcat(t1, t2, t3)

# Composite Table Checks
Expand Down
24 changes: 18 additions & 6 deletions test/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ gv = get_vals
@testset "IndexedTable Indexing" begin

# Construct some random tables
Random.seed!(1234)
x = randn(10)
x = [0.8673472019512456, -0.9017438158568171, -0.4944787535042339,
-0.9029142938652416, 0.8644013132535154, 2.2118774995743475,
0.5328132821695382, -0.27173539603462066, 0.5023344963886675,
-0.5169836206932686]
x2 = [-0.5605013381807765, -0.019291781689849075, 0.12806443451512645,
1.852782957725545, -0.8277634318169205, 0.11009612632217552,
-0.2511757400198831, 0.3697140350317453, 0.07211635315125874,
-1.503429457351051]
y = [Symbol(:key, i) for i=1:10]
t1 = TableCol("test", y, x)
t2 = TableCol("test2", y[2:9], x[2:9])
t3 = TableCol("test3", y, x, randn(10) .|> abs .|> sqrt)
t3 = TableCol("test3", y, x, x2 .|> abs .|> sqrt)
sub_tab1= hcat(t1, t2, t3)

# Composite Table Checks
Expand Down Expand Up @@ -143,12 +149,18 @@ gv = get_vals

@testset "IndexedTable Indexing" begin
# Baseline check
Random.seed!(1234)
x = randn(10)
x = [0.8673472019512456, -0.9017438158568171, -0.4944787535042339,
-0.9029142938652416, 0.8644013132535154, 2.2118774995743475,
0.5328132821695382, -0.27173539603462066, 0.5023344963886675,
-0.5169836206932686]
x2 = [-0.5605013381807765, -0.019291781689849075, 0.12806443451512645,
1.852782957725545, -0.8277634318169205, 0.11009612632217552,
-0.2511757400198831, 0.3697140350317453, 0.07211635315125874,
-1.503429457351051]
y = [Symbol(:key, i) for i=1:10]
t1 = TableCol("test", y, x) |> IndexedTable
t2 = TableCol("test2", y[2:9], x[2:9]) |> IndexedTable
t3 = TableCol("test3", y, x, randn(10).|>abs.|>sqrt) |> IndexedTable
t3 = TableCol("test3", y, x, x2.|>abs.|>sqrt) |> IndexedTable
t4 = TableCol("test" , Dict("Fixed Effects"=>"Yes")) |> IndexedTable
t5 = TableCol("test2", Dict("Fixed Effects"=>"No")) |> IndexedTable
t6 = TableCol("test3", Dict("Fixed Effects"=>"Yes")) |> IndexedTable
Expand Down
24 changes: 18 additions & 6 deletions test/printing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ import TexTables: get_level, generate_schema, check_table_type,

@testset "Extracting Index Levels" begin
# Standard Composite Tables
Random.seed!(1234)
x = randn(10)
x = [0.8673472019512456, -0.9017438158568171, -0.4944787535042339,
-0.9029142938652416, 0.8644013132535154, 2.2118774995743475,
0.5328132821695382, -0.27173539603462066, 0.5023344963886675,
-0.5169836206932686]
x2 = [-0.5605013381807765, -0.019291781689849075, 0.12806443451512645,
1.852782957725545, -0.8277634318169205, 0.11009612632217552,
-0.2511757400198831, 0.3697140350317453, 0.07211635315125874,
-1.503429457351051]
y = [Symbol(:key, i) for i=1:10]
t1 = TableCol("test", y, x)
t2 = TableCol("test2", y[2:9], x[2:9])
t3 = TableCol("test3", y, x, randn(10) .|> abs .|> sqrt)
t3 = TableCol("test3", y, x, x2 .|> abs .|> sqrt)
t4 = TableCol("test" , Dict("Fixed Effects"=>"Yes"))
t5 = TableCol("test2", Dict("Fixed Effects"=>"No"))
t6 = TableCol("test3", Dict("Fixed Effects"=>"Yes"))
Expand Down Expand Up @@ -42,12 +48,18 @@ end

@testset "Index Schemas" begin
# Standard Composite Tables
Random.seed!(1234)
x = randn(10)
x = [0.8673472019512456, -0.9017438158568171, -0.4944787535042339,
-0.9029142938652416, 0.8644013132535154, 2.2118774995743475,
0.5328132821695382, -0.27173539603462066, 0.5023344963886675,
-0.5169836206932686]
x2 = [-0.5605013381807765, -0.019291781689849075, 0.12806443451512645,
1.852782957725545, -0.8277634318169205, 0.11009612632217552,
-0.2511757400198831, 0.3697140350317453, 0.07211635315125874,
-1.503429457351051]
y = [Symbol(:key, i) for i=1:10]
t1 = TableCol("test", y, x)
t2 = TableCol("test2", y[2:9], x[2:9])
t3 = TableCol("test3", y, x, randn(10) .|> abs .|> sqrt)
t3 = TableCol("test3", y, x, x2 .|> abs .|> sqrt)
t4 = TableCol("test" , Dict("Fixed Effects"=>"Yes"))
t5 = TableCol("test2", Dict("Fixed Effects"=>"No"))
t6 = TableCol("test3", Dict("Fixed Effects"=>"Yes"))
Expand Down

2 comments on commit f3eb5dc

@jacobadenbaum
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/87694

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.7 -m "<description of version>" f3eb5dc29b813b02796ce5b03161172b278c0f61
git push origin v0.2.7

Please sign in to comment.