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

zero division error in get_std_error #28

Open
mdkbmi opened this issue Jan 18, 2025 · 0 comments · May be fixed by #29
Open

zero division error in get_std_error #28

mdkbmi opened this issue Jan 18, 2025 · 0 comments · May be fixed by #29
Assignees
Labels
bug Something isn't working

Comments

@mdkbmi
Copy link
Collaborator

mdkbmi commented Jan 18, 2025

=================================================== test session starts ===================================================
platform darwin -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 -- /Users/danishkarlin/miniforge3/envs/tidylinreg/bin/python
cachedir: .pytest_cache
rootdir: /Users/danishkarlin/Library/CloudStorage/OneDrive-UBC/MDS/4-524 Collaborative Software Development/tidylinreg
configfile: pyproject.toml
plugins: cov-6.0.0, anyio-4.8.0
collected 59 items                                                                                                        

tests/test_get_ci.py::test_is_model_fitted PASSED                                                                   [  1%]
tests/test_get_ci.py::test_error_empty_x PASSED                                                                     [  3%]
tests/test_get_ci.py::test_error_empty_y PASSED                                                                     [  5%]
tests/test_get_ci.py::test_alpha_is_zero PASSED                                                                     [  6%]
tests/test_get_ci.py::test_alpha_is_one PASSED                                                                      [  8%]
tests/test_get_ci.py::test_alpha_below_zero PASSED                                                                  [ 10%]
tests/test_get_ci.py::test_alpha_above_one PASSED                                                                   [ 11%]
tests/test_get_ci.py::test_ci_values PASSED                                                                         [ 13%]
tests/test_get_std_error.py::test_is_model_fitted PASSED                                                            [ 15%]
tests/test_get_std_error.py::test_empty_x PASSED                                                                    [ 16%]
tests/test_get_std_error.py::test_empty_y PASSED                                                                    [ 18%]
tests/test_get_std_error.py::test_calculate_std_error PASSED                                                        [ 20%]
tests/test_get_std_error.py::test_calculate_std_error_zero PASSED                                                   [ 22%]
tests/test_summary.py::test_summary_no_fit PASSED                                                                   [ 23%]
tests/test_summary.py::test_summary_basic PASSED                                                                    [ 25%]
tests/test_summary.py::test_summary_with_ci PASSED                                                                  [ 27%]
tests/test_summary.py::test_summary_output_without_ci PASSED                                                        [ 28%]
tests/test_summary.py::test_summary_invalid_alpha PASSED                                                            [ 30%]
tests/test_summary.py::test_summary_values PASSED                                                                   [ 32%]
tests/test_tidylinreg.py::test_fit_params[X0-y0-expected_params0] PASSED                                            [ 33%]
tests/test_tidylinreg.py::test_fit_params[X1-y1-expected_params1] PASSED                                            [ 35%]
tests/test_tidylinreg.py::test_fit_params[X2-y2-expected_params2] PASSED                                            [ 37%]
tests/test_tidylinreg.py::test_fit_params[X3-y3-expected_params3] PASSED                                            [ 38%]
tests/test_tidylinreg.py::test_fit_params[X4-y4-expected_params4] PASSED                                            [ 40%]
tests/test_tidylinreg.py::test_fit_params[X5-y5-expected_params5] PASSED                                            [ 42%]
tests/test_tidylinreg.py::test_fit_params[X6-y6-expected_params6] PASSED                                            [ 44%]
tests/test_tidylinreg.py::test_fit_params[X7-y7-expected_params7] PASSED                                            [ 45%]
tests/test_tidylinreg.py::test_fit_throw_error[X0-y0-TypeError] PASSED                                              [ 47%]
tests/test_tidylinreg.py::test_fit_throw_error[X1-y1-TypeError] PASSED                                              [ 49%]
tests/test_tidylinreg.py::test_fit_throw_error[X2-y2-ValueError] PASSED                                             [ 50%]
tests/test_tidylinreg.py::test_fit_throw_error[X3-y3-ValueError] PASSED                                             [ 52%]
tests/test_tidylinreg.py::test_fit_throw_error[X4-y4-ValueError] PASSED                                             [ 54%]
tests/test_tidylinreg.py::test_fit_throw_error[X5-y5-ValueError] PASSED                                             [ 55%]
tests/test_tidylinreg.py::test_fit_throw_error[X6-y6-ValueError] PASSED                                             [ 57%]
tests/test_tidylinreg.py::test_fit_throw_error[X7-y7-ValueError] PASSED                                             [ 59%]
tests/test_tidylinreg.py::test_fit_throw_error[X8-y8-ValueError] PASSED                                             [ 61%]
tests/test_tidylinreg.py::test_fit_throw_error[X9-y9-ValueError] PASSED                                             [ 62%]
tests/test_tidylinreg.py::test_fit_throw_error[X10-y10-ValueError] PASSED                                           [ 64%]
tests/test_tidylinreg.py::test_predict[X_fit0-y_fit0-X_test0-expected_predictions0] PASSED                          [ 66%]
tests/test_tidylinreg.py::test_predict[X_fit1-y_fit1-X_test1-expected_predictions1] PASSED                          [ 67%]
tests/test_tidylinreg.py::test_predict[X_fit2-y_fit2-X_test2-expected_predictions2] PASSED                          [ 69%]
tests/test_tidylinreg.py::test_predict[X_fit3-y_fit3-X_test3-expected_predictions3] PASSED                          [ 71%]
tests/test_tidylinreg.py::test_predict_throw_error PASSED                                                           [ 72%]
tests/test_tidylinreg.py::test_get_test_statistic[params0-sd0-expected_t0] PASSED                                   [ 74%]
tests/test_tidylinreg.py::test_get_test_statistic[params1-sd1-expected_t1] PASSED                                   [ 76%]
tests/test_tidylinreg.py::test_get_test_statistic[params2-sd2-expected_t2] PASSED                                   [ 77%]
tests/test_tidylinreg.py::test_get_test_statistic[params3-sd3-expected_t3] PASSED                                   [ 79%]
tests/test_tidylinreg.py::test_get_test_statistic[params4-sd4-expected_t4] PASSED                                   [ 81%]
tests/test_tidylinreg.py::test_get_test_statistic[params5-sd5-expected_t5] PASSED                                   [ 83%]
tests/test_tidylinreg.py::test_get_test_statistic_error[params0-sd0-ValueError] PASSED                              [ 84%]
tests/test_tidylinreg.py::test_get_test_statistic_error[params1-sd1-ValueError] PASSED                              [ 86%]
tests/test_tidylinreg.py::test_get_test_statistic_error[params2-sd2-ValueError] PASSED                              [ 88%]
tests/test_tidylinreg.py::test_get_pvalues[test_statistic0-20-expected_p0] PASSED                                   [ 89%]
tests/test_tidylinreg.py::test_get_pvalues[test_statistic1-1000-expected_p1] PASSED                                 [ 91%]
tests/test_tidylinreg.py::test_get_pvalues[test_statistic2-20-expected_p2] PASSED                                   [ 93%]
tests/test_tidylinreg.py::test_get_pvalues[test_statistic3-4-expected_p3] PASSED                                    [ 94%]
tests/test_tidylinreg.py::test_get_pvalues[test_statistic4-1000000-expected_p4] PASSED                              [ 96%]
tests/test_tidylinreg.py::test_get_pvalues_error[test_statistic0-2-3-ValueError] PASSED                             [ 98%]
tests/test_tidylinreg.py::test_get_pvalues_error[None-20-2-TypeError] PASSED                                        [100%]

==================================================== warnings summary =====================================================
tests/test_summary.py::test_summary_basic
tests/test_summary.py::test_summary_with_ci
tests/test_summary.py::test_summary_output_without_ci
tests/test_summary.py::test_summary_values
  /Users/danishkarlin/Library/CloudStorage/OneDrive-UBC/MDS/4-524 Collaborative Software Development/tidylinreg/src/tidylinreg/tidylinreg.py:175: RuntimeWarning: divide by zero encountered in divide
    self.std_error = np.sqrt(mean_sq_error / sum_sq_deviation_x)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================= 59 passed, 4 warnings in 0.79s ==============================================
@mdkbmi mdkbmi self-assigned this Jan 18, 2025
@mdkbmi mdkbmi added the bug Something isn't working label Jan 18, 2025
@mdkbmi mdkbmi linked a pull request Jan 18, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant