Skip to content

Commit 240d406

Browse files
committed
more documentation
1 parent 381b6f2 commit 240d406

File tree

4 files changed

+27
-31
lines changed

4 files changed

+27
-31
lines changed

configuration/demos_config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ modules = [
2121
"aging",
2222
"employment",
2323
"household_reorg",
24-
# "kids_moving_model",
24+
"kids_moving",
2525
# "fatality_model",
2626
# "birth_model",
2727
# "education_model",
28-
# "household_rebalancing",
28+
"household_rebalancing",
2929
# "update_income"
3030
]
3131

demos/models/kids_moving.py

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
import orca
2-
import numpy as np
3-
import pandas as pd
42
from templates import estimated_models, modelmanager as mm
53
import time
64
from logging_logic import log_execution_time
75
from templates.utils.models import columns_in_formula
86

9-
@orca.step("kids_moving_model")
10-
def kids_moving_model(persons, households, get_new_households):
7+
STEP_NAME = "kids_moving"
8+
REQUIRED_COLUMNS = [
9+
"persons.age",
10+
"persons.relate",
11+
]
12+
13+
@orca.step(STEP_NAME)
14+
def kids_moving(persons, households, get_new_households):
1115
"""
12-
Running the kids moving model and updating household
13-
stats.
16+
Executes the `kids_move` estimated model and updates the household of kids
17+
moving out of their parent's home accordingly.
1418
15-
Args:
16-
persons (DataFrameWrapper): DataFrameWrapper of the persons table
17-
households (DataFrameWrapper): DataFrameWrapper of the households table
19+
**Required tables:**
20+
- persons
21+
- households
1822
19-
Returns:
20-
None
23+
**Modifies State Variables:**
24+
- persons.household_id
25+
- persons.relate
26+
- households.lcm_county_id
2127
"""
2228
start_time = time.time()
2329

@@ -33,23 +39,6 @@ def kids_moving_model(persons, households, get_new_households):
3339
log_execution_time(start_time, orca.get_injectable("year"), "kids_moving")
3440

3541
def update_households_after_kids(persons, households, kids_moving, get_new_households):
36-
"""
37-
Add and update households after kids move out.
38-
39-
Modifies State Variables:
40-
- persons.household_id
41-
- persons.relate
42-
- households.lcm_county_id
43-
44-
Args:
45-
persons (DataFrameWrapper): DataFrameWrapper of persons table
46-
households (DataFrameWrapper): DataFrameWrapper of households table
47-
kids_moving (pd.Series): Pandas Series of kids moving out of household
48-
49-
Returns:
50-
None
51-
"""
52-
5342
# Kids moving to a new household conditions
5443
## Condition 1: Kids flagged by kids_moving
5544
## Condition 2: Households with more than 1 people
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Kids Moving Module
2+
==================
3+
4+
This module does not have configuration options
5+
6+
.. autofunction:: demos.models.kids_moving.kids_moving

docs/source/api/modules.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ DEMOS Modules
1212

1313
aging_module
1414
employment_module
15-
hh_reorg_module
15+
hh_reorg_module
16+
kids_move_module

0 commit comments

Comments
 (0)