diff --git a/pyproject.toml b/pyproject.toml index d18da15..fdc4b49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ license = { text = "BSD 2-Clause License" } classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 3", - "License :: OSI Approved :: BSD 2-Clause License", + "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", ] @@ -25,7 +25,7 @@ dependencies = [ requires-python = ">=3.6" [project.urls] -homepage = "https://github.com/ihmeuw-msca/splitting-python-package" +homepage = "https://github.com/ihmeuw-msca/pydisagg" [tool.setuptools.packages] find = {} @@ -38,7 +38,4 @@ log_cli_level = "INFO" log_format = "%(asctime)s %(levelname)s %(message)s" log_date_format = "%Y-%m-%d %H:%M:%S" minversion = "6.0" -filterwarnings = "ignore" - -[dev-dependencies] -pytest = "^8.1" \ No newline at end of file +filterwarnings = "ignore" \ No newline at end of file diff --git a/src/pydisagg/age_split/__init__.py b/src/pydisagg/age_split/__init__.py index e891252..868c664 100644 --- a/src/pydisagg/age_split/__init__.py +++ b/src/pydisagg/age_split/__init__.py @@ -1,4 +1 @@ # age_split/__init__.py -from . import age_split, age_var, helper - -__all__ = ["age_split", "age_var", "helper"] diff --git a/src/pydisagg/models.py b/src/pydisagg/models.py index bb6fc41..3020fbb 100755 --- a/src/pydisagg/models.py +++ b/src/pydisagg/models.py @@ -47,10 +47,7 @@ class LMO_model(DisaggModel): DisaggModel using the log-modified odds transformation with the exponent m. """ - def __init__( - self, - m: float, - ): + def __init__(self, m: float): super().__init__( parameter_transformation=transformations.LogModifiedOddsTransformation( m diff --git a/src/pydisagg/preprocess.py b/src/pydisagg/preprocess.py index acc596c..123b0c8 100644 --- a/src/pydisagg/preprocess.py +++ b/src/pydisagg/preprocess.py @@ -15,15 +15,23 @@ def validate_data(df, pop_df, age_id_map=age_id_map): """ Validates the input dataframe by checking for NaN values, invalid sex_id, invalid location_ids, and invalid year_ids. - Args: - df (pandas.DataFrame): The input dataframe to be validated. - age_id_map (dict): A dictionary mapping age_ids to their corresponding values. - pop_df (pandas.DataFrame): The population dataframe used for validation. - - Returns: - valid_df (pandas.DataFrame): The validated dataframe with invalid rows removed. - nan_df (pandas.DataFrame): A dataframe containing the rows with validation errors and their corresponding error reasons. + Parameters + ---------- + df : pandas.DataFrame + The input dataframe to be validated. + age_id_map : dict + A dictionary mapping age_ids to their corresponding values. + pop_df : pandas.DataFrame + The population dataframe used for validation. + + Returns + ------- + valid_df : pandas.DataFrame + The validated dataframe with invalid rows removed. + nan_df : pandas.DataFrame + A dataframe containing the rows with validation errors and their corresponding error reasons. """ + if "year_id" in df.columns: df["input_year_id"] = df["year_id"]