Skip to content

Commit

Permalink
add compathelper
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustoCL committed Oct 18, 2021
1 parent 8ca7ade commit f6edbf7
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 9 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

[compat]
julia = "1.6"
julia = "1"
LinearAlgebra = "1.6"
NearestNeighbors = "0.4.9"
Statistics = "1.4.0"
Expand Down
20 changes: 13 additions & 7 deletions test/dbscan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
Random.seed!(42)

df = CSV.read("data/blob_data.csv", DataFrame, drop=[1]);

X = df[:,1:2];

ϵ = 0.35;
min_pts = 10;

X_int = round.(Int, X.*100)
ϵ_int = 35.0;
@testset "test errors" begin
@test_throws ArgumentError dbscan(X[:, 2], ϵ, min_pts)
end

@testset "test Array{Float64, 2}" begin
X_array = Matrix(X)
res_ar = dbscan(X_array, ϵ, min_pts)
n_clusters = unique(res_ar.labels) |> length
@test length(res_ar.labels) == size(X_array, 1)
end

@testset "test dimensions results" begin
res = dbscan(X, ϵ, min_pts)
n_clusters = unique(res.labels) |> length
Expand All @@ -23,12 +31,10 @@
end

@testset "test Integer conversion" begin
res_int = dbscan(X_int,ϵ_int, min_pts)
X_int = round.(Int, X.*100)
res_int = dbscan(X_int, ϵ*100, min_pts)
@test eltype(res_int.df) == Float64
@test length(res_int.labels) == size(X_int, 1)
end

@testset "test errors" begin
@test_throws ArgumentError dbscan(X[:, 2], ϵ, min_pts)
end
end
2 changes: 1 addition & 1 deletion test/kmeans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

@testset "diferent types of float" begin
B = rand(Float32, 100, 4)
res2 = kmeans(B, k)
res2 = kmeans(B, k, init=:random)
@test eltype(B) == eltype(res2.centroids[1])
end

Expand Down

2 comments on commit f6edbf7

@AugustoCL
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 updated: JuliaRegistries/General/46896

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.1.0 -m "<description of version>" f6edbf7adefb0212bab422e8e3227c8878d7f5ba
git push origin v0.1.0

Please sign in to comment.