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

Policy persistence across instances #117

Open
kmharrington opened this issue Oct 13, 2024 · 0 comments
Open

Policy persistence across instances #117

kmharrington opened this issue Oct 13, 2024 · 0 comments
Labels
question Further information is requested

Comments

@kmharrington
Copy link
Member

I ran into a strange (to me) error while trying to generate a large batch of schedules yesterday and I don't understand why the behavior of the code worked like it did.

Pseudo code:

from schedlib.policies.satp2 import SATP2Policy

policy = SATP2Policy.from_defaults( ... )
for target in first_targets:
    policy.add_cal_target(**target)

...
go build a schedule file
...

policy = SATP2Policy.from_defaults( ... )
for target in other_targets:
    policy.add_cal_target(**target)

...
build a different schedule file
...

The problem is, when I went to look at the second policy instance, it already had all the first_targets associated with it. Why? The from_defaults method defaults to an empty calibration target list. Also, my actual code that the two policies being generated in two separate function calls so they shouldn't have even been in the same namespace.

@kmharrington kmharrington added the question Further information is requested label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant