RemoteModel
- class RemoteModel
Description
A model loaded from a model server, with what a later push needs.
modelis the same typesyside.load_model()returns, so code taking a model runs on it unchanged.baseis the commit the model reflects: the loaded commit, then the commit of each successful push;Noneif 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 beNonefor a push to be accepted.baselineis every element’s payload atbase, keyed by id, against which the next push’s change set is computed;{}whenbaseisNoneor the commit has no elements.The fields other than
modelare those of the model’sRemoteState, whichpush_model()reads and updates through the model alone.modelis the model as loaded. Aftermodel.unlock(), push the model thatlock()returns: the state follows it, while the unlockedmodelholds no documents and a push of it is refused.Inheritance:
Members defined in
RemoteModel(10 members)RThe commit the model reflects; see the class docstring.
REvery element’s payload at
base; see the class docstring.RThe branch the model was loaded from, if it was loaded by branch.
RThe change set of the last successful push,
Nonebefore one.RThe ids of the standard library elements the server holds at
baseas stubs; the load did not build them, and references to them resolve to the core’s own library.RWRThe project the model was loaded from.
RThe id of the root
Namespacethat loading synthesized because the server had no elements (baseisNoneor the commit is empty), and that the server therefore does not have.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,
Nonebefore one.
- property library_on_server: frozenset[syside.experimental.remote.ElementId]
The ids of the standard library elements the server holds at
baseas stubs; the load did not build them, and references to them resolve to the core’s own library.
- model: syside.Model = None
- property unsaved_root: syside.experimental.remote.ElementId | None
The id of the root
Namespacethat loading synthesized because the server had no elements (baseisNoneor 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.
Nonewhen 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