-
Notifications
You must be signed in to change notification settings - Fork 35
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
feat(label): add "MultiPolyline2DSubcatalog" & "LabeledMultiPolyline2D" #821
Conversation
Pull Request Test Coverage Report for Build 1036748837
💛 - Coveralls |
76df851
to
7970376
Compare
tensorbay/label/label_polyline.py
Outdated
>>> categories = NameList() | ||
>>> categories.append(CategoryInfo("a")) | ||
>>> attributes = NameList() | ||
>>> attributes.append(AttributeInfo("gender", enum=["female", "male"])) |
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.
Use MultiPolyline2DSubcatalog.add_category
and MultiPolyline2DSubcatalog.add_attribute
instead.
tensorbay/label/label_polyline.py
Outdated
... "instance": "12345", | ||
... } | ||
>>> LabeledMultiPolyline2D.loads(contents) | ||
LabeledPolyline2D [ |
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.
LabeledMultiPolyline2D?
tensorbay/utility/attr.py
Outdated
@@ -111,7 +111,10 @@ def __init_subclass__(cls) -> None: | |||
type_ = cls.__annotations__.pop(_ATTRS_BASE, None) | |||
if type_: | |||
cls._attrs_base.loader = type_._loads # pylint: disable=protected-access | |||
cls._attrs_base.dumper = type_.dumps | |||
if hasattr(type_, "_dumps"): |
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.
cls._attrs_base.dumper = type_.dumps if hasattr(type_, "_dumps") else type_.dumps
f4efeab
to
f5edcba
Compare
tensorbay/utility/attr.py
Outdated
@@ -111,7 +111,11 @@ def __init_subclass__(cls) -> None: | |||
type_ = cls.__annotations__.pop(_ATTRS_BASE, None) | |||
if type_: | |||
cls._attrs_base.loader = type_._loads # pylint: disable=protected-access | |||
cls._attrs_base.dumper = type_.dumps | |||
cls._attrs_base.dumper = ( |
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.
= getattr(type_, "_dumps", type_.dumps)
?
f5edcba
to
45043fe
Compare
45043fe
to
e07ef8e
Compare
e07ef8e
to
f0be84e
Compare
No description provided.