inbo / fistools

Repo containing widely used data & functions of the FIS team
https://inbo.github.io/fistools/
Other
1 stars 0 forks source link

30 new function label converter #33

Closed SanderDevisscher closed 2 months ago

SanderDevisscher commented 3 months ago

fixes #30

SanderDevisscher commented 3 months ago

@soriadelva how do you mean gets stuck ?

SanderDevisscher commented 3 months ago

The code itself works well but I have a few comments that may be addressed:

Fixed 🥳

Added a remark in the example. You should run an example which results in less than 1000 labels first (e.a. example 1)

  • Not that important, but I was wondering whether it would be better to place the function parameters in English (i.e., labelnumber instead of labelnummer, species_column instead of soort_column,...)

Not implemented since function will be used by us only. I could translate everything to dutch if prefered (as a new issue)

  • Also not that important but it may be nice to add a line after each warning that involves checking, saying that the check passed. e.g., after this warning: 1: In label_converter(df, "id", "labelnummer", "REE", "labeltype", : soort_column: REE is not a column of input >> checking if it's an allowed species there could be a line saying check passed 🎉

Implemented, whenever the function checks something and the check is succesfully completed check passed 🎉 is printed.

Additional fixes and enhancements:

  1. I've implemented some logic to bypass the labeltype logic when labeltype_column is not provided and not needed (only needed with soort = "ree")
  2. I've added a collapsed list of the allowed species and labeltypes to the error message you get when they are not allowed.
soriadelva commented 3 months ago

@soriadelva how do you mean gets stuck ?

it's weird, when I just run the function in the code itself it keeps on getting stuck at that same line, like this: stuck But if I select the whole code with ctrl + A and then run it, it seems to be fine 🤔