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

Autonomous transitions #275

Merged
merged 2 commits into from
Oct 13, 2023
Merged

Conversation

silviot
Copy link

@silviot silviot commented Oct 12, 2023

See #271

Copy link
Contributor

@alecpm alecpm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. I wonder if we should be careful to check for valid values of auto_transition_time to avoid a TypeError when the value is accidentally set to e.g. None or a string in the config.

item_type = self.item_config.get(item.item_id)
if not item_type:
continue
if "auto_transition_time" in item_type:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should check for a non-null or > 0 value here?

@silviot
Copy link
Author

silviot commented Oct 13, 2023

It's true that a null, negative or non string value will result in a runtime error with the current code.

But I don't think ignoring an auto_transition_time directive when it has an invalid value would be of any help.

I believe there should be a validation step at the very beginning (possibly even a command to just run the validation on the game config yaml) that won't let the experiment start in case there are any problems.

@silviot silviot merged commit aa7ff6a into one-hour-one-life Oct 13, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants