Skip to content

Commit

Permalink
Merge pull request #19 from pgbrodrick/split_bug_fix
Browse files Browse the repository at this point in the history
small bugfix to library split syntax
  • Loading branch information
pgbrodrick authored Sep 10, 2024
2 parents 9025be4 + 2fddce5 commit 10676b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/EndmemberLibrary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ function brightness_normalize!(library::SpectralLibrary)
end

function split_library(library::SpectralLibrary, split_fraction::Float64)
perm = randperm((library.spectra)[1])
perm = randperm(size(library.spectra)[1])

split_1 = perm[1:round(split_fraction * length(perm))]
split_2 = perm[round(split_fraction * length(perm)):end]
split_1 = perm[1:Int(round(split_fraction * length(perm)))]
split_2 = perm[Int(round(split_fraction * length(perm))):end]

output_library_1 = deepcopy(library)
output_library_2 = deepcopy(library)
Expand Down

0 comments on commit 10676b8

Please sign in to comment.