Skip to content

Commit e90b2c7

Browse files
authored
fix scene export payload; bump circleci resource_class (#342)
* fix scene payload * bump resource_class... * lint * revert .to_json, fix .from_json
1 parent 0ddc3f5 commit e90b2c7

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
# Important: Don't change this otherwise we will stop testing the earliest
1212
# python version we have to support.
1313
- image: python:3.6-buster
14-
resource_class: small
14+
resource_class: medium
1515
parallelism: 6
1616
steps:
1717
- checkout # checkout source code to working directory

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ 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.14.11](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.14.12) - 2022-08-05
8+
## [0.14.13](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.14.13) - 2022-08-10
9+
10+
### Fixed
11+
- Fix payload parsing for scene export
12+
13+
## [0.14.12](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.14.12) - 2022-08-05
914

1015
### Added
1116
- Added auto-paginated `Slice.export_predictions_generator`
17+
1218
### Fixed
1319
- Change `{Dataset,Slice}.items_and_annotation_generator` to work with improved paginate endpoint
1420

nucleus/dataset_item.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,21 @@ def from_json(cls, payload: dict):
139139
image_url = payload.get(IMAGE_URL_KEY, None) or payload.get(
140140
ORIGINAL_IMAGE_URL_KEY, None
141141
)
142+
pointcloud_url = payload.get(POINTCLOUD_URL_KEY, None)
143+
144+
# handle case when re-converting Scene.from_json
145+
url = payload.get(URL_KEY, None)
146+
if url and not image_url and not pointcloud_url:
147+
if url.split(".")[-1] in ("jpg", "png"):
148+
image_url = url
149+
elif url.split(".")[-1] in ("json",):
150+
pointcloud_url = url
151+
142152
if BACKEND_REFERENCE_ID_KEY in payload:
143153
payload[REFERENCE_ID_KEY] = payload[BACKEND_REFERENCE_ID_KEY]
144154
return cls(
145155
image_location=image_url,
146-
pointcloud_location=payload.get(POINTCLOUD_URL_KEY, None),
156+
pointcloud_location=pointcloud_url,
147157
reference_id=payload.get(REFERENCE_ID_KEY, None),
148158
metadata=payload.get(METADATA_KEY, {}),
149159
upload_to_scale=payload.get(UPLOAD_TO_SCALE_KEY, True),

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.14.12"
24+
version = "0.14.13"
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)