-
Notifications
You must be signed in to change notification settings - Fork 605
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
Enhancements to ODM migration #28
Conversation
@tylerganter added more stuff to this PR. See changelog |
@property | ||
def name(self): | ||
return self._name | ||
if not create_empty and not self: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does not self
mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I understand what it means now, missed the definition of __bool__
. But I suppose we have a minor issue that creating an empty dataset is meaningless. It does nothing on the backend ATM. So we may need some way of tracking that in the future. I would just mark it as a todo and move on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I noted that. We can move on for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks so much for the help with this. Noting the one comment I made that isn't resolved I think we can just add a TODO
Change log
BackedByDocument
subclasses now explicitly implement theircreate_new()
methods and callBackedByDocument._create_new()
to construct the underlyingODMDocument
s. The reason for this is documentation:Sample.create_new()
needs to exist so that the meaning of all of the relevant fields can be clearly documented for the user to understand what's going on. The previous implementation withget_odm_kwargs()
was hiding all of that. Also, it's a good practice to avoid constructing dictionaries of parameters in code. Dictionaries are magic things that can contain anything. It's better to pass keyword arguments around as keyword arguments, so your IDE/linter/static analyzer can tell what's happening and warn if a particular parameter is not validDataset.add_samples()
. IDK if this is efficient or not, but it does workfiftyone.core.labels.Label
classes to use new interface. This includes addingODMDocument
classes to back these constructs in the DBSample.add_label()
Miscellaneous