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

ENH: Add from_annot and/or from_seq / from_bbox classmethods to format classes? #208

Open
NickleDave opened this issue Dec 10, 2022 · 0 comments
Labels
ENH: enhancement New feature or request

Comments

@NickleDave
Copy link
Collaborator

NickleDave commented Dec 10, 2022

One can make a format from a sequence by unpacking keywords one-by-one, but why not provide a classmethod as a convenience method that does this on a per-class basis? (Since some will require diff't keywords depending on their attributes)

For seq formats, the from_annot method can just check that it has a seq attribute and then call from_seq with that attribute. Same for a bbox format, except we check for a bbox attribute.

This also makes the use case easier where one wants to convert back to a method -- e.g., I have a Sequence (or Annotation with a seq). As in #207, I could write NotMat.from_seq(seq).to_notmat(notmat_path).

@NickleDave NickleDave added the ENH: enhancement New feature or request label Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ENH: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant