Skip to content

Commit

Permalink
minor docs fixes (#223)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
drakejwong and jean-lucas authored Feb 16, 2022
1 parent afdd2d8 commit b237e6e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 17 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to the [Nucleus Python Client](https://github.com/scaleapi/n
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.5](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.6.5) - 2021-02-16

### Fixed
- `Dataset.update_autotag` docstring formatting
- `BoxPrediction` dataclass parameter typing
- `validate.scenario_test_evaluation` typo

## [0.6.4](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.6.4) - 2021-02-16

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion cli/helpers/web_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def launch_web_or_show_help(
sub_url: str, ctx: click.Context, launch_browser: bool
):
""" Launches the sub_url (composed with nuclues_url(sub_url)) in the browser if requested"""
"""Launches the sub_url (composed with nuclues_url(sub_url)) in the browser if requested"""
if not ctx.invoked_subcommand:
if launch_browser:
url = nucleus_url(sub_url)
Expand Down
2 changes: 1 addition & 1 deletion cli/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# NOTE: Named reference instead of docs to not clash with dataset autocomplete
@click.command("reference")
def reference():
""" View the Nucleus reference documentation in the browser"""
"""View the Nucleus reference documentation in the browser"""
click.launch("https://nucleus.scale.com/docs")
20 changes: 11 additions & 9 deletions nucleus/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ def delete_scene(self, reference_id: str):
self._client.delete(f"dataset/{self.id}/scene/{reference_id}")

def list_autotags(self):
# TODO: prefer Dataset.autotags @property
"""Fetches all autotags of the dataset.
Returns:
Expand All @@ -768,17 +769,18 @@ def list_autotags(self):
"""
return self._client.list_autotags(self.id)

def update_autotag(self, autotag_id):
"""Will rerun inference on all dataset items in the dataset.
For now this endpoint does not try to skip already inferenced items, but this
improvement is planned for the future. This means that for now, you can only
have one job running at time, so please await the result using job.sleep_until_complete()
before launching another job.
def update_autotag(self, autotag_id: str) -> AsyncJob:
"""Rerun autotag inference on all items in the dataset.
Currently this endpoint does not try to skip already inferenced items,
but this improvement is planned for the future. This means that for
now, you can only have one job running at a time, so please await the
result using job.sleep_until_complete() before launching another job.
Parameters:
autotag_id: Id of the autotag to re-inference. You can figure out which
id you want by using dataset.list_autotags, or by looking at the URL in the
manage autotag page.
autotag_id: ID of the autotag to re-inference. You can retrieve the
ID you want with :meth:`list_autotags`, or from its URL in the
"Manage Autotags" page in the dashboard.
Returns:
:class:`AsyncJob`: Asynchronous job object to track processing status.
Expand Down
8 changes: 4 additions & 4 deletions nucleus/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ class BoxPrediction(BoxAnnotation):
def __init__(
self,
label: str,
x: int,
y: int,
width: int,
height: int,
x: Union[float, int],
y: Union[float, int],
width: Union[float, int],
height: Union[float, int],
reference_id: str,
confidence: Optional[float] = None,
annotation_id: Optional[str] = None,
Expand Down
2 changes: 1 addition & 1 deletion nucleus/validate/scenario_test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ScenarioTestEvaluation:
id (str): The ID of this scenario test evaluation.
scenario_test_id (str): The ID of the associated scenario test.
eval_function_id (str): The ID of the associated evaluation function.
model_id (str): THe ID of the associated model.
model_id (str): The ID of the associated model.
status (str): The status of the evaluation job.
result (Optional[float]): The float result of the evaluation.
passed (bool): Whether the scenario test was passed.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exclude = '''

[tool.poetry]
name = "scale-nucleus"
version = "0.6.4"
version = "0.6.5"
description = "The official Python client library for Nucleus, the Data Platform for AI"
license = "MIT"
authors = ["Scale AI Nucleus Team <nucleusapi@scaleapi.com>"]
Expand Down

0 comments on commit b237e6e

Please sign in to comment.