File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 11from vantage6 .common import info
22from vantage6 .algorithm .decorator .action import central
3- from vantage6 .algorithm .decorator import algorithm_client
3+ from vantage6 .algorithm .decorator . algorithm_client import algorithm_client
44from vantage6 .algorithm .client import AlgorithmClient
55
66
@@ -21,7 +21,7 @@ def global_sum(client: AlgorithmClient, column: str) -> dict:
2121 description = "subtask" ,
2222 method = "sum" ,
2323 organizations = ids ,
24- input_ = {"args" : [ column ], "kwargs" : {} },
24+ arguments = {"column" : column },
2525 )
2626
2727 info ("Waiting for results..." )
@@ -53,7 +53,7 @@ def global_sum_dev(client: AlgorithmClient, column: str) -> dict:
5353 description = "subtask" ,
5454 method = "sum_dev" ,
5555 organizations = ids ,
56- input_ = {"args" : [ column ], "kwargs" : {} },
56+ arguments = {"column" : column },
5757 )
5858
5959 info ("Waiting for results..." )
@@ -85,7 +85,7 @@ def global_sum_dev_many(client: AlgorithmClient, column: str) -> dict:
8585 description = "subtask" ,
8686 method = "sum_many" ,
8787 organizations = ids ,
88- input_ = {"args" : [ column ], "kwargs" : {} },
88+ arguments = {"column" : column },
8989 )
9090
9191 info ("Waiting for results..." )
Original file line number Diff line number Diff line change 1010import time
1111import pandas as pd
1212from vantage6 .common import info , error
13- from vantage6 .algorithm .decorator import data , source_database
14- from .tmp import dataframe , dataframes
13+ from vantage6 .algorithm .decorator .data import dataframe , dataframes
1514from vantage6 .algorithm .decorator .action import (
1615 data_extraction ,
17- pre_processing ,
16+ preprocessing ,
1817 federated ,
1918)
2019
2120
2221@data_extraction
23- @source_database
2422def read_csv (connection_details : dict ) -> dict :
2523 info (f"Reading CSV file from { connection_details ['uri' ]} " )
2624 return pd .read_csv (connection_details ["uri" ])
2725
2826
29- @pre_processing
30- @data (1 )
27+ @preprocessing
28+ @dataframe (1 )
3129def pre_process (df1 : pd .DataFrame , column : str , dtype : str ) -> pd .DataFrame :
3230 info (f"Pre-processing data for column { column } with dtype { dtype } " )
3331 df1 [column ] = df1 [column ].astype (dtype )
3432 return df1
3533
3634
3735@federated
38- @data (1 )
36+ @dataframe (1 )
3937def sum (df1 : pd .DataFrame , column : str ) -> dict :
4038 info (f"Summing column { column } " )
4139 return {"sum" : int (df1 [column ].sum ())}
You can’t perform that action at this time.
0 commit comments