Skip to content

Conversation

@jeremy-myers
Copy link
Contributor

@jeremy-myers jeremy-myers commented Sep 15, 2023

… 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.


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

… 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.
Copy link
Collaborator

@ntjohnson1 ntjohnson1 left a comment

Choose a reason for hiding this comment

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

A few small desired cleanups then looks good to me and @dmdunla can merge. Thanks!

Jeremy Myers and others added 4 commits September 15, 2023 16:51
…CPU cycles. Also removing output since nothing is actually checked.
@dmdunla dmdunla merged commit efaf16c into sandialabs:235-cp_als-with-option-printitn=0-causes-zerodivisionerror Sep 16, 2023
dmdunla added a commit that referenced this pull request Sep 16, 2023
#242)

* Default behavior of divmod() is different from MATLAB mod(), on which… (#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]>

* black: fixing black formatting

---------

Co-authored-by: Jeremy Myers <[email protected]>
Co-authored-by: Jeremy Myers <[email protected]>
Co-authored-by: Nick <[email protected]>
@jeremy-myers jeremy-myers deleted the 235-cp_als-with-option-printitn=0-causes-zerodivisionerror branch September 28, 2023 18:35
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.

3 participants