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

Update overlap.py to fix_factorial2 #309

Closed
wants to merge 3 commits into from
Closed

Conversation

LudoRNLT
Copy link

@LudoRNLT LudoRNLT commented Mar 7, 2024

Capture d'écran 2024-03-07 104652
Capture d'écran 2024-03-07 104853

@D-TheProgrammer and I, think that we solved the factorial error. Let us know if we have to do this but in a different way or use another syntax.

@D-TheProgrammer and I, think we solved the fix_factiorial issue#308
@PaulWAyers PaulWAyers requested a review from FarnazH March 8, 2024 19:28
PaulWAyers
PaulWAyers previously approved these changes Mar 8, 2024
Copy link
Member

@PaulWAyers PaulWAyers left a comment

Choose a reason for hiding this comment

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

This looks good to me. I've tagged @FarnazH as she did more work on this, so I'd wait a couple days for her to glance at it before merging.

@D-TheProgrammer
Copy link
Contributor

Hi @PaulWAyers and @FarnazH , @LudoRNLT and I wanted to know if you have any updates regarding our fix and if it still suits you for the merge.

@PaulWAyers
Copy link
Member

I think @FarnazH is busy. Perhaps @tovrstra or @marco-2023 has time to do a quick review.

@tovrstra
Copy link
Member

tovrstra commented May 3, 2024

@D-TheProgrammer: can you explain the error you were getting and that was fixed with this change? I just ran all unit tests without this change, and they pass (except for the problem fixed in #310).

Edit: sorry found it #308

Comment on lines +53 to +55
for x in range(len(n)):
x = n[x]
out = scipy.special.factorial2(x, exact) #compute on each individual element x of the array n
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this loop be dedented by four spaces?

@tovrstra tovrstra self-assigned this May 3, 2024
@tovrstra tovrstra linked an issue May 3, 2024 that may be closed by this pull request
Copy link
Member

@tovrstra tovrstra left a comment

Choose a reason for hiding this comment

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

I'm sorry for my initial confusion. I'd like to request a few improvements:

  • Major: Please add unit tests for the cases you're fixing. The issue reported in Fix Factorial2 #308 is not covered by our unit tests at the moment. Unit tests for the following cases (once with exact=True and once with exact=False) would be useful:
    • integer arguments 0, 1, 2 and 3
    • float arguments 0.0, 1.0, 2.0 and 3.0
    • integer array argument np.array([0, 1, 2, 3])
    • float array argument np.array([0.0, 1.0, 2.0, 3.0])
  • Minor: Please avoid comments at the end of a line. Put them on the line before instead. Also, don't add comments with little added value, such as translating a line of Python to a human-readable sentence. Comments are more useful when they explain the intent of the code, typically of a block consisting of multiple lines, which is different from a literal human translation of the code.

Thanks!

@tovrstra
Copy link
Member

tovrstra commented Jun 1, 2024

I'm closing this one because a more recent pull request was made: #319

@tovrstra tovrstra closed this Jun 1, 2024
tovrstra added a commit that referenced this pull request Jun 3, 2024
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.

Fix Factorial2
4 participants