xain_sdk package¶
Provides xain package SDK
-
xain_sdk.
configure_logging
(log_http_requests=False)¶
Submodules¶
xain_sdk.http module¶
-
class
xain_sdk.http.
HttpClient
(url)¶ Bases:
object
-
build_req
(method, path, **kwargs)¶
-
static
check_response
(resp, status=200)¶
-
delete
(path, status=204, **kwargs)¶
-
get
(path, status=200, **kwargs)¶
-
static
headers
()¶
-
patch
(path, status=200, **kwargs)¶
-
post
(path, status=200, **kwargs)¶
-
put
(path, status=200, **kwargs)¶
-
send
(req, status=200)¶
-
url
(path)¶
-
-
xain_sdk.http.
log_headers
(headers)¶
-
xain_sdk.http.
log_request
(req)¶
-
xain_sdk.http.
log_response
(resp)¶
xain_sdk.participant module¶
-
exception
xain_sdk.participant.
DeserializationError
¶
-
class
xain_sdk.participant.
HeartBeatWorker
(coordinator_client, state_record, exit_event, heartbeat_period)¶ Bases:
threading.Thread
-
heartbeat
()¶
-
run
()¶ Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
-
-
class
xain_sdk.participant.
InternalParticipant
(participant, coordinator_url, heartbeat_period)¶ Bases:
object
-
rendez_vous
()¶
-
run
()¶ - Return type
None
-
start_heartbeat
()¶
-
train
()¶ - Return type
None
-
-
class
xain_sdk.participant.
ParticipantABC
¶ Bases:
abc.ABC
-
abstract
deserialize_training_input
(data)¶ - Return type
~TrainingInput
-
abstract
train_round
(training_input)¶ - Return type
~TrainingResult
-
abstract
-
exception
xain_sdk.participant.
SerializationError
¶
-
class
xain_sdk.participant.
State
¶ Bases:
enum.Enum
An enumeration.
-
DONE
= 3¶
-
TRAINING
= 2¶
-
WAITING
= 1¶
-
-
class
xain_sdk.participant.
StateRecord
(state=<State.WAITING: 1>, round=-1)¶ Bases:
object
-
assert_locked
()¶
-
set_round
(round)¶ - Return type
None
-
set_state
(state)¶ - Return type
None
-
-
exception
xain_sdk.participant.
TrainingError
¶