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

Data gathering bugs #19

Closed
JamesArruda opened this issue Jan 2, 2025 · 0 comments · Fixed by #23
Closed

Data gathering bugs #19

JamesArruda opened this issue Jan 2, 2025 · 0 comments · Fixed by #23
Assignees
Labels
bug Something isn't working

Comments

@JamesArruda
Copy link
Collaborator

JamesArruda commented Jan 2, 2025

A state that is never used won't have recorded data.

class Cashier(UP.Actor):
   items_scanned = UP.State(default=0, recording=True)

with UP.EnvironmentContext():
    cash = Cashier(name="cashier")
    print("items_scanned" in cash.__dict__)
    >>> False

Either make the state's instantiation non-lazy or check for this condition in the data gathering code.

Also, the data gathering uses break instead of continue when a location state is reached. Correct that.

@JamesArruda JamesArruda added the bug Something isn't working label Jan 2, 2025
@JamesArruda JamesArruda self-assigned this Jan 2, 2025
@JamesArruda JamesArruda changed the title Unused state error in data gathering Data gathering bugs Jan 2, 2025
@JamesArruda JamesArruda linked a pull request Jan 3, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant