Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rmudambi committed Apr 1, 2023
2 parents ac7a463 + 7d2741c commit 182c4f7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**0.2.1 - 03/31/23**

- Fix bug preventing generation of W2/1099 forms

**0.2.0 - 03/31/23**

- Implemented W2/1099 forms
Expand Down
2 changes: 1 addition & 1 deletion src/pseudopeople/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
__summary__ = "pseudopeople is package which adds noise to simulated census-scale data using standard scientific Python tools."
__uri__ = "https://github.com/ihmeuw/pseudopeople"

__version__ = "0.2.0"
__version__ = "0.2.1"

__author__ = "The pseudopeople developers"
__email__ = "[email protected]"
Expand Down
10 changes: 7 additions & 3 deletions src/pseudopeople/noise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,21 @@ def generate_incorrect_selections(
:returns: pd.Series where data has been noised with other values from a list of possibilities
"""

col = column.name
selection_type = {
"employer_state": "state",
"mailing_address_state": "state",
}.get(str(column.name), column.name)

selection_options = pd.read_csv(paths.INCORRECT_SELECT_NOISE_OPTIONS_DATA)

# Get possible noise values
# todo: Update with exclusive resampling when vectorized_choice is improved
options = selection_options.loc[selection_options[col].notna(), col]
options = selection_options.loc[selection_options[selection_type].notna(), selection_type]
new_values = vectorized_choice(
options=options,
n_to_choose=len(column),
randomness_stream=randomness_stream,
additional_key=f"{additional_key}_{col}_incorrect_select_choice",
additional_key=f"{additional_key}_{column.name}_incorrect_select_choice",
).to_numpy()

return pd.Series(new_values, index=column.index)
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_column_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def default_configuration():


def test_generate_missing_data(dummy_dataset):

config = get_configuration()
config.update(
{
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_noise_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def test_correct_forms_are_used(func, form, mocker):


def test_two_noise_functions_are_independent(mocker):

# Make simple config tree to test 2 noise functions work together
config_tree = ConfigTree(
{
Expand Down

0 comments on commit 182c4f7

Please sign in to comment.