Running assessment_quality.ipynb on the Guilford County sample data fails with two sequential bugs in vertical_equity_study.py.
Environment:
OS: Windows 10
Python: 3.12.13
OpenAVMKit: installed from master branch (June 2026)
Locality: us-nc-guilford (sample data)
Steps to Reproduce:
Complete notebooks 01-assemble, 02-clean, and 03-model successfully on the Guilford County sample data
Open assessment_quality.ipynb, set locality = "us-nc-guilford", run all cells
Bug 1 — NameError in _calc_grouped_quantiles
df_group_to_quantile is referenced on line 235 but never defined in the function scope. Appears to be a renamed or accidentally deleted assignment.
NameError: name 'df_group_to_quantile' is not defined
File vertical_equity_study.py, line 235, in _calc_grouped_quantiles
df2 = df_in.merge(df_group_to_quantile, on=group_field, how="left")
Proposed fix: Add the missing assignment before the merge:
pythondf_group_to_quantile = df.groupby(group_field)["quantile"].agg(lambda x: x.mode()[0]).reset_index()
Bug 2 — AttributeError in VerticalEquityStudy.summary()
After fixing Bug 1, summary() fails because self.prd is never assigned in init. calc_ratio_stats_bootstrap returns a results dict containing PRD but the assignment line is missing. self.prb is correctly assigned immediately after, suggesting self.prd was accidentally omitted.
AttributeError: 'VerticalEquityStudy' object has no attribute 'prd'
File vertical_equity_study.py, line 148, in VerticalEquityStudy.summary
prd = self.prd
Proposed fix: Add the missing assignment in init after calc_ratio_stats_bootstrap:
pythonself.prd = results["prd"]
Both fixes together allow assessment_quality.ipynb to complete successfully and return PRD/PRB results.
Running assessment_quality.ipynb on the Guilford County sample data fails with two sequential bugs in vertical_equity_study.py.
Environment:
OS: Windows 10
Python: 3.12.13
OpenAVMKit: installed from master branch (June 2026)
Locality: us-nc-guilford (sample data)
Steps to Reproduce:
Complete notebooks 01-assemble, 02-clean, and 03-model successfully on the Guilford County sample data
Open assessment_quality.ipynb, set locality = "us-nc-guilford", run all cells
Bug 1 — NameError in _calc_grouped_quantiles
df_group_to_quantile is referenced on line 235 but never defined in the function scope. Appears to be a renamed or accidentally deleted assignment.
NameError: name 'df_group_to_quantile' is not defined
File vertical_equity_study.py, line 235, in _calc_grouped_quantiles
df2 = df_in.merge(df_group_to_quantile, on=group_field, how="left")
Proposed fix: Add the missing assignment before the merge:
pythondf_group_to_quantile = df.groupby(group_field)["quantile"].agg(lambda x: x.mode()[0]).reset_index()
Bug 2 — AttributeError in VerticalEquityStudy.summary()
After fixing Bug 1, summary() fails because self.prd is never assigned in init. calc_ratio_stats_bootstrap returns a results dict containing PRD but the assignment line is missing. self.prb is correctly assigned immediately after, suggesting self.prd was accidentally omitted.
AttributeError: 'VerticalEquityStudy' object has no attribute 'prd'
File vertical_equity_study.py, line 148, in VerticalEquityStudy.summary
prd = self.prd
Proposed fix: Add the missing assignment in init after calc_ratio_stats_bootstrap:
pythonself.prd = results["prd"]
Both fixes together allow assessment_quality.ipynb to complete successfully and return PRD/PRB results.