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

Fixed incorrect test codes. #1026

Merged
merged 3 commits into from
Apr 11, 2023
Merged

Conversation

fatihsen20
Copy link
Contributor

Code of Conduct

Fix.

Description

Test codes with errors (or usage may have changed) have been fixed.

Related issues or pull requests

None

Pull Request Checklist

  • Added a note about the modification or contribution to the ./docs/sources/CHANGELOG.md file (if applicable)
  • Added appropriate unit test functions in the ./mlxtend/*/tests directories (if applicable)
  • Modify documentation in the corresponding Jupyter Notebook under mlxtend/docs/sources/ (if applicable)
  • Ran PYTHONPATH='.' pytest ./mlxtend -sv and make sure that all unit tests pass (for small modifications, it might be sufficient to only run the specific test file, e.g., PYTHONPATH='.' pytest ./mlxtend/classifier/tests/test_stacking_cv_classifier.py -sv)
  • Checked for style issues by running flake8 ./mlxtend

@fatihsen20
Copy link
Contributor Author

Before fixing:

Ekran görüntüsü 2023-04-02 224630

After fixing:

Ekran görüntüsü 2023-04-06 231717

test_fpbase.py

Change the code:
dfs = self.df.astype(pd.SparseDtype("int", np.nan))
dfs = self.df.astype(pd.SparseDtype("int", 0))
because the na_value of the "int" variable in the pd.SparseDtype() function must be 0. You can look at the document

Change the compare_dataframes() function:
assert_array_equal() function was not working correctly. To fix this error, I replaced it with the compare_dataframes() function I wrote in "test_hmine.py".

Error Codes:

Ekran görüntüsü 2023-04-02 224725
Ekran görüntüsü 2023-04-02 224827

@rasbt
Copy link
Owner

rasbt commented Apr 6, 2023

Thanks so much for the update, the assert_array_equal() function was not working correctly issue was a sneaky one.

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Patch coverage: 53.84% and project coverage change: -0.02 ⚠️

Comparison is base (8ebfd31) 77.28% compared to head (e283a20) 77.27%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1026      +/-   ##
==========================================
- Coverage   77.28%   77.27%   -0.02%     
==========================================
  Files         200      200              
  Lines       11314    11307       -7     
  Branches     1487     1484       -3     
==========================================
- Hits         8744     8737       -7     
  Misses       2351     2351              
  Partials      219      219              
Impacted Files Coverage Δ
mlxtend/frequent_patterns/tests/test_fpbase.py 94.80% <33.33%> (-3.86%) ⬇️
mlxtend/frequent_patterns/tests/test_hmine.py 100.00% <100.00%> (+11.53%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rasbt rasbt merged commit a60f127 into rasbt:master Apr 11, 2023
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.

2 participants