Skip to content

Commit b237e6e

Browse files
minor docs fixes (#223)
* update_autotag * black * fix BoxPrediction type * typo * changelog * Update nucleus/dataset.py Co-authored-by: Jean Lucas <jean.ferreira@scale.com> * semver Co-authored-by: Jean Lucas <jean.ferreira@scale.com>
1 parent afdd2d8 commit b237e6e

File tree

7 files changed

+26
-17
lines changed

7 files changed

+26
-17
lines changed

CHANGELOG.md

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

7+
## [0.6.5](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.6.5) - 2021-02-16
8+
9+
### Fixed
10+
- `Dataset.update_autotag` docstring formatting
11+
- `BoxPrediction` dataclass parameter typing
12+
- `validate.scenario_test_evaluation` typo
13+
714
## [0.6.4](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.6.4) - 2021-02-16
815

916
### Fixes

cli/helpers/web_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def launch_web_or_show_help(
77
sub_url: str, ctx: click.Context, launch_browser: bool
88
):
9-
""" Launches the sub_url (composed with nuclues_url(sub_url)) in the browser if requested"""
9+
"""Launches the sub_url (composed with nuclues_url(sub_url)) in the browser if requested"""
1010
if not ctx.invoked_subcommand:
1111
if launch_browser:
1212
url = nucleus_url(sub_url)

cli/reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# NOTE: Named reference instead of docs to not clash with dataset autocomplete
55
@click.command("reference")
66
def reference():
7-
""" View the Nucleus reference documentation in the browser"""
7+
"""View the Nucleus reference documentation in the browser"""
88
click.launch("https://nucleus.scale.com/docs")

nucleus/dataset.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,7 @@ def delete_scene(self, reference_id: str):
754754
self._client.delete(f"dataset/{self.id}/scene/{reference_id}")
755755

756756
def list_autotags(self):
757+
# TODO: prefer Dataset.autotags @property
757758
"""Fetches all autotags of the dataset.
758759
759760
Returns:
@@ -768,17 +769,18 @@ def list_autotags(self):
768769
"""
769770
return self._client.list_autotags(self.id)
770771

771-
def update_autotag(self, autotag_id):
772-
"""Will rerun inference on all dataset items in the dataset.
773-
For now this endpoint does not try to skip already inferenced items, but this
774-
improvement is planned for the future. This means that for now, you can only
775-
have one job running at time, so please await the result using job.sleep_until_complete()
776-
before launching another job.
772+
def update_autotag(self, autotag_id: str) -> AsyncJob:
773+
"""Rerun autotag inference on all items in the dataset.
774+
775+
Currently this endpoint does not try to skip already inferenced items,
776+
but this improvement is planned for the future. This means that for
777+
now, you can only have one job running at a time, so please await the
778+
result using job.sleep_until_complete() before launching another job.
777779
778780
Parameters:
779-
autotag_id: Id of the autotag to re-inference. You can figure out which
780-
id you want by using dataset.list_autotags, or by looking at the URL in the
781-
manage autotag page.
781+
autotag_id: ID of the autotag to re-inference. You can retrieve the
782+
ID you want with :meth:`list_autotags`, or from its URL in the
783+
"Manage Autotags" page in the dashboard.
782784
783785
Returns:
784786
:class:`AsyncJob`: Asynchronous job object to track processing status.

nucleus/prediction.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ class BoxPrediction(BoxAnnotation):
154154
def __init__(
155155
self,
156156
label: str,
157-
x: int,
158-
y: int,
159-
width: int,
160-
height: int,
157+
x: Union[float, int],
158+
y: Union[float, int],
159+
width: Union[float, int],
160+
height: Union[float, int],
161161
reference_id: str,
162162
confidence: Optional[float] = None,
163163
annotation_id: Optional[str] = None,

nucleus/validate/scenario_test_evaluation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ScenarioTestEvaluation:
6060
id (str): The ID of this scenario test evaluation.
6161
scenario_test_id (str): The ID of the associated scenario test.
6262
eval_function_id (str): The ID of the associated evaluation function.
63-
model_id (str): THe ID of the associated model.
63+
model_id (str): The ID of the associated model.
6464
status (str): The status of the evaluation job.
6565
result (Optional[float]): The float result of the evaluation.
6666
passed (bool): Whether the scenario test was passed.

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.6.4"
24+
version = "0.6.5"
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)