Commit a4d6ac1
Add tests to reach 100% code coverage (#412)
Summary:
Pull Request resolved: #412
Add ~70 new test methods across 10 test files covering all previously uncovered lines (110 lines) in the balance package. Coverage was at 98% with gaps in balance_frame.py, sample_frame.py, sample_class.py, balancedf_class.py, cli.py, summary_utils.py, model_matrix.py, rake.py, weighted_comparisons_plots.py, and weighted_comparisons_stats.py.
Key areas covered:
- FutureWarning deprecation paths for id_column/weight_column property changes
- Error validation branches in set_fitted_model, design_matrix, predict_proba, predict_weights
- IPW model helper methods (_require_ipw_model, _matrix_to_dataframe, _align_to_index, _ipw_class_index)
- Training weights fallback logic in _resolve_design_weights
- SampleFrame.from_frame edge cases (string column args, missing covariates, covar/id overlap warning)
- SampleFrame.rename_weight_column and from_sample validation
- BalanceDF base class methods and BalanceDFOutcomes/Weights error paths
- build_design_matrix scaler, penalty rescaling, and matrix type conversion branches
- Rake validation for proportions (zero, NaN, inf, negative, non-float)
- ASMD unknown std_type and r_indicator scalar reshaping
- Empty variables early return in seaborn_plot_dist
- Fix StandardScaler copy=False read-only array bug in model_matrix.py
Differential Revision: D100949347
fbshipit-source-id: a02fe16b8c3d4acbb288f5e35881cedc5882b6151 parent d775c36 commit a4d6ac1
11 files changed
Lines changed: 1446 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
826 | | - | |
| 826 | + | |
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
| |||
0 commit comments