Skip to content

Commit bf47a7d

Browse files
authored
Merge pull request #7 from vantage6/change/update-usage-docs
Updated usage.rst template - fixed both missing and superfluous param…
2 parents b11a88c + 7973cfc commit bf47a7d

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

{% if has_docs %}docs{% endif %}/{{algorithm_name}}/usage.rst.jinja

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,29 @@ framework. If you are not, please read the `documentation <https://docs.vantage6
1515
first, especially the part about the
1616
`Python client <https://docs.vantage6.ai/en/main/user/pyclient.html>`_.
1717

18-
.. TODO Some explanation of the code below
18+
.. TODO Update the code below and explain input
19+
20+
.. TODO Optionally/alternatively, explain how to run via the vantage6 UI
1921

2022
.. code-block:: python
2123

2224
from vantage6.client import Client
2325

2426
server = 'http://localhost'
25-
port = 5000
27+
port = 7601
2628
api_path = '/api'
2729
private_key = None
2830
username = 'root'
2931
password = 'password'
32+
collaboration_id = 1
33+
organization_ids = [2]
3034

3135
# Create connection with the vantage6 server
3236
client = Client(server, port, api_path)
3337
client.setup_encryption(private_key)
3438
client.authenticate(username, password)
3539

3640
input_ = {
37-
'master': True,
3841
'method': '{{central_function_name}}',
3942
'args': [],
4043
'kwargs': {
@@ -46,13 +49,13 @@ first, especially the part about the
4649
}
4750

4851
my_task = client.task.create(
49-
collaboration=1,
50-
organizations=[1],
52+
collaboration=collaboration_id,
53+
organizations=organization_ids,
5154
name='{{algorithm_name}}',
5255
description='{{algorithm_description}}',
5356
image='{{docker_image}}',
54-
input=input_,
55-
data_format='json'
57+
input_=input_,
58+
databases=[{"label": "default"}],
5659
)
5760

5861
task_id = my_task.get('id')

0 commit comments

Comments
 (0)