unienv_interface.remote.proxies¶
Local Env / World / WorldNode / DataTransformation views of objects hosted by a server.
Every method is one remote call. Spaces, timings and metadata come from the
server's descriptor; spaces are refreshed whenever a reset changed them.
close() on a proxy does nothing: hosted objects belong to the server.
Components mode is a plain local WorldEnv over remote proxies (host them with
server.register_recursive("sim", env))::
env = WorldEnv(client.world("sim/world"), client.node("sim/node"))
Classes:
| Name | Description |
|---|---|
RemoteEnv |
An |
RemoteWorld |
A |
RemoteWorldNode |
A |
RemoteDataTransformation |
A |
RemoteEnv
¶
RemoteEnv(client: RemoteClient, name: str)
Bases: _Remote, Env
An Env hosted by a :class:RemoteServer.
Methods:
| Name | Description |
|---|---|
reset |
|
reload |
|
step |
|
render |
|
get_node |
Node proxy by key path, for envs built on a |
close |
No-op: the hosted object stays open (it is closed by its server). |
sample_space |
Sample from |
sample_action |
Sample one action from |
sample_observation |
Sample one observation from |
sample_context |
Sample one context value if |
update_observation_post_reset |
Merge masked reset observations back into a full batched observation. |
update_context_post_reset |
Merge masked reset contexts back into a full batched context. |
has_wrapper_attr |
Checks if the attribute |
get_wrapper_attr |
Gets the attribute |
set_wrapper_attr |
Sets the attribute |
Attributes:
| Name | Type | Description |
|---|---|---|
rng |
|
|
metadata |
dict[str, Any]
|
|
render_mode |
Optional[str]
|
|
render_fps |
Optional[int]
|
|
backend |
ComputeBackend[BArrayType, BDeviceType, BDtypeType, BRNGType]
|
|
device |
Optional[BDeviceType]
|
|
batch_size |
Optional[int]
|
|
action_space |
Space[ActType, BDeviceType, BDtypeType, BRNGType]
|
|
observation_space |
Space[ObsType, BDeviceType, BDtypeType, BRNGType]
|
|
context_space |
Optional[Space[ContextType, BDeviceType, BDtypeType, BRNGType]]
|
|
unwrapped |
Env
|
|
prev_wrapper_layer |
Optional[Env]
|
|
client |
RemoteClient
|
|
remote_name |
str
|
|
observation_space
instance-attribute
¶
context_space
class-attribute
instance-attribute
¶
context_space: Optional[Space[ContextType, BDeviceType, BDtypeType, BRNGType]] = None
get_node
¶
get_node(nested_keys: Union[str, Sequence[str]]) -> Optional[RemoteWorldNode]
Node proxy by key path, for envs built on a WorldEnv.
sample_context
¶
sample_context() -> Optional[ContextType]
Sample one context value if context_space is defined.
update_observation_post_reset
¶
update_observation_post_reset(
old_obs: ObsType, newobs_masked: ObsType, mask: BArrayType
) -> ObsType
Merge masked reset observations back into a full batched observation.
update_context_post_reset
¶
update_context_post_reset(
old_context: ContextType, new_context: ContextType, mask: BArrayType
) -> ContextType
Merge masked reset contexts back into a full batched context.
has_wrapper_attr
¶
Checks if the attribute name exists in the environment.
set_wrapper_attr
¶
Sets the attribute name on the environment with value.
RemoteWorld
¶
RemoteWorld(client: RemoteClient, name: str)
Bases: _Remote, World
A World hosted by a :class:RemoteServer.
Methods:
| Name | Description |
|---|---|
step |
|
reset |
|
reload |
|
after_reset |
|
after_reload |
|
close |
No-op: the hosted object stays open (it is closed by its server). |
is_control_timestep_compatible |
Check whether a node control period aligns with |
Attributes:
| Name | Type | Description |
|---|---|---|
world_timestep |
Optional[float]
|
|
backend |
ComputeBackend[BArrayType, BDeviceType, BDtypeType, BRNGType]
|
|
device |
Optional[BDeviceType]
|
The world timestep in seconds, if None, the world is asynchronous (real-time) |
world_subtimestep |
Optional[float]
|
The number of parallel environments in this world |
batch_size |
Optional[int]
|
|
client |
RemoteClient
|
|
remote_name |
str
|
|
device
instance-attribute
¶
The world timestep in seconds, if None, the world is asynchronous (real-time)
world_subtimestep
class-attribute
instance-attribute
¶
The number of parallel environments in this world
is_control_timestep_compatible
¶
Check whether a node control period aligns with world_timestep.
RemoteWorldNode
¶
RemoteWorldNode(client: RemoteClient, name: str)
Bases: _Remote, WorldNode
A WorldNode hosted by a :class:RemoteServer.
Methods:
| Name | Description |
|---|---|
reset |
|
reload |
|
after_reset |
|
after_reload |
|
pre_environment_step |
|
post_environment_step |
|
set_next_action |
|
get_context |
|
get_observation |
|
get_reward |
|
get_termination |
|
get_truncation |
|
get_info |
|
render |
|
get_node |
|
get_nodes_by_fn |
|
get_nodes_by_type |
Return nodes in this subtree that are instances of |
close |
No-op: the hosted object stays open (it is closed by its server). |
has_wrapper_attr |
Checks if the attribute |
get_wrapper_attr |
Gets the attribute |
set_wrapper_attr |
Sets the attribute |
Attributes:
| Name | Type | Description |
|---|---|---|
world |
|
|
backend |
ComputeBackend
|
|
device |
Any
|
|
nodes |
List[RemoteWorldNode]
|
Proxies of the child nodes (empty for a leaf node). |
name |
str
|
|
control_timestep |
Optional[float]
|
|
update_timestep |
Optional[float]
|
|
context_space |
Optional[Space[ContextType, BDeviceType, BDtypeType, BRNGType]]
|
|
observation_space |
Optional[Space[ObsType, BDeviceType, BDtypeType, BRNGType]]
|
|
action_space |
Optional[Space[ActType, BDeviceType, BDtypeType, BRNGType]]
|
|
has_reward |
bool
|
|
has_termination_signal |
bool
|
|
has_truncation_signal |
bool
|
|
supported_render_modes |
Sequence[str]
|
|
render_mode |
Optional[str]
|
|
reset_priorities |
Set[int]
|
|
reload_priorities |
Set[int]
|
|
after_reset_priorities |
Set[int]
|
|
after_reload_priorities |
Set[int]
|
|
pre_environment_step_priorities |
Set[int]
|
|
post_environment_step_priorities |
Set[int]
|
|
can_render |
bool
|
Whether the node currently exposes a render mode. |
effective_update_timestep |
Optional[float]
|
Resolved update period, defaulting to |
unwrapped |
WorldNode
|
|
prev_wrapper_layer |
Optional[WorldNode]
|
|
client |
RemoteClient
|
|
remote_name |
str
|
|
context_space
class-attribute
instance-attribute
¶
context_space: Optional[Space[ContextType, BDeviceType, BDtypeType, BRNGType]] = None
observation_space
class-attribute
instance-attribute
¶
action_space
class-attribute
instance-attribute
¶
supported_render_modes
class-attribute
instance-attribute
¶
after_reset_priorities
class-attribute
instance-attribute
¶
after_reload_priorities
class-attribute
instance-attribute
¶
pre_environment_step_priorities
class-attribute
instance-attribute
¶
post_environment_step_priorities
class-attribute
instance-attribute
¶
effective_update_timestep
property
¶
Resolved update period, defaulting to control_timestep when unset.
reset
¶
reload
¶
get_nodes_by_type
¶
Return nodes in this subtree that are instances of node_type.
has_wrapper_attr
¶
Checks if the attribute name exists in the environment.
set_wrapper_attr
¶
Sets the attribute name on the environment with value.
RemoteDataTransformation
¶
RemoteDataTransformation(client: RemoteClient, name: str)
Bases: _Remote, DataTransformation
A DataTransformation hosted by a :class:RemoteServer.
transform and get_target_space_from_source run on the server: the
source space and the data are rebuilt there on the backend / device the
transformation was registered with, and the result comes back on the
client's. Use it to run a transformation whose dependencies live in another
environment (e.g. a grasp synthesizer pinned to an old CUDA toolchain).
The proxy has no inverse and cannot be serialized: it is bound to its connection (serialize the hosted transformation on the server instead).
Methods:
| Name | Description |
|---|---|
get_target_space_from_source |
|
transform |
|
serialize |
|
deserialize_from |
|
direction_inverse |
Return the inverse transformation when one exists. |
close |
No-op: the hosted object stays open (it is closed by its server). |
Attributes:
| Name | Type | Description |
|---|---|---|
has_inverse |
|
|
client |
RemoteClient
|
|
remote_name |
str
|
|
deserialize_from
classmethod
¶
deserialize_from(
json_data: Dict[str, Any], source_space: Any = None
) -> RemoteDataTransformation
direction_inverse
¶
direction_inverse(
source_space: Optional[
Space[SourceDataT, SourceBDeviceT, SourceBDTypeT, SourceBDRNGT]
] = None,
) -> Optional[DataTransformation]
Return the inverse transformation when one exists.