Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated weights column checks through Mixin Class and capturing shared weight tests in generic test classes #239

Merged
merged 10 commits into from
May 3, 2024

Conversation

Ritunjai-Sharma
Copy link
Contributor

@Ritunjai-Sharma Ritunjai-Sharma commented Apr 25, 2024

The following work has been done as part of this PR:

  1. WeightColumnMixin mixin class created in a new file mixins.py with check_weights_column method to replace check_weights_column method in base.py: Commit 4bff09e3. Note that post implementing this check_weights_column check for weighted transformers, some tests for nominal transformers failed since the testing data was using null values in weight column, which logically shouldn't be allowed. This testing data has been updated to not contain null values in weight column.

  2. Refactored testing of weighted transformers to move shared tests in generic testing classes: Commit 43827aad. As part of this, the following work was done:

    1. Created WeightColumnInitTests class with test to check that the weight is str or None. Consequently, test_weight_arg_errors and test_weight_value_type_error tests removed from test_MedianImputer.py and test_ModeImputer.py. Similar test in mean imputer not touched for now (test should be removed as part of mean imputer test overhaul ticket: Bring MeanImputer in line with new testing setup #208)
    2. Added test_weight_arg_errors to GenericCappingInitTests class of test_BaseCappingTransformer.py to check that the weight is str or None for CappingTransformer and OutOfRangeNullTransformer.
    3. Added generic weight testing classes GenericImputerFitTestsWeight and GenericImputerTransformTestsWeight to test_BaseImputer.py and removed duplicated fit and transform weight tests in test_MedianImputer.py and test_ModeImputer.py

@Ritunjai-Sharma Ritunjai-Sharma linked an issue Apr 25, 2024 that may be closed by this pull request
@Ritunjai-Sharma Ritunjai-Sharma marked this pull request as ready for review April 25, 2024 10:32
tubular/mixins.py Show resolved Hide resolved
tests/capping/test_BaseCappingTransformer.py Outdated Show resolved Hide resolved
tests/base_tests.py Show resolved Hide resolved
…d_set_weight method to WeightColumnMixin class and removed test_weight_arg_errors from test_BaseCappingTransformer.py
@limlam96
Copy link
Contributor

limlam96 commented May 1, 2024

FYI getting some conflicts :)

@limlam96
Copy link
Contributor

limlam96 commented May 1, 2024

can you update changelog plz :)

tests/base_tests.py Outdated Show resolved Hide resolved
tests/capping/test_BaseCappingTransformer.py Outdated Show resolved Hide resolved
tubular/mixins.py Outdated Show resolved Hide resolved
tubular/mixins.py Show resolved Hide resolved
@Ritunjai-Sharma
Copy link
Contributor Author

FYI getting some conflicts :)

I've fixed the merge conflicts and post merge conflict resolution linting issues in commits: 32ea5f09, f686809 and 6ad2053

@Ritunjai-Sharma
Copy link
Contributor Author

can you update changelog plz :)

Yes! Done here: abdc10b

Copy link
Contributor

@limlam96 limlam96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, nice work RJ!

@Ritunjai-Sharma Ritunjai-Sharma merged commit a68a70e into main May 3, 2024
12 checks passed
@Ritunjai-Sharma Ritunjai-Sharma deleted the feature/automated_weights_column_checks branch May 3, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automated weights column checks through BaseTransformer
2 participants