inbo/camtraptor

Add checks of camtrap DP input

Closed this issue · 4 comments

camtraptor will not support reading functionalities. All its functions where a Camtrap DP is passed as argument should implement two checks:

  • the class of a Camtrap DP will be equal to c("camtrapdp" "list")
  • the Camtrap DP version (stored as attribute: attributes(dp)) is one of the supported versions: we will support version 1.0.

I think the check function itself should be provided by camtrapdp. I just created this issue: inbo/camtrapdp#21

I'm a bit curious why you want to check the version of the object. The version will be assigned to the camtrapdp object by read_camtrap_dp(), it won't change in your env after that.

Because of #298.

I agree it's within the spirit of "fail early" to check if the object offered to camtraptor is actually a camtrapdp.

However, we need to keep in mind that some users might want to create a camtrapdp object manually in memory, so I would keep it as simple as possible.

So maybe check for the class but not the version?

Update: we decided to reexport reading functionlality of camtrapdp in camtraptor version 1.0, so the camtrap DPs will be checked while reading them using the camtraptor function read_camtrapdp(). No need to add extra specific checks at the moment.