Structure tests - #34
Merged
Merged
Conversation
digicosmos86
approved these changes
Jul 31, 2026
digicosmos86
left a comment
Collaborator
There was a problem hiding this comment.
Looks good! I have some minor comments on the documentation side of things. Otherwise, feel free to merge after these issues are fixed
| mod_def_file: str | os.PathLike, | ||
| output_file: str | os.PathLike, | ||
| ): | ||
| print("Warning: Using Single Schedule 0") |
Collaborator
There was a problem hiding this comment.
If this is a warning, then let's use logging to do this. I think we should generally use logging instead of simply printing, which is helpful when running scripts on Oscar.
| import yaml | ||
|
|
||
|
|
||
| def parse_places(places_file: str | os.PathLike) -> Dict[str, List[int]]: |
Collaborator
There was a problem hiding this comment.
Let's write some docstrings
Comment on lines
+107
to
+109
| breakfast = random.choice([6, 7]) | ||
| lunch = random.choice([11, 12, 13]) | ||
| dinner = random.choice([17, 18]) |
Collaborator
There was a problem hiding this comment.
This might not be a priority right now, but we should be able to set random seeds so that the simulations are reproducible
| return rows | ||
|
|
||
|
|
||
| def generate_residents(mod_def_file, places: List[Dict], output_file: str | os.PathLike): |
Collaborator
There was a problem hiding this comment.
What does this function do that generate_cell_assignments doesn't?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds tests for the structural layout
(Sorry things got a little messier than anticipated! I split up the generate.py file into two files for organization. Those files are previously reviewed code, so probably no need to look at them again!)