From 0122420057b3ff88ed5ab78e8a85f4872158ca11 Mon Sep 17 00:00:00 2001 From: Cangyuan Li Date: Thu, 30 Nov 2023 14:43:22 -0500 Subject: [PATCH] cleanup: remove unneeded setup already handled by the LazyFrame constructor --- src/pyethnicity/_bayesian_models.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/pyethnicity/_bayesian_models.py b/src/pyethnicity/_bayesian_models.py index 482ecc9..2630a37 100644 --- a/src/pyethnicity/_bayesian_models.py +++ b/src/pyethnicity/_bayesian_models.py @@ -158,6 +158,7 @@ def _normalize_block_group( pl.col(col_name).cast(str).str.zfill(12) ) + # TODO: It seems a little wasteful to extract the geography this way now that we have # moved to putting everything in a LazyFrame upfront. def _resolve_geography(geography: Geography, geo_type: GeoType) -> pl.LazyFrame: @@ -741,20 +742,6 @@ def predict_sex_ssa( >>> pyethnicity.predict_sex_ssa(first_name="john") >>> pyethnicity.predict_sex_ssa(first_name=["john", "mary"], min_year=[1880, 1990]) """ - if isinstance(first_name, str): - first_name = [first_name] - - # broadcast years - target_len = len(first_name) - - if isinstance(min_year, int): - min_year = [min_year for _ in range(target_len)] - - if isinstance(max_year, int): - max_year = [max_year for _ in range(target_len)] - - _assert_equal_lengths(first_name, min_year, max_year) - # create dataframe of inputs to merge on inputs = ( pl.LazyFrame(