nvflare.apis.utils.decomposers.flare_decomposers module

Decomposers for objects used by NVFlare itself

This module contains all the decomposers used to run NVFlare. The decomposers are registered at server/client startup.

class AnalyticsDataTypeDecomposer[source]

Bases: Decomposer

decompose(target: AnalyticsDataType) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters

target – The instance to be serialized

Returns

The decomposed serializable objects

recompose(data: Any) AnalyticsDataType[source]

Reconstruct the object from decomposed components.

Parameters

data – The decomposed components

Returns

The reconstructed object

static supported_type()[source]

Returns the type/class supported by this decomposer.

Returns

The class (not instance) of supported type

class ClientDecomposer[source]

Bases: Decomposer

decompose(target: Client) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters

target – The instance to be serialized

Returns

The decomposed serializable objects

recompose(data: Any) Client[source]

Reconstruct the object from decomposed components.

Parameters

data – The decomposed components

Returns

The reconstructed object

static supported_type()[source]

Returns the type/class supported by this decomposer.

Returns

The class (not instance) of supported type

class ContextDecomposer[source]

Bases: Decomposer

decompose(target: FLContext) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters

target – The instance to be serialized

Returns

The decomposed serializable objects

recompose(data: Any) FLContext[source]

Reconstruct the object from decomposed components.

Parameters

data – The decomposed components

Returns

The reconstructed object

static supported_type()[source]

Returns the type/class supported by this decomposer.

Returns

The class (not instance) of supported type

class DxoDecomposer[source]

Bases: Decomposer

decompose(target: DXO) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters

target – The instance to be serialized

Returns

The decomposed serializable objects

recompose(data: Any) DXO[source]

Reconstruct the object from decomposed components.

Parameters

data – The decomposed components

Returns

The reconstructed object

static supported_type()[source]

Returns the type/class supported by this decomposer.

Returns

The class (not instance) of supported type

class NamespaceDecomposer[source]

Bases: Decomposer

decompose(target: Namespace) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters

target – The instance to be serialized

Returns

The decomposed serializable objects

recompose(data: Any) Namespace[source]

Reconstruct the object from decomposed components.

Parameters

data – The decomposed components

Returns

The reconstructed object

static supported_type()[source]

Returns the type/class supported by this decomposer.

Returns

The class (not instance) of supported type

class RunSnapshotDecomposer[source]

Bases: Decomposer

decompose(target: RunSnapshot) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters

target – The instance to be serialized

Returns

The decomposed serializable objects

recompose(data: Any) RunSnapshot[source]

Reconstruct the object from decomposed components.

Parameters

data – The decomposed components

Returns

The reconstructed object

static supported_type()[source]

Returns the type/class supported by this decomposer.

Returns

The class (not instance) of supported type

class ShareableDecomposer[source]

Bases: Decomposer

decompose(target: Shareable) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters

target – The instance to be serialized

Returns

The decomposed serializable objects

recompose(data: Any) Shareable[source]

Reconstruct the object from decomposed components.

Parameters

data – The decomposed components

Returns

The reconstructed object

static supported_type()[source]

Returns the type/class supported by this decomposer.

Returns

The class (not instance) of supported type

class SignalDecomposer[source]

Bases: Decomposer

decompose(target: Signal) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters

target – The instance to be serialized

Returns

The decomposed serializable objects

recompose(data: Any) Signal[source]

Reconstruct the object from decomposed components.

Parameters

data – The decomposed components

Returns

The reconstructed object

static supported_type()[source]

Returns the type/class supported by this decomposer.

Returns

The class (not instance) of supported type

class WorkspaceDecomposer[source]

Bases: Decomposer

decompose(target: Workspace) Any[source]

Decompose the target into types supported by msgpack or classes with decomposers registered.

Msgpack supports primitives, bytes, memoryview, lists, dicts.

Parameters

target – The instance to be serialized

Returns

The decomposed serializable objects

recompose(data: Any) Workspace[source]

Reconstruct the object from decomposed components.

Parameters

data – The decomposed components

Returns

The reconstructed object

static supported_type()[source]

Returns the type/class supported by this decomposer.

Returns

The class (not instance) of supported type

register()[source]