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

SumFunction: allow single function input #1858

Merged
merged 3 commits into from
Aug 1, 2024
Merged

SumFunction: allow single function input #1858

merged 3 commits into from
Aug 1, 2024

Conversation

casperdcl
Copy link
Member

@casperdcl casperdcl commented Jul 4, 2024

Checklist

  • I have performed a self-review of my code
  • I have added docstrings in line with the guidance in the developer guide
  • I have updated the relevant documentation
  • I have implemented unit tests that cover any new or modified functionality
  • CHANGELOG.md has been updated with any functionality change
  • Request review from all relevant developers
  • Change pull request label to 'Waiting for review'

@casperdcl casperdcl self-assigned this Jul 4, 2024
@casperdcl casperdcl requested a review from paskino July 4, 2024 10:20
@casperdcl casperdcl added Waiting for review bug Something isn't working enhancement New feature or request labels Jul 4, 2024
@casperdcl casperdcl marked this pull request as ready for review July 4, 2024 11:45
Copy link
Member

@MargaretDuff MargaretDuff left a comment

Choose a reason for hiding this comment

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

I am happy - thanks Casper

Copy link
Contributor

@paskino paskino left a comment

Choose a reason for hiding this comment

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

I don't see where the ZeroDivisionError is thrown whilst allocationg a SumFunction without a list of functions.

Please change that or can you explain it?


def test_error_without_function(self):
SGFunction([self.f], self.sampler)
with self.assertRaises((IndexError, ZeroDivisionError)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we expect ZeroDivisionError?

Copy link
Member Author

Choose a reason for hiding this comment

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

@casperdcl casperdcl merged commit f0dd14b into master Aug 1, 2024
7 checks passed
@casperdcl casperdcl deleted the sum-of-one branch August 1, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Waiting for review
Projects
No open projects
Status: PRs to review
Development

Successfully merging this pull request may close these issues.

SumFunction could easily support 1 function only
3 participants