Skip to content

Commit 5f9799e

Browse files
authored
docs fix potpourri (#178)
* fix is_scene docs; polygon param; stray ds IDs * lint * add list_jobs params * rm test artifact
1 parent bfde0d0 commit 5f9799e

File tree

6 files changed

+32
-27
lines changed

6 files changed

+32
-27
lines changed

nucleus/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,12 @@ def list_jobs(
236236
) -> List[AsyncJob]:
237237
"""Fetches all of your running jobs in Nucleus.
238238
239+
Parameters:
240+
show_completed: Whether to fetch completed and errored jobs or just
241+
running jobs. Default behavior is False.
242+
date_limit: Only fetch jobs that were started after this date. Default
243+
behavior is 2 weeks prior to the current date.
244+
239245
Returns:
240246
List[:class:`AsyncJob`]: List of running asynchronous jobs
241247
associated with the client API key.
@@ -344,13 +350,13 @@ def create_dataset(
344350
Creates a new, empty dataset.
345351
346352
Make sure that the dataset is created for the data type you would like to support.
347-
Be aware to set the `is_scene` correctly.
353+
Be sure to set the ``is_scene`` parameter correctly.
348354
349355
Parameters:
350356
name: A human-readable name for the dataset.
351-
is_scene: Boolean specifying if the dataset type. This value is immutable.
352-
`False` will allow users to uplaod :class:`DatasetItems<DatasetItem>`s.
353-
`True` will allow users to upload :class:`Scenes<LidarScene>`s.
357+
is_scene: Whether the dataset contains strictly :class:`scenes
358+
<LidarScene>` or :class:`items <DatasetItem>`. This value is immutable.
359+
Default is False (dataset of items).
354360
item_metadata_schema: Dict defining item-level metadata schema. See below.
355361
annotation_metadata_schema: Dict defining annotation-level metadata schema.
356362

nucleus/annotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class PolygonAnnotation(Annotation):
195195
196196
Parameters:
197197
label (str): The label for this annotation.
198-
vertices List[:class:`Point`]: The list of points making up the polygon.
198+
vertices (List[:class:`Point`]): The list of points making up the polygon.
199199
reference_id (str): User-defined ID of the image to which to apply this
200200
annotation.
201201
annotation_id (Optional[str]): The annotation ID that uniquely identifies

nucleus/dataset.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class Dataset:
9797
9898
# Or, retrieve existing dataset by ID
9999
# This ID can be fetched using client.list_datasets() or from a dashboard URL
100-
existing_dataset = client.get_dataset("ds_bwkezj6g5c4g05gqp1eg")
100+
existing_dataset = client.get_dataset("YOUR_DATASET_ID")
101101
"""
102102

103103
def __init__(self, dataset_id, client, name=None):
@@ -396,20 +396,19 @@ def append(
396396
) -> Union[Dict[Any, Any], AsyncJob, UploadResponse]:
397397
"""Appends items or scenes to a dataset.
398398
399-
Attention (!!!)
400-
You will only be able to add :class:`DatasetItems<DatasetItem>`s to a dataset supporting "
401-
":class:`DatasetItems<DatasetItem>`s.
402-
Also, you will only be able to add :class:`Scenes<LidarScene>`s to a dataset supporting "
403-
":class:`Scenes<LidarScene>`s.
404-
A :class:`DatasetItems<DatasetItem>` dataset can be created with the is_scene flag set to False.
405-
A :class:`Scenes<LidarScene>` dataset can be created with the is_scene flag set to True.
399+
.. note::
400+
Datasets can only accept one of :class:`DatasetItems <DatasetItem>`
401+
or :class:`Scenes <LidarScene>`, never both.
402+
403+
This behavior is set during Dataset :meth:`creation
404+
<NucleusClient.create_dataset>` with the ``is_scene`` flag.
406405
407406
::
408407
409408
import nucleus
410409
411-
client = nucleus.NucleusClient(YOUR_SCALE_API_KEY)
412-
dataset = client.get_dataset("ds_bwkezj6g5c4g05gqp1eg")
410+
client = nucleus.NucleusClient("YOUR_SCALE_API_KEY")
411+
dataset = client.get_dataset("YOUR_DATASET_ID")
413412
414413
local_item = nucleus.DatasetItem(
415414
image_location="./1.jpg",
@@ -762,8 +761,8 @@ def create_custom_index(
762761
763762
import nucleus
764763
765-
client = nucleus.NucleusClient(YOUR_SCALE_API_KEY)
766-
dataset = client.get_dataset("ds_bwkezj6g5c4g05gqp1eg")
764+
client = nucleus.NucleusClient("YOUR_SCALE_API_KEY")
765+
dataset = client.get_dataset("YOUR_DATASET_ID")
767766
768767
embeddings = {
769768
"reference_id_0": [0.1, 0.2, 0.3],
@@ -907,8 +906,8 @@ def add_taxonomy(
907906
::
908907
909908
import nucleus
910-
client = nucleus.NucleusClient(YOUR_SCALE_API_KEY)
911-
dataset = client.get_dataset("ds_bwkezj6g5c4g05gqp1eg")
909+
client = nucleus.NucleusClient("YOUR_SCALE_API_KEY")
910+
dataset = client.get_dataset("YOUR_DATASET_ID")
912911
913912
response = dataset.add_taxonomy(
914913
taxonomy_name="clothing_type",
@@ -1076,12 +1075,12 @@ def calculate_evaluation_metrics(self, model, options: dict = None):
10761075
10771076
import nucleus
10781077
1079-
client = nucleus.NucleusClient(YOUR_SCALE_API_KEY)
1080-
dataset = client.get_dataset(dataset_id="ds_bwkezj6g5c4g05gqp1eg")
1078+
client = nucleus.NucleusClient("YOUR_SCALE_API_KEY")
1079+
dataset = client.get_dataset(dataset_id="YOUR_DATASET_ID")
10811080
10821081
model = client.get_model(
1083-
model_id="prj_bybpa3gjmjc30es761y0",
1084-
dataset_id="ds_bwkezj6g5c4g05gqp1eg"
1082+
model_id="YOUR_MODEL_PRJ_ID",
1083+
dataset_id="YOUR_DATASET_ID"
10851084
)
10861085
10871086
# Compute all evaluation metrics including IOU-based matching:

nucleus/modelci/data_transfer_objects/eval_function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ class EvalFunctionEntry(ImmutableModel):
4141

4242

4343
class GetEvalFunctions(ImmutableModel):
44-
""" Expected format from GET modelci/eval_fn"""
44+
"""Expected format from GET modelci/eval_fn"""
4545

4646
eval_functions: List[EvalFunctionEntry]

nucleus/modelci/data_transfer_objects/unit_test_metric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class AddUnitTestMetric(ImmutableModel):
7-
""" Data transfer object to add a unit test."""
7+
"""Data transfer object to add a unit test."""
88

99
unit_test_name: str
1010
eval_function_id: str

nucleus/slice.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class Slice:
3030
3131
import nucleus
3232
33-
client = nucleus.NucleusClient(YOUR_SCALE_API_KEY)
34-
dataset = client.get_dataset("ds_bwkezj6g5c4g05gqp1eg")
33+
client = nucleus.NucleusClient("YOUR_SCALE_API_KEY")
34+
dataset = client.get_dataset("YOUR_DATASET_ID")
3535
3636
ref_ids = ["interesting_item_1", "interesting_item_2"]
3737
slice = dataset.create_slice(name="interesting", reference_ids=ref_ids)

0 commit comments

Comments
 (0)