hugomflavio / actel

Standardised analysis of acoustic telemetry data from fish moving through receiver arrays
https://hugomflavio.github.io/actel-website
26 stars 6 forks source link

group by sex #66

Open sebdalgarno opened 3 years ago

sebdalgarno commented 3 years ago

I see this warning when I try to have groups "male" and "female":

Warning: Group 'male' is contained within other groups. To avoid function failure, a number will be appended to this group.

my groups then automatically become "male_1" and "female"

I suppose a solution would be to use 'm' and 'f' instead, but it seems like 'male' and 'female' would be one of the most common groupings to make (besides hatchery and wild). I wonder if there is a solution to this?

hugomflavio commented 3 years ago

I remember that the names being contained within each other would break something, but the fact that I can't remember exactly what says much about how long ago I coded that part of actel :) It was something related to matching group names.

My mastery of regex expressions has improved considerably since then, so I am sure there must be a way to prevent that bug and still be able to have group names contained within other group names. I just need to find out where the problem was to begin with. I suppose that deactivating that particular safety net would be a possible way to find the troublesome code; I will have to look into it with some more time.

Thanks for bringing it to my attention!

sebdalgarno commented 3 years ago

OK great yes I think it would be a useful enhancement, but i do understand that these things can open up a can of worms!

SimonDedman commented 1 month ago

This is an old thread and this is just an uneducated thought/guess but: is there any chance that converting group to a factor might obviate this issue?

hugomflavio commented 1 month ago

not quite. If memory serves me right, this problem stems from some regex lines getting confused if a group is totally contained within another. This is an ancient limitation :D I am sure it wouldn't be too hard to fix, I just always seem to have more pressing things going on...

sebdalgarno commented 1 month ago

I don't mind closing if it is not a priority

hugomflavio commented 1 month ago

No, please, do keep it open. It is a very valid point. I was mostly away from 2020 onwards (different job), but I am back now (new job again, yay!), so there's a lot of updates being worked on!