RemoteModel

Labs

class RemoteModel

Description

A model loaded from a model server, with what a later push needs.

model is the same type syside.load_model() returns, so code taking a model runs on it unchanged. base is the commit the model reflects: the loaded commit, then the commit of each successful push; None if the model was loaded from a branch that has no commit yet (a new project’s default branch), in which case the branch’s head must still be None for a push to be accepted. baseline is every element’s payload at base, keyed by id, against which the next push’s change set is computed; {} when base is None or the commit has no elements.

The fields other than model are those of the model’s RemoteState, which push_model() reads and updates through the model alone.

model is the model as loaded. After model.unlock(), push the model that lock() returns: the state follows it, while the unlocked model holds no documents and a push of it is refused.

Inheritance:

Members defined in RemoteModel (10 members)

base

R

The commit the model reflects; see the class docstring.

baseline

R

Every element’s payload at base; see the class docstring.

branch

R

The branch the model was loaded from, if it was loaded by branch.

last_change_set

R

The change set of the last successful push, None before one.

library_on_server

R

The ids of the standard library elements the server holds at base as stubs; the load did not build them, and references to them resolve to the core’s own library.

model

RW

project

R

The project the model was loaded from.

unsaved_root

R

The id of the root Namespace that loading synthesized because the server had no elements (base is None or the commit is empty), and that the server therefore does not have.

__init__

__repr__

Attributes

property base: syside.experimental.remote.CommitId | None

The commit the model reflects; see the class docstring.

property baseline: dict[syside.experimental.remote.ElementId, syside.experimental.remote.ElementPayload]

Every element’s payload at base; see the class docstring.

property branch: syside.experimental.remote.BranchId | None

The branch the model was loaded from, if it was loaded by branch.

property last_change_set: syside.experimental.remote.ChangeSet | None

The change set of the last successful push, None before one.

property library_on_server: frozenset[syside.experimental.remote.ElementId]

The ids of the standard library elements the server holds at base as stubs; the load did not build them, and references to them resolve to the core’s own library.

model: syside.Model = None
property project: syside.experimental.remote.ProjectId

The project the model was loaded from.

property unsaved_root: syside.experimental.remote.ElementId | None

The id of the root Namespace that loading synthesized because the server had no elements (base is None or the commit is empty), and that the server therefore does not have.

The core cannot build a model without a root namespace, and new elements need an owner, so the model of an empty state is one user document with an empty root. The server has no such element; the first push creates it together with the new content, and then clears this field. None when the server has the root.

Methods

__init__(*, project: syside.experimental.remote.ProjectId, base: syside.experimental.remote.CommitId | None, branch: syside.experimental.remote.BranchId | None, model: syside.Model, baseline: dict[syside.experimental.remote.ElementId, syside.experimental.remote.ElementPayload], last_change_set: syside.experimental.remote.ChangeSet | None = ..., unsaved_root: syside.experimental.remote.ElementId | None = ..., server: syside.experimental.remote.ServerUrl | None = ..., credentials: syside.experimental.remote.Credentials | None = ..., library_on_server: frozenset[syside.experimental.remote.ElementId] = ..., library_stubs: bool = ...) → None
__repr__() → str