Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checks of camtrap DP input #299

Closed
damianooldoni opened this issue Mar 14, 2024 · 4 comments
Closed

Add checks of camtrap DP input #299

damianooldoni opened this issue Mar 14, 2024 · 4 comments
Milestone

Comments

@damianooldoni
Copy link
Member

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.
@damianooldoni damianooldoni changed the title Add class check Add checks of camtrap DP input Mar 14, 2024
@damianooldoni damianooldoni added this to the v1.0 milestone Mar 14, 2024
@peterdesmet
Copy link
Member

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.

@damianooldoni
Copy link
Member Author

Because of #298.

@PietrH
Copy link
Member

PietrH commented Mar 19, 2024

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
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants