Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Change Request] Algorithm decorators #440

Closed
4 tasks done
bartvanb opened this issue Dec 14, 2022 · 6 comments
Closed
4 tasks done

[Change Request] Algorithm decorators #440

bartvanb opened this issue Dec 14, 2022 · 6 comments
Assignees
Labels
change Internal change

Comments

@bartvanb
Copy link
Member

bartvanb commented Dec 14, 2022

Description
In the algorithms, there are a couple of methods that we want to rename. The best is to do this in v4.0, so that we don't face compatibility issues later. Renames should include:

  • ~~ The central methods should get a prefix central_ ~~
  • The central method should not be named master anymore
  • The local methods should get a different prefix than RPC_ as that is unclear (maybe simply local_)

Note that this list is not exhaustive:

  • when implementing, consider other name changes
@bartvanb bartvanb added the change Internal change label Dec 14, 2022
@bartvanb
Copy link
Member Author

It might be a good idea to also accept the old prefixes (RPC_) and if someone provides a function that already includes the prefix (e.g. *central*_average) that this is detected and works without error.

@frankcorneliusmartin
Copy link
Contributor

frankcorneliusmartin commented Jan 26, 2023

Instead of prefixes we could also consider using:

@data 
@client
@socket
def method(data, client, socker, args*, kwargs**):
    pass

Decorators register which signature belongs to which method, which then can be read by the dispactch_rpc method (

result = method(client, data, *args, **kwargs) if master else \
method(data, *args, **kwargs)
).

@bartvanb
Copy link
Member Author

bartvanb commented Feb 1, 2023

Note that with the above, we will be letting go of the distinction between 'master' and 'RPC' methods, so there would no longer be a need for the prefixes

@bartvanb
Copy link
Member Author

bartvanb commented May 11, 2023

  • add support to use multiple databases in one run
  • adapt decorator to make it suitable for using multiple databases in one algorithm run

This should be done by giving an argument to the decorator, that should somehow be fed back to the way in which the algorithm is called

@bartvanb bartvanb changed the title [Change Request] Rename algorithm functions [Change Request] Algorithm decorators Sep 11, 2023
@frankcorneliusmartin
Copy link
Contributor

Lets test this when we create our first algorithm

@frankcorneliusmartin
Copy link
Contributor

I tested this using the average:v4 algorithm the @data and @algorithm_client decorators work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change Internal change
Projects
Status: Done
Development

No branches or pull requests

2 participants