0.7.0
Features
-
Auto batching: when adding or updating a compute plan, the tuples are uploaded by batch to avoid server errors. This can be configured from SDK:
client.add_compute_plan(data, auto_batching=True, batch_size=20)
or the CLI:
substra add compute_plan --batch-size 20 data.json substra add compute_plan --no-auto-batching data.json
-
New method to retry a call in case of server error, e.g. a timeout:
retry_on_exception
-
Client initialisation: see the API changes
-
Output of the
get
methods: see the API changes -
Output of the
create
methods: see the API changes
API - breaking changes
Client initialisation
- Define the "profile" during the initialisation, whether by giving parameters or the path to a config file
- Remove the version argument at initialisation
- New debug mode argument at initialisation (False by default)
Previous API:
c = Client()
c.add_profile(profile_name, url, version, insecure)
c.login(username, password)
New API:
c = Client(url, token, retry_timeout, insecure, debug)
c.login(username, password)
or
c = Client.from_config_file(profile_name, config_path, tokens_path, token, retry_timeout, debug)
c.login(username, password)
The get
methods return a Python object whose attribute are in snake_case
Instead of a dictionnary, the returned object is now a class instance, as described in the documentation and its attributes are in snake_case instead of camelCase.
Previous API:
traintuple = client.get_traintuple(traintuple_key)
in_models = traintuple['inModels']
New API:
traintuple = client.get_traintuple(traintuple_key)
in_models = traintuple.in_models
The create
methods return a key
The creation methods now return the key of the created object, apart from the create_compute_plan
method that returns the whole object.
Previous API:
traintuple = client.create_traintuple(data)
traintuple_key = traintuple['key']
New API:
traintuple_key = client.create_traintuple(data)
traintuple = client.get_traintuple(traintuple_key)
pkhash
has been replaced by key
The objects in Substra are now identified by their key
instead of pkhash
.