Skip to content

Structure tests - #34

Merged
s-bessey merged 33 commits into
feat-hierarchical-layoutfrom
structure-tests
Jul 31, 2026
Merged

Structure tests#34
s-bessey merged 33 commits into
feat-hierarchical-layoutfrom
structure-tests

Conversation

@s-bessey

@s-bessey s-bessey commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

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!)

@s-bessey
s-bessey requested a review from digicosmos86 July 28, 2026 13:10

@digicosmos86 digicosmos86 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! I have some minor comments on the documentation side of things. Otherwise, feel free to merge after these issues are fixed

Comment thread .github/workflows/unit-tests.yml
Comment thread src/genpop/generate_layout.py Outdated
mod_def_file: str | os.PathLike,
output_file: str | os.PathLike,
):
print("Warning: Using Single Schedule 0")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment thread src/genpop/generate_layout.py Outdated
import yaml


def parse_places(places_file: str | os.PathLike) -> Dict[str, List[int]]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This might not be a priority right now, but we should be able to set random seeds so that the simulations are reproducible

Comment thread src/genpop/generate_layout.py Outdated
Comment thread src/genpop/generate_layout.py
Comment thread src/genpop/generate_layout.py Outdated
return rows


def generate_residents(mod_def_file, places: List[Dict], output_file: str | os.PathLike):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What does this function do that generate_cell_assignments doesn't?

Comment thread pyproject.toml Outdated
@s-bessey
s-bessey merged commit c65a28a into feat-hierarchical-layout Jul 31, 2026
1 check passed
@s-bessey
s-bessey deleted the structure-tests branch July 31, 2026 18:26
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