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

Default behavior of divmod() is different from MATLAB mod(), on which… #242

Merged

Conversation

dmdunla
Copy link
Collaborator

@dmdunla dmdunla commented Sep 16, 2023

…… (#237)

  • Default behavior of divmod() is different from MATLAB mod(), on which the original logic was based. The prior logic threw a ZeroDivisionError if printitn == 0. Instead, this fix avoids this error by testing that printitn > 0. Tests added for various values of printitn.

  • Update tests/test_cp_als.py

  • Update tests/test_cp_als.py

  • Applying Nick's suggesetions to remove mark, change maxiters to save CPU cycles. Also removing output since nothing is actually checked.

  • Removes mark

  • Closes cp_als with option printitn=0 causes ZeroDivisionError #235 ---------


📚 Documentation preview 📚: https://pyttb--242.org.readthedocs.build/en/242/

#237)

* Default behavior of divmod() is different from MATLAB mod(), on which the original logic was based. The prior logic threw a ZeroDivisionError if printitn == 0. Instead, this fix avoids this error by testing that printitn > 0. Tests added for various values of printitn.

* Update tests/test_cp_als.py

Co-authored-by: Nick <[email protected]>

* Update tests/test_cp_als.py

Co-authored-by: Nick <[email protected]>

* Applying Nick's suggesetions to remove mark, change maxiters to save CPU cycles. Also removing output since nothing is actually checked.

* Removes mark

* Closes #235
---------

Co-authored-by: Jeremy Myers <[email protected]>
Co-authored-by: Nick <[email protected]>
@dmdunla dmdunla linked an issue Sep 16, 2023 that may be closed by this pull request
@dmdunla dmdunla merged commit cae543c into main Sep 16, 2023
5 checks passed
@dmdunla dmdunla deleted the 235-cp_als-with-option-printitn=0-causes-zerodivisionerror branch September 16, 2023 15:42
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.

cp_als with option printitn=0 causes ZeroDivisionError
2 participants