Skip to content

Commit 110d2d7

Browse files
authored
Add additional check to keypoints annotations (#282)
1 parent c858798 commit 110d2d7

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ All notable changes to the [Nucleus Python Client](https://github.com/scaleapi/n
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.10.4](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.10.1)) - 2022-04-22
9+
- Additional check added for KeypointsAnnotation names validation
10+
811
## [0.10.3](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.10.3) - 2022-04-22
912

1013
### Fixed

nucleus/annotation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,15 @@ def __post_init__(self):
464464
raise ValueError(
465465
"The list of keypoints must be the same length as the list of names"
466466
)
467+
if len(set(self.names)) != len(self.names):
468+
seen = set()
469+
for name in self.names:
470+
if name in seen:
471+
raise ValueError(
472+
f"The keypoint name '{name}' is repeated in the list of names"
473+
)
474+
seen.add(name)
475+
467476
for segment in self.skeleton:
468477
if len(segment) != 2:
469478
raise ValueError(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = '''
2121

2222
[tool.poetry]
2323
name = "scale-nucleus"
24-
version = "0.10.3"
24+
version = "0.10.4"
2525
description = "The official Python client library for Nucleus, the Data Platform for AI"
2626
license = "MIT"
2727
authors = ["Scale AI Nucleus Team <nucleusapi@scaleapi.com>"]

0 commit comments

Comments
 (0)