Skip to content

Commit 70d1530

Browse files
author
Diego Ardila
committed
Review comments + bump version
1 parent 3ebde81 commit 70d1530

File tree

6 files changed

+8
-12
lines changed

6 files changed

+8
-12
lines changed

nucleus/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@ def list_models(self) -> List[Model]:
184184
model_id=model["id"],
185185
name=model["name"],
186186
reference_id=model["ref_id"],
187-
metadata=None
188-
if model["metadata"] == {}
189-
else model["metadata"],
187+
metadata=model["metadata"] or None,
190188
client=self,
191189
)
192190
for model in model_objects["models"]

nucleus/annotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def to_payload(self) -> dict:
307307
}
308308

309309

310-
def check_all_annotation_paths_remote(
310+
def check_all_mask_paths_remote(
311311
annotations: Sequence[Union[Annotation]],
312312
):
313313
for annotation in annotations:

nucleus/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from .annotation import (
1414
Annotation,
1515
CuboidAnnotation,
16-
check_all_annotation_paths_remote,
16+
check_all_mask_paths_remote,
1717
)
1818
from .constants import (
1919
DATASET_ITEM_IDS_KEY,
@@ -171,7 +171,7 @@ def annotate(
171171
if any((isinstance(ann, CuboidAnnotation) for ann in annotations)):
172172
raise NotImplementedError("Cuboid annotations not yet supported")
173173

174-
check_all_annotation_paths_remote(annotations)
174+
check_all_mask_paths_remote(annotations)
175175

176176
if asynchronous:
177177
request_id = serialize_and_write_to_presigned_url(

nucleus/model.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ def from_json(cls, payload: dict, client):
4848
model_id=payload["id"],
4949
name=payload["name"],
5050
reference_id=payload["ref_id"],
51-
metadata=None
52-
if payload["metadata"] == {}
53-
else payload["metadata"],
51+
metadata=payload["metadata"] or None,
5452
client=client,
5553
)
5654

nucleus/model_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Dict, List, Optional, Type, Union
22

3-
from nucleus.annotation import check_all_annotation_paths_remote
3+
from nucleus.annotation import check_all_mask_paths_remote
44
from nucleus.job import AsyncJob
55
from nucleus.utils import serialize_and_write_to_presigned_url
66

@@ -106,7 +106,7 @@ def predict(
106106
}
107107
"""
108108
if asynchronous:
109-
check_all_annotation_paths_remote(annotations)
109+
check_all_mask_paths_remote(annotations)
110110

111111
request_id = serialize_and_write_to_presigned_url(
112112
annotations, self._dataset_id, self._client

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.1.11"
24+
version = "0.1.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)