rhino_health.lib.endpoints.code_run.code_run_dataclass#

Module Contents#

Classes#

CodeRunStatus

CodeRunInputWorkgroupInputDatasets

!!! abstract "Usage Documentation"

CodeRunInputWorkgroupDatasets

!!! abstract "Usage Documentation"

CodeRunInputDatasets

!!! abstract "Usage Documentation"

CodeRunWorkgroupOutputDatasets

!!! abstract "Usage Documentation"

CodeRunWorkgroupDatasets

!!! abstract "Usage Documentation"

CodeRunOutputDatasets

!!! abstract "Usage Documentation"

CodeRunLogs

!!! abstract "Usage Documentation"

CodeRun

Result of a code run

class rhino_health.lib.endpoints.code_run.code_run_dataclass.CodeRunStatus#

Bases: str, enum.Enum

INITIALIZING = 'Initializing'#
STARTED = 'Started'#
COMPLETED = 'Completed'#
FAILED = 'Failed'#
HALTING = 'Halting'#
HALTED_SUCCESS = 'Halted: Success'#
HALTED_FAILURE = 'Halted: Failure'#
class rhino_health.lib.endpoints.code_run.code_run_dataclass.CodeRunInputWorkgroupInputDatasets(/, root=PydanticUndefined, **data)#

Bases: pydantic.RootModel

!!! abstract “Usage Documentation”

[RootModel and Custom Root Types](../concepts/models.md#rootmodel-and-custom-root-types)

A Pydantic BaseModel for the root object of the model.

Attributes:

root: The root object of the model. __pydantic_root_model__: Whether the model is a RootModel. __pydantic_private__: Private fields in the model. __pydantic_extra__: Extra fields in the model.

root: List[str]#
class rhino_health.lib.endpoints.code_run.code_run_dataclass.CodeRunInputWorkgroupDatasets(/, root=PydanticUndefined, **data)#

Bases: pydantic.RootModel

!!! abstract “Usage Documentation”

[RootModel and Custom Root Types](../concepts/models.md#rootmodel-and-custom-root-types)

A Pydantic BaseModel for the root object of the model.

Attributes:

root: The root object of the model. __pydantic_root_model__: Whether the model is a RootModel. __pydantic_private__: Private fields in the model. __pydantic_extra__: Extra fields in the model.

root: List[CodeRunInputWorkgroupInputDatasets]#
class rhino_health.lib.endpoints.code_run.code_run_dataclass.CodeRunInputDatasets(/, root=PydanticUndefined, **data)#

Bases: pydantic.RootModel

!!! abstract “Usage Documentation”

[RootModel and Custom Root Types](../concepts/models.md#rootmodel-and-custom-root-types)

A Pydantic BaseModel for the root object of the model.

Attributes:

root: The root object of the model. __pydantic_root_model__: Whether the model is a RootModel. __pydantic_private__: Private fields in the model. __pydantic_extra__: Extra fields in the model.

root: List[CodeRunInputWorkgroupDatasets]#
class rhino_health.lib.endpoints.code_run.code_run_dataclass.CodeRunWorkgroupOutputDatasets(/, root=PydanticUndefined, **data)#

Bases: pydantic.RootModel

!!! abstract “Usage Documentation”

[RootModel and Custom Root Types](../concepts/models.md#rootmodel-and-custom-root-types)

A Pydantic BaseModel for the root object of the model.

Attributes:

root: The root object of the model. __pydantic_root_model__: Whether the model is a RootModel. __pydantic_private__: Private fields in the model. __pydantic_extra__: Extra fields in the model.

root: List[str]#
class rhino_health.lib.endpoints.code_run.code_run_dataclass.CodeRunWorkgroupDatasets(/, root=PydanticUndefined, **data)#

Bases: pydantic.RootModel

!!! abstract “Usage Documentation”

[RootModel and Custom Root Types](../concepts/models.md#rootmodel-and-custom-root-types)

A Pydantic BaseModel for the root object of the model.

Attributes:

root: The root object of the model. __pydantic_root_model__: Whether the model is a RootModel. __pydantic_private__: Private fields in the model. __pydantic_extra__: Extra fields in the model.

root: List[CodeRunWorkgroupOutputDatasets]#
class rhino_health.lib.endpoints.code_run.code_run_dataclass.CodeRunOutputDatasets(/, root=PydanticUndefined, **data)#

Bases: pydantic.RootModel

!!! abstract “Usage Documentation”

[RootModel and Custom Root Types](../concepts/models.md#rootmodel-and-custom-root-types)

A Pydantic BaseModel for the root object of the model.

Attributes:

root: The root object of the model. __pydantic_root_model__: Whether the model is a RootModel. __pydantic_private__: Private fields in the model. __pydantic_extra__: Extra fields in the model.

root: List[CodeRunWorkgroupDatasets]#
class rhino_health.lib.endpoints.code_run.code_run_dataclass.CodeRunLogs(/, **data: Any)#

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

Attributes:

__class_vars__: The names of the class variables defined on the model. __private_attributes__: Metadata about the private attributes of the model. __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.

__pydantic_complete__: Whether model building is completed, or if there are still undefined fields. __pydantic_core_schema__: The core schema of the model. __pydantic_custom_init__: Whether the model has a custom __init__ function. __pydantic_decorators__: Metadata containing the decorators defined on the model.

This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

__pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to

__args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.

__pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. __pydantic_post_init__: The name of the post-init method for the model, if defined. __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel]. __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model. __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.

__pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

__pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra]

is set to ‘allow’.

__pydantic_fields_set__: The names of fields explicitly set during instantiation. __pydantic_private__: Values of private attributes set on the model instance.

logs: List[Dict[str, Any]]#
errors: List[str]#
warnings: List[str]#
class rhino_health.lib.endpoints.code_run.code_run_dataclass.CodeRun(**data)#

Result of a code run

property input_datasets#

Return the Input Datasets that were used for this CodeRun

Warning

The result of this function is cached. Be careful calling this function after making changes

Returns:
datasets: List[Dataset]

Dataclasses representing the Datasets

property output_datasets#

Return the Output Datasets that were used for this CodeRun

Warning

The result of this function is cached. Be careful calling this function after making changes

Returns:
datasets: List[Dataset]

Dataclasses representing the Datasets

property warnings#

Returns any warnings that occurred during this run

property errors#

Returns any errors that occurred during this run

property code_object: CodeObject#

Return the CodeObject Dataclass associated with code_object_uid

Warning

The result of this function is cached. Be careful calling this function after making changes. All dataclasses must already exist on the platform before making this call.

Returns:
code_object: CodeObject

Dataclass representing the CodeObject

property creator: User#

Return the User Dataclass associated with creator_uid

Warning

The result of this function is cached. Be careful calling this function after making changes. All dataclasses must already exist on the platform before making this call.

Returns:
creator: User

Dataclass representing the User

uid: str#

The unique ID of the CodeRun

description: str | None#

The description of the code run

action_type: str#

The type of code run performed

status: CodeRunStatus#

The code run status

start_time: str#

The code run start time

end_time: Any#

The code run end time

input_dataset_uids: CodeRunInputDatasets | None#

A triply-nested list of dataset uids. Each entry is a list of lists of datasets corresponding to a single workgroup within the code run. [[[first_dataset_for_first_run], [second_dataset_for_first_run] …], [[first_dataset_for_second_run], [second_dataset_for_second_run] …], …]

output_dataset_uids: CodeRunOutputDatasets | None#

A triply-nested list of dataset uids. Each entry is a list of lists of datasets corresponding to a single workgroup within the code run. [[[first_dataset_for_first_run], [second_dataset_for_first_run] …], [[first_dataset_for_second_run], [second_dataset_for_second_run] …], …]

code_object_uid: str#
results_report: str | dict | None#

The run result report

report_images: List[Any]#

The run result images

paths_to_model_params: typing_extensions.Annotated[List[str] | None, Field(alias='model_params_external_storage_paths')]#

The external paths where model param results are stored, if any

created_at: typing_extensions.Annotated[str, Field(alias='start_time')]#
published: bool = False#

Whether this code run is published

creator_uid: str#

The UID of the creator of this dataclass on the system

code_object_name: str#

The code_object name

creator_name: str#

The creator name

save_model_params(file_name)#

Saves the model params to a file.

Warning

This feature is under development and the interface may change

Parameters:
file_name: str

Name of the file to save to

wait_for_completion(timeout_seconds: int = 500, poll_frequency: int = 10, print_progress: bool = True)#

Wait for the asynchronous CodeRun to complete

Parameters:
timeout_seconds: int = 500

How many seconds to wait before timing out

poll_frequency: int = 10

How frequent to check the status, in seconds

print_progress: bool = True

Whether to print how long has elapsed since the start of the wait

Returns:
code_run: CodeRun

Dataclass representing the CodeRun of the run

publish(unpublish_other_versions: bool = True)#
unpublish()#