Skip to content
Snippets Groups Projects
Commit f62b5deb authored by François  LAURENT's avatar François LAURENT
Browse files

bugfix for balancing_strategy=nothing

parent e4d82886
No related branches found
No related tags found
1 merge request!4bugfix for direct call to new_write_larva_dataset_hdf5
Pipeline #109660 passed
......@@ -540,7 +540,7 @@ Known issue: ASCII-compatible string attributes are ASCII encoded and deserializ
by the *h5py* Python library.
"""
function write_larva_dataset_hdf5(output_dir::String,
input_data::Union{String, <:AbstractVector},
input_data::Union{Repository, String, <:AbstractVector},
window_length::Int=20;
labels::Union{Nothing, <:AbstractVector{String}}=nothing,
labelpointers::Union{Nothing, <:AbstractDict{String, Vector{Tuple{Int, Int, Int}}}}=nothing,
......@@ -619,7 +619,7 @@ function new_write_larva_dataset_hdf5(output_dir, input_data;
@assert !isnothing(frameinterval)
window = TimeWindow(window_length * frameinterval, round(Int, 1 / frameinterval);
maggotuba_compatibility=past_future_extensions)
index = if startswith(balancing_strategy, "max:")
index = if !isnothing(balancing_strategy) && startswith(balancing_strategy, "max:")
# `includeall` not supported
maxcount = parse(Int, balancing_strategy[5:end])
capacitysampling(labels, maxcount; seed=seed)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment