Skip to content

Commit

Permalink
DOCS-2651: Fix flutter datatype rendering (#3125)
Browse files Browse the repository at this point in the history
  • Loading branch information
andf-viam authored Jul 11, 2024
1 parent 4ad8693 commit e7f032b
Show file tree
Hide file tree
Showing 25 changed files with 80 additions and 78 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update_sdk_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ def parse(type, names):

## Parse for param name and usage string, convert to string (for markdownify):
param_name = parameter_tag.find('span', class_ = 'parameter-name').text
param_usage = str(parameter_tag.find('span', class_ = 'type-annotation'))
param_usage = str(parameter_tag.find('span', class_ = 'type-annotation')).replace('>>', '>\\>')

## Markdownify parameter usage and replace relative links with absolute:
formatted_param_usage = md(param_usage, strip=['wbr']).replace("../../", "https://flutter.viam.dev/")
Expand Down Expand Up @@ -1386,7 +1386,7 @@ def parse(type, names):

## Markdownify return usage and replace relative links with absolute:
formatted_return_usage = md(return_usage, strip=['wbr']).replace("../../", "https://flutter.viam.dev/")
this_method_return_dict["return_usage"] = formatted_return_usage
this_method_return_dict["return_usage"] = formatted_return_usage.replace('>>', '>\\>')

# Parse return type:
if return_tag.find('span', class_ = 'type-parameter'):
Expand Down
8 changes: 5 additions & 3 deletions static/include/app/apis/generated/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,8 @@ Get a list of {{< glossary_tooltip term_id="fragment" text="fragments" >}} in th
**Parameters:**

- `org_id` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization to list fragments for. You can obtain your organization ID from the Viam app’s organization settings page.
- `show_public` ([bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (required): Optional boolean specifying whether or not to only show public fragments. If True, only public fragments will return. If False, only private fragments will return. Defaults to True.
- `show_public` ([bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (required): Deprecated: Use visibilities instead. Optional boolean specifying whether or not to only show public fragments. If True, only public fragments will return. If False, only private fragments will return. Defaults to True. Deprecated since version 0.25.0: Use visibilities instead.
- `visibilities` ([List[Fragment]](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.Fragment.Visibility)) (optional): List of FragmentVisibilities specifying which types of fragments to include in the results. If empty, by default only public fragments will be returned.

**Returns:**

Expand All @@ -1062,7 +1063,7 @@ Get a list of {{< glossary_tooltip term_id="fragment" text="fragments" >}} in th
**Example:**

```python {class="line-numbers linkable-line-numbers"}
fragments_list = await cloud.list_fragments(org_id="org-id", show_public=False)
fragments_list = await cloud.list_fragments(org_id="org-id", visibilities=[])
```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.list_fragments).
Expand Down Expand Up @@ -1147,7 +1148,8 @@ Update a {{< glossary_tooltip term_id="fragment" text="fragment" >}} name and it
- `fragment_id` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): ID of the fragment to update.
- `name` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): New name to associate with the fragment.
- `config` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Optional Dictionary representation of new config to assign to specified fragment. Not passing this parameter will leave the fragment’s config unchanged.
- `public` ([bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (optional): Boolean specifying whether the fragment is public. Not passing this parameter will leave the fragment’s visibility unchanged. A fragment is private by default when created.
- `public` ([bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)) (optional): Deprecated: Use visibility instead. Boolean specifying whether the fragment is public. Not passing this parameter will leave the fragment’s visibility unchanged. A fragment is private by default when created. Deprecated since version 0.25.0: Use visibility instead.
- `visibility` ([Fragment](https://python.viam.dev/autoapi/viam/gen/app/v1/app_pb2/index.html#viam.gen.app.v1.app_pb2.FragmentVisibility)) (optional): Optional FragmentVisibility list specifying who should be allowed to view the fragment. Not passing this parameter will leave the fragment’s visibility unchanged. A fragment is private by default when created.

**Returns:**

Expand Down
6 changes: 3 additions & 3 deletions static/include/app/apis/generated/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ Remove tags from binary by ids.
**Parameters:**

- `tags` (List[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)]) (required): List of tags to remove from specified binary data. Must be non-empty.
- `binary_ids` ([List[viam.proto.app.data.BinaryID]](https://python.viam.dev/autoapi/viam/app/data_client/index.html#viam.app.data_client.BinaryID)) (required): List of BinaryID objects specifying binary data to untag. Must be non-empty.
- `binary_ids` ([List[viam.proto.app.data.BinaryID]](https://python.viam.dev/autoapi/viam/gen/app/data/v1/data_pb2/index.html#viam.gen.app.data.v1.data_pb2.BinaryID)) (required): List of BinaryID objects specifying binary data to untag. Must be non-empty.

**Returns:**

Expand Down Expand Up @@ -663,7 +663,7 @@ This BinaryData will be tagged with the VIAM_DATASET\_{id} label.

**Parameters:**

- `binary_ids` ([List[viam.proto.app.data.BinaryID]](https://python.viam.dev/autoapi/viam/app/data_client/index.html#viam.app.data_client.BinaryID)) (required): The IDs of binary data to add to dataset. To retrieve these IDs, navigate to your dataset’s page in the Viam app, click … in the left-hand menu, and click Copy dataset ID.
- `binary_ids` ([List[viam.proto.app.data.BinaryID]](https://python.viam.dev/autoapi/viam/gen/app/data/v1/data_pb2/index.html#viam.gen.app.data.v1.data_pb2.BinaryID)) (required): The IDs of binary data to add to dataset. To retrieve these IDs, navigate to your dataset’s page in the Viam app, click … in the left-hand menu, and click Copy dataset ID.
- `dataset_id` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the dataset to be added to.

**Returns:**
Expand Down Expand Up @@ -711,7 +711,7 @@ This BinaryData will lose the VIAM_DATASET\_{id} tag.

**Parameters:**

- `binary_ids` ([List[viam.proto.app.data.BinaryID]](https://python.viam.dev/autoapi/viam/app/data_client/index.html#viam.app.data_client.BinaryID)) (required): The IDs of binary data to remove from dataset. To retrieve these IDs, navigate to your dataset’s page in the Viam app, click … in the left-hand menu, and click Copy dataset ID.
- `binary_ids` ([List[viam.proto.app.data.BinaryID]](https://python.viam.dev/autoapi/viam/gen/app/data/v1/data_pb2/index.html#viam.gen.app.data.v1.data_pb2.BinaryID)) (required): The IDs of binary data to remove from dataset. To retrieve these IDs, navigate to your dataset’s page in the Viam app, click … in the left-hand menu, and click Copy dataset ID.
- `dataset_id` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the dataset to be removed from.

**Returns:**
Expand Down
2 changes: 1 addition & 1 deletion static/include/app/apis/generated/mltraining.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Get training job metadata for all jobs within an organization.
**Parameters:**

- `org_id` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): the id of the org to request training job data from.
- `training_status` ([viam.proto.app.mltraining.TrainingStatus.ValueType](https://python.viam.dev/autoapi/viam/app/ml_training_client/index.html#viam.app.ml_training_client.TrainingStatus)) (optional): status of training jobs to filter the list by. If unspecified, all training jobs will be returned.
- `training_status` ([viam.proto.app.mltraining.TrainingStatus.ValueType](https://python.viam.dev/autoapi/viam/gen/app/mltraining/v1/ml_training_pb2/index.html#viam.gen.app.mltraining.v1.ml_training_pb2.TrainingStatus)) (optional): status of training jobs to filter the list by. If unspecified, all training jobs will be returned.

**Returns:**

Expand Down
8 changes: 4 additions & 4 deletions static/include/components/apis/generated/arm.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Move the end of the arm to the desired [pose](/internals/orientation-vector/), r

**Parameters:**

- `pose` ([viam.components.arm.Pose](https://python.viam.dev/autoapi/viam/components/arm/arm/index.html#viam.components.arm.arm.Pose)) (required): The destination Pose for the arm. The Pose is composed of values for location and orientation with respect to the origin. Location is expressed as distance, which is represented by x, y, and z coordinate values. Orientation is expressed as an orientation vector, which is represented by o_x, o_y, o_z, and theta values.
- `pose` ([viam.components.arm.Pose](https://python.viam.dev/autoapi/viam/components/arm/index.html#viam.components.arm.Pose)) (required): The destination Pose for the arm. The Pose is composed of values for location and orientation with respect to the origin. Location is expressed as distance, which is represented by x, y, and z coordinate values. Orientation is expressed as an orientation vector, which is represented by o_x, o_y, o_z, and theta values.
- `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.
- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

Expand Down Expand Up @@ -173,7 +173,7 @@ Collision checks are not enabled when doing direct joint control with MoveToJoin

**Parameters:**

- `positions` ([viam.proto.component.arm.JointPositions](https://python.viam.dev/autoapi/viam/components/arm/client/index.html#viam.components.arm.client.JointPositions)) (required): The destination JointPositions for the arm.
- `positions` ([viam.proto.component.arm.JointPositions](https://python.viam.dev/autoapi/viam/components/arm/index.html#viam.components.arm.JointPositions)) (required): The destination JointPositions for the arm.
- `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.
- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

Expand Down Expand Up @@ -318,7 +318,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c

**Returns:**

- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[List](https://api.flutter.dev/flutter/dart-core/List-class.html)<[double](https://api.flutter.dev/flutter/dart-core/double-class.html)>>
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[List](https://api.flutter.dev/flutter/dart-core/List-class.html)<[double](https://api.flutter.dev/flutter/dart-core/double-class.html)>\>

**Example:**

Expand Down Expand Up @@ -673,7 +673,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r

**Returns:**

- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>>
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\>

**Example:**

Expand Down
12 changes: 6 additions & 6 deletions static/include/components/apis/generated/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ Set the linear and angular power of the base, represented as a percentage of max

**Parameters:**

- `linear` ([viam.components.base.Vector3](https://python.viam.dev/autoapi/viam/components/base/base/index.html#viam.components.base.base.Vector3)) (required): The linear component. Only the Y component is used for wheeled base. Positive implies forwards.
- `angular` ([viam.components.base.Vector3](https://python.viam.dev/autoapi/viam/components/base/base/index.html#viam.components.base.base.Vector3)) (required): The angular component. Only the Z component is used for wheeled base. Positive turns left; negative turns right.
- `linear` ([viam.components.base.Vector3](https://python.viam.dev/autoapi/viam/components/base/index.html#viam.components.base.Vector3)) (required): The linear component. Only the Y component is used for wheeled base. Positive implies forwards.
- `angular` ([viam.components.base.Vector3](https://python.viam.dev/autoapi/viam/components/base/index.html#viam.components.base.Vector3)) (required): The angular component. Only the Z component is used for wheeled base. Positive turns left; negative turns right.
- `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.
- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

Expand Down Expand Up @@ -292,8 +292,8 @@ Set the linear velocity (mm/sec) and angular velocity (degrees/sec) of the base.

**Parameters:**

- `linear` ([viam.components.base.Vector3](https://python.viam.dev/autoapi/viam/components/base/base/index.html#viam.components.base.base.Vector3)) (required): Velocity in mm/sec.
- `angular` ([viam.components.base.Vector3](https://python.viam.dev/autoapi/viam/components/base/base/index.html#viam.components.base.base.Vector3)) (required): Velocity in deg/sec.
- `linear` ([viam.components.base.Vector3](https://python.viam.dev/autoapi/viam/components/base/index.html#viam.components.base.Vector3)) (required): Velocity in mm/sec.
- `angular` ([viam.components.base.Vector3](https://python.viam.dev/autoapi/viam/components/base/index.html#viam.components.base.Vector3)) (required): Velocity in deg/sec.
- `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.
- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

Expand Down Expand Up @@ -380,7 +380,7 @@ Get the width and turning radius of the {{< glossary_tooltip term_id="model" tex

**Returns:**

- (viam.components.base.Base.Properties): The properties of the base.
- ([viam.components.base.Base.Properties](https://python.viam.dev/autoapi/viam/components/base/index.html#viam.components.base.Base.Properties)): The properties of the base.

**Example:**

Expand Down Expand Up @@ -741,7 +741,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r

**Returns:**

- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>>
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\>

**Example:**

Expand Down
4 changes: 2 additions & 2 deletions static/include/components/apis/generated/board.md
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ This is expected: the board has been successfully powered down and can no longer

**Parameters:**

- `mode` ([viam.proto.component.board.PowerMode.ValueType](https://python.viam.dev/autoapi/viam/components/board/client/index.html#viam.components.board.client.PowerMode)) (required): The desired power mode.
- `mode` ([viam.proto.component.board.PowerMode.ValueType](https://python.viam.dev/autoapi/viam/gen/component/board/v1/board_pb2/index.html#viam.gen.component.board.v1.board_pb2.PowerMode)) (required): The desired power mode.
- `duration` ([datetime.timedelta](https://docs.python.org/3/library/datetime.html#timedelta-objects)) (optional): Requested duration to stay in power mode.
- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

Expand Down Expand Up @@ -1265,7 +1265,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r

**Returns:**

- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>>
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\>

**Example:**

Expand Down
2 changes: 1 addition & 1 deletion static/include/components/apis/generated/camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/

**Returns:**

- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>>
- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\>

**Example:**

Expand Down
2 changes: 1 addition & 1 deletion static/include/components/apis/generated/encoder.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Absolute encoders return degrees.

**Parameters:**

- `position_type` ([viam.proto.component.encoder.PositionType.ValueType](https://python.viam.dev/autoapi/viam/components/encoder/client/index.html#viam.components.encoder.client.PositionType)) (optional): The desired output type of the position.
- `position_type` ([viam.proto.component.encoder.PositionType.ValueType](https://python.viam.dev/autoapi/viam/gen/component/encoder/v1/encoder_pb2/index.html#viam.gen.component.encoder.v1.encoder_pb2.PositionType)) (optional): The desired output type of the position.
- `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.
- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

Expand Down
Loading

0 comments on commit e7f032b

Please sign in to comment.