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

smurf.set_targets() only works on first call without reinitialization #55

Open
BrianJKoopman opened this issue Jan 26, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@BrianJKoopman
Copy link
Member

If you set the target pysmurf-controllers via smurf.set_targets(), then want to change to a different controller that isn't in the list you set the first time it won't work. For example:

from sorunlib import *

initialize()  # creates CLIENT list with ['smurf1', 'smurf2'] in it
smurf.set_targets(['smurf1'])

# won't work
smurf.set_targets(['smurf2'])

This is because smurf.set_targets() merely selects items from the existing run.CLIENTS list. This means one has to re-initialize(). Perhaps smurf.set_targets() should re-build the run.CLIENTS list itself.

@guanyilun
Copy link

Since all initialize() does is to populate the client list, initialize is no longered needed, I guess

@BrianJKoopman
Copy link
Member Author

Since all initialize() does is to populate the client list, initialize is no longered needed, I guess

I don't think so, smurf.set_targets() will typically not be called at all, defaulting to using all available SMuRFs.

We still need to work out the details for how the SMuRF operations will be ordered (#54), but I don't expect to be constantly using smurf.set_targets() to select each slot.

@guanyilun
Copy link

I see, that makes sense!

@BrianJKoopman BrianJKoopman added the bug Something isn't working label May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants