-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_csv_client.py
36 lines (30 loc) · 1020 Bytes
/
sample_csv_client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from vantage6.client import UserClient as Client
# Note: we assume here the config.py you just created is in the current directory.
# If it is not, then you need to make sure it can be found on your PYTHONPATH
import config
# Initialize the client object, and run the authentication
client = Client(config.server_url, config.server_port, config.server_api,
log_level='debug')
client.authenticate(config.username, config.password)
# Optional: setup the encryption, if you have an organization_key
client.setup_encryption(config.organization_key)
input_ = {
'method': 'central_average',
'kwargs': {"column_name":"Age"}
}
average_task = client.task.create(
collaboration=2,
organizations=[7],
name="max-task",
image="harbor2.vantage6.ai/demo/average",
description='',
input_=input_,
databases=[
{'label': 'default'}
]
)
task_id = average_task['id']
print('Waiting for results...')
result = client.wait_for_results(task_id)
print('Results received!')
print(result)