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

refactor(framework) Correct numpy client fit - return data type - error message #4666

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

WilliamLindskog
Copy link
Contributor

Issue

In client/numpy_client.py the EXCEPTION_MESSAGE_WRONG_RETURN_TYPE_FIT constant is set to wrong datatype.

Description

Function _fit(...), that checks returned value type wants a Tuple[List, int, Dict[str,Scalar]] but it should be Tuple[NDArray, int, Dict[str,Scalar]], also there are no tests that check this.

Related issues/PRs

Fixes #3948

Proposal

Add new tests to numpy_client_test.py and change _fit() function in numpy_client.py to check for NDArrays.

Explanation

We can use isinstance to check that parameters is a list and then validate that all elements in the list are NumPy arrays.

Checklist

  • Implement proposed change
  • Write tests
  • Update documentation
  • Make CI checks pass
  • Ping maintainers on Slack (channel #contributions)

Any other comments?

N/A

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.

Wrong EXCEPTION_MESSAGE_WRONG_RETURN_TYPE_FIT message
1 participant