syft.core.io.location¶
- class syft.core.io.location.Location(name=None)[source]¶
Bases:
syft.core.common.serde.serializable.Serializable
This represents the location of a node, including location-relevant metadata (such as how long it takes for us to communicate with this location, etc.)
- repr_short()[source]¶
Returns a SHORT human-readable version of the ID
Return a SHORT human-readable version of the ID which makes it print nicer when embedded (often alongside other UID objects) within other object __repr__ methods.
- static get_protobuf_schema()[source]¶
Return the type of protobuf object which stores a class of this type
As a part of serialization and deserialization, we need the ability to lookup the protobuf object type directly from the object type. This static method allows us to do this.
Importantly, this method is also used to create the reverse lookup ability within the metaclass of Serializable. In the metaclass, it calls this method and then it takes whatever type is returned from this method and adds an attribute to it with the type of this class attached to it. See the MetaSerializable class for details.
- Returns
the type of protobuf object which corresponds to this class.
- Return type
GeneratedProtocolMessageType
- class syft.core.io.location.SpecificLocation(id=None, name=None)[source]¶
Bases:
syft.core.common.object.ObjectWithID
,syft.core.io.location.location.Location
This represents the location of a single Node object represented by a single UID. It may not have any functionality beyond Location but there is logic, which interprets it differently.
- static get_protobuf_schema()[source]¶
Return the type of protobuf object which stores a class of this type
As a part of serialization and deserialization, we need the ability to lookup the protobuf object type directly from the object type. This static method allows us to do this.
Importantly, this method is also used to create the reverse lookup ability within the metaclass of Serializable. In the metaclass, it calls this method and then it takes whatever type is returned from this method and adds an attribute to it with the type of this class attached to it. See the MetaSerializable class for details.
- Returns
the type of protobuf object which corresponds to this class.
- Return type
GeneratedProtocolMessageType
- class syft.core.io.location.LocationGroup(known_group_members)[source]¶
Bases:
syft.core.io.location.location.Location
This represents a group of multiple locations. There are two kinds of LocationGroups, RegistryBackedLocationGroup and SubscriptionBackedLocationGroup. A registry backed group has an official owner with an official list while a subscription backed group is open to whoever knows the key to the group and chooses to subscribe. Both groups can have inclusion criteria which a location does or doesn’t meet.
- class syft.core.io.location.RegistryBackedLocationGroup(group_owner, known_group_members)[source]¶
Bases:
syft.core.io.location.group.group.LocationGroup
This is a location group where members of the group is determined by an official owner who has an official list. The best and most practical example of this is a Node and its group of children (or grandchildren, etc.). Sending messages to this group requires sending a message to its owner and asking it to redistribute to the group. However, we can still maintain a list of workers which we believe to be in the group which allows us to logically reason about the group itself.
Modules