diff --git a/Project.toml b/Project.toml index 86160931..8190aea8 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "IceFloeTracker" uuid = "04643c7a-9ac6-48c5-822f-2704f9e70bd3" authors = ["bradford roarr and contributors"] -version = "0.6.1" +version = "0.6.2" [deps] AxisArrays = "39de3d68-74b9-583c-8d2d-e117c070f3a9" diff --git a/src/tracker/tracker-funcs.jl b/src/tracker/tracker-funcs.jl index a43b13ca..56b2490e 100644 --- a/src/tracker/tracker-funcs.jl +++ b/src/tracker/tracker-funcs.jl @@ -556,16 +556,25 @@ function get_dt(props1, r, props2, s) end """ - adduuid!(props) + adduuid!(df) -Assign a unique ID to each floe in each table of floe properties. +Assign a unique ID to each floe in a table of floe properties. """ -function adduuid!(props::Vector{DataFrame}) - # Assign a unique ID to each floe in each image - for (i, prop) in enumerate(props) - props[i].uuid = [randstring(12) for _ in 1:nrow(prop)] +function adduuid!(df::DataFrame) + df.uuid = [randstring(12) for _ in 1:nrow(df)] + return df +end + +""" + adduuid!(dfs) + +Assign a unique ID to each floe in an vector of tables of floe properties. +""" +function adduuid!(dfs::Vector{DataFrame}) + for (i, df) in enumerate(dfs) + adduuid!(dfs[i]) end - return nothing + return dfs end """ @@ -683,15 +692,3 @@ function dropcols!(df, colstodrop) select!(df, Not(colstodrop)) return nothing end - -function adduuid!(df::DataFrame) - df.uuid = [randstring(12) for _ in 1:nrow(df)] - return df -end - -function adduuid!(dfs::Vector{DataFrame}) - for (i, df) in enumerate(dfs) - adduuid!(dfs[i]) - end - return dfs -end \ No newline at end of file