Skip to content

Commit 05a695e

Browse files
authored
Video attachment_type backward compatibility (#303)
* deprecation warning + add arg back * bumped version
1 parent 91b8743 commit 05a695e

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ 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.11.2](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.11.2) - 2022-05-20
9+
10+
### Changed
11+
12+
- Restored backward compatibility of video constructor by adding back deprecated attachment_type argument
813

914
## [0.11.1](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.11.1) - 2022-05-19
1015

@@ -15,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1520
## [0.11.0](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.11.0) - 2022-05-13
1621

1722
### Added
23+
1824
- Segmentation prediction masks can now be evaluated against polygon annotation with new Validate functions
1925
- New function SegmentationToPolyIOU, configurable through client.validate.eval_functions.segmentation_to_poly_iou
2026
- New function SegmentationToPolyRecall, configurable through client.validate.eval_functions.segmentation_to_poly_recall
@@ -25,14 +31,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2531
## [0.10.8](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.10.8) - 2022-05-10
2632

2733
### Fixed
28-
- Add checks for duplicate (`reference_id`, `annotation_id`) when uploading Annotations or Predictions
2934

35+
- Add checks for duplicate (`reference_id`, `annotation_id`) when uploading Annotations or Predictions
3036

3137
## [0.10.7](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.10.7) - 2022-05-09
3238

3339
### Fixed
34-
- Add checks for duplicate reference IDs
3540

41+
- Add checks for duplicate reference IDs
3642

3743
## [0.10.6](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.10.6) - 2022-05-06
3844

nucleus/scene.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import warnings
23
from abc import ABC
34
from dataclasses import dataclass, field
45
from typing import Any, Dict, List, Optional, Union
@@ -470,8 +471,14 @@ class VideoScene(ABC):
470471
items: List[DatasetItem] = field(default_factory=list)
471472
metadata: Optional[dict] = field(default_factory=dict)
472473
upload_to_scale: Optional[bool] = True
474+
attachment_type: Optional[str] = None
473475

474476
def __post_init__(self):
477+
if self.attachment_type:
478+
warnings.warn(
479+
"The attachment_type parameter is no longer required and will be deprecated soon.",
480+
DeprecationWarning,
481+
)
475482
if self.metadata is None:
476483
self.metadata = {}
477484

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.11.1"
24+
version = "0.11.2"
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)