Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions encord/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AuthenticationError(EncordException):


class AuthorisationError(EncordException):
"""Exception thrown when access is unauthorised.
"""Exception thrown when access is unauthorized.
(E.g. access to a data asset or method).
"""

Expand Down Expand Up @@ -234,7 +234,7 @@ class InvalidArgumentsError(EncordException):


class GenericServerError(EncordException):
"""The server has reported an error which is not recognised by this SDK version. Try upgrading the SDK version to
"""The server has reported an error which is not recognized by this SDK version. Try upgrading the SDK version to
see the precise error that is reported.
"""

Expand Down
2 changes: 1 addition & 1 deletion encord/objects/ontology_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def from_dict(cls, d: dict) -> Object:
"""
shape_opt = Shape.from_string(d["shape"])
if shape_opt is None:
raise TypeError(f"The shape '{d['shape']}' of the object '{d}' is not recognised")
raise TypeError(f"The shape '{d['shape']}' of the object '{d}' is not recognized")

attributes_ret: List[Attribute] = [
attribute_from_dict(attribute_dict) for attribute_dict in d.get("attributes", [])
Expand Down
2 changes: 1 addition & 1 deletion encord/orm/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def images_data(self) -> Optional[List[ImageData]]:
@deprecated("0.1.98", ".is_image_sequence")
def is_optimised_image_group(self) -> Optional[bool]:
"""If the data type is an :meth:`DataType.IMG_GROUP <encord.constants.enums.DataType.IMG_GROUP>`,
returns whether this is a performance optimised image group. Returns `None` for other data types.
returns whether this is a performance optimized image group. Returns `None` for other data types.

DEPRECATED: This method is deprecated and will be removed in the upcoming library version.
Please use :meth:`.is_image_sequence` instead
Expand Down
26 changes: 13 additions & 13 deletions encord/orm/label_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class LabelRow(base_orm.BaseORM):
action) pairs.
* ``label_status`` is a string indicating label status. It can take the values
enumerated in :class:`encord.orm.label_row.LabelStatus`. *Note* that this does
*not* reflect thes status shown in the Projects->Labels section on the web-app.
*not* reflect the status shown in the Projects->Labels section on the web-app.

A data unit, mentioned for the dictionary entry ``data_units`` above, has in the
form::

```
Comment on lines 46 to +47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While migrating the docstrings to use Markdown code blocks, the reStructuredText directive :: was left behind. This will be rendered as literal double colons in Markdown. It should be a single colon : for correct grammar and formatting.

Suggested change
form::
```
form:
```

label_row = { # The label row
# ...
"data_units": {
Expand All @@ -64,7 +64,7 @@ class LabelRow(base_orm.BaseORM):
# ...,
}
}

```
A data unit can have any number of vector labels (e.g. bounding box, polygon, keypoint) and classifications.

**Objects and classifications**
Expand All @@ -84,7 +84,7 @@ class LabelRow(base_orm.BaseORM):
videos.

A labels dictionary for video is in the form::

```
Comment on lines 86 to +87
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to a previous comment, the reStructuredText directive :: should be replaced with a single colon : now that the docstring is using Markdown for code blocks.

Suggested change
A labels dictionary for video is in the form::
```
A labels dictionary for video is in the form:
```

label_row["data_units"]["<data_hash>"]["labels"] = {
"<frame_number>": {
"objects": [
Expand All @@ -99,9 +99,9 @@ class LabelRow(base_orm.BaseORM):
],
}
}

```
A labels dictionary for an img_group data unit is in the form::

```
Comment on lines 103 to +104
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The reStructuredText directive :: should be replaced with a single colon : for consistency with the move to Markdown for code blocks.

Suggested change
A labels dictionary for an img_group data unit is in the form::
```
A labels dictionary for an img_group data unit is in the form:
```

label_row["data_units"]["<data_hash>"]["labels"] = {
"objects": [
# { object 1 },
Expand All @@ -114,9 +114,9 @@ class LabelRow(base_orm.BaseORM):
# ...
],
}

```
The object answers dictionary is in the form::

```
Comment on lines 118 to +119
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The reStructuredText directive :: should be replaced with a single colon : for consistency with the move to Markdown for code blocks.

Suggested change
The object answers dictionary is in the form::
```
The object answers dictionary is in the form:
```

label_row["object_answers"] = {
"<object_hash>": {
"objectHash": "<object_hash>",
Expand All @@ -128,9 +128,9 @@ class LabelRow(base_orm.BaseORM):
},
# ...
}

```
The classification answers dictionary is in the form::

```
Comment on lines 132 to +133
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The reStructuredText directive :: should be replaced with a single colon : for consistency with the move to Markdown for code blocks.

Suggested change
The classification answers dictionary is in the form::
```
The classification answers dictionary is in the form:
```

label_row["classification_answers"] = {
"<classification_hash>": {
"classificationHash": "<classification_hash>",
Expand All @@ -142,9 +142,9 @@ class LabelRow(base_orm.BaseORM):
},
# ...
}

```
The object actions dictionary is in the form::

```
Comment on lines 146 to +147
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The reStructuredText directive :: should be replaced with a single colon : for consistency with the move to Markdown for code blocks.

Suggested change
The object actions dictionary is in the form::
```
The object actions dictionary is in the form:
```

label_row["object_actions"] = {
"<object_hash>": {
"objectHash": "<object_hash>",
Expand All @@ -156,7 +156,7 @@ class LabelRow(base_orm.BaseORM):
},
# ...
}

```
"""

DB_FIELDS = OrderedDict(
Expand Down
9 changes: 6 additions & 3 deletions encord/orm/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Project(base_orm.BaseORM):
* editor_ontology,
* ontology_hash,
* datasets::

```
Comment on lines 29 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While migrating the docstrings to use Markdown code blocks, the reStructuredText directive :: was left behind. This will be rendered as literal double colons in Markdown. It should be a single colon : for correct grammar and formatting.

Suggested change
* datasets::
```
* datasets:
```

[
{
dataset_hash (uid),
Expand All @@ -37,8 +37,9 @@ class Project(base_orm.BaseORM):
},
...
],
```
* label_rows::

```
Comment on lines 41 to +42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to a previous comment, the reStructuredText directive :: should be replaced with a single colon : now that the docstring is using Markdown for code blocks.

Suggested change
* label_rows::
```
* label_rows:
```

[
{
label_hash (uid),
Expand All @@ -51,6 +52,7 @@ class Project(base_orm.BaseORM):
},
...
]
```
* annotation_task_status

"""
Expand Down Expand Up @@ -78,7 +80,7 @@ def get_labels_list(self) -> List[Optional[str]]:
a `None` value is appended. This can be useful for working with fetching additional label row data via
:meth:`encord.project.Project.get_label_rows` for example.

.. code::
```

project = client_instance.get_project(<project_hash>)
project_orm = project.get_project()
Expand All @@ -90,6 +92,7 @@ def get_labels_list(self) -> List[Optional[str]]:
created_labels_list.append(label)

label_rows = project.get_label_rows(created_labels_list, get_signed_url=False)
```
"""
labels = self.label_rows() or []
return [label.get("label_hash") for label in labels]
Expand Down
Loading