fedflow package

class fedflow.FedFlow[source]

The entry class of Fedflow

groups = []
classmethod add_group(group: fedflow.core.taskgroup.TaskGroup)None[source]

Add a task group to flow.

Parameters

group – an instance of TaskGroup

Returns

classmethod start()None[source]

Start schedule tasks

Returns

Config APIs

All the others codes should use Config to get fedflow config properties.

Context APIs

class fedflow.context.WorkDirContext(workdir)[source]

Temporarily modify the work directory

__init__(workdir)[source]

Initialize self. See help(type(self)) for accurate signature.

Units APIs

some apis for units convert.

class fedflow.units.Units[source]

Bases: object

The basic class of all units

abstract classmethod convert(_from, _to, _value)[source]

convert value from unit ‘_from’ to unit ‘_to’

Parameters
  • _from – the instance of Units

  • _to – the instance of Units

  • _value – a number value

Returns

a number value

abstract classmethod parse(s: str)[source]

parse str value

Parameters

s – value

Returns

a tuple consist of value and units, (value, units)

abstract to_string(_value=None)str[source]

Get a str value

Parameters

_value – a number value

Returns

a str value

class fedflow.units.ByteUnits(prefix, is_binary, is_byte)[source]

Bases: fedflow.units.Units

An units class used for handling byte convert

__init__(prefix, is_binary, is_byte)[source]

Initialize self. See help(type(self)) for accurate signature.

classmethod convert(_from, _to, _value)[source]

convert value from unit ‘_from’ to unit ‘_to’

Parameters
  • _from – the instance of Units

  • _to – the instance of Units

  • _value – a number value

Returns

a number value

classmethod parse(s: str)[source]

parse a str to a tuple (int_value, units)

Parameters

s

Returns

to_string(_value=None)str[source]

Get a str value

Parameters

_value – a number value

Returns

a str value