inbo / camtraptor

Camtraptor is an R package to read, explore and visualize Camera Trap Data Packages (Camtrap DP)
https://inbo.github.io/camtraptor/
MIT License
10 stars 2 forks source link

Add checks of camtrap DP input #299

Closed damianooldoni closed 4 months ago

damianooldoni commented 8 months ago

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

peterdesmet commented 8 months ago

I think the check function itself should be provided by camtrapdp. I just created this issue: https://github.com/inbo/camtrapdp/issues/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.

damianooldoni commented 8 months ago

Because of #298.

PietrH commented 8 months ago

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?

damianooldoni commented 4 months ago

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.