Skip to content

Commit

Permalink
Bump version after first batch of refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcaixeta committed Apr 21, 2021
1 parent 70e7173 commit 1ae74cb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Unfolding"
uuid = "c5d2ca1b-4127-462e-b5fa-7f6e5ca16f83"
authors = ["Rafael Moniz Caixeta"]
version = "0.1.6"
version = "0.1.7"

[deps]
Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
Expand Down
2 changes: 1 addition & 1 deletion src/data_handling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ names are passed in `colnames` array.
function to_csv(input_matrix::AbstractArray,outname::String,colnames)

out = length(size(input_matrix))==1 ? input_matrix : input_matrix'
open(string(outname,".csv"); write=true) do f
open("$outname.csv"; write=true) do f
write(f, string(join(colnames,","),"\n"))
writedlm(f, out, ',')
end
Expand Down
12 changes: 6 additions & 6 deletions src/landmark_isomap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ with the unfolded points.
* `anchors` - number of anchors/landmark points for the dimensionality reduction.
"""
function landmark_isomap(coords::AbstractMatrix; search="knn", neighval=16,
anchors=1500, dim=2)
n = size(coords, 2)
anchors=1500)
n, dim = size(coords, 2), 2
n < anchors && (anchors = n)

g, ianchors = graph_and_anchors(coords, search, neighval, anchors)
Expand All @@ -36,7 +36,7 @@ function landmark_isomap(coords::AbstractMatrix; search="knn", neighval=16,
tcoords[:,iothers] .= otcoords
else
M = fit(MDS, ADM, maxoutdim=dim, distances=true)
tcoords = dim == 2 ? vcat(transform(M),zeros(1, n)) : transform(M)
tcoords = vcat(transform(M),zeros(1, n))
end
tcoords
end
Expand Down Expand Up @@ -66,7 +66,7 @@ function graph_and_anchors(ref_coords::AbstractMatrix, nhood, neigh_val, nanchor

g = SimpleWeightedGraph(Int.(src), Int.(dest), dwgt)
comps = length(connected_components(g))
@assert comps==1 string("$comps subgroups of isolated vertices, need to increase number of neighbors")
@assert comps==1 "$comps subgroups of isolated vertices, need to increase number of neighbors"

wgt = nhood=="inrange" ? [1/length(x) for x in idxs] : [mean(x) for x in dists]
ianchors = n > nanchors ? sort!(sample(1:n, Weights(wgt), nanchors, replace=false)) : collect(1:n)
Expand All @@ -93,7 +93,7 @@ function anchors_mds(ADM, dims)
EM = (F.vectors[:,sorti])[:,1:dims]
sq_eigenvals = sortλ[1:dims].^0.5
AM = Diagonal(sq_eigenvals)
atcoords = dims == 2 ? vcat(permutedims(EM*AM),zeros(1,nx)) : permutedims(EM*AM)
atcoords = vcat(permutedims(EM*AM),zeros(1,nx))

# to use later for another points allocations
M1 = permutedims(EM)
Expand All @@ -106,5 +106,5 @@ end

function triangulation(g::SimpleWeightedGraph, i, j, M1, M3)
M2 = dijkstra_shortest_paths(g, i).dists[j] .^ 2
size(M1,1) == 2 ? vcat(-0.5*M1*(M2-M3),0) : -0.5*M1*(M2-M3)
vcat(-0.5*M1*(M2-M3),0)
end
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using Test
df_block[:,c] = unf_block[i,:]
end

to_vtk(unf_samps,"test_out_vtk",[(string("test",x),[rand() for i in 1:size(unf_samps,2)]) for x in 1:4])
to_vtk(unf_samps,"test_out_vtk",[("test$x",[rand() for i in 1:size(unf_samps,2)]) for x in 1:4])
to_csv(unf_samps,"test_out_csv",["X","Y","Z"])
error = error_dists(hcat(input_samps,input_block), hcat(unf_samps,unf_block), nneigh=8)

Expand Down

2 comments on commit 1ae74cb

@rmcaixeta
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/34898

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.7 -m "<description of version>" 1ae74cbe3b9b3f407396bc33dc7eebbf21b1bfae
git push origin v0.1.7

Please sign in to comment.