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 pytest imports for test_special.py #3129

Merged
merged 2 commits into from
Jun 10, 2022

Conversation

RandomY-2
Copy link
Contributor

@RandomY-2 RandomY-2 commented Jun 9, 2022

What do these changes do?

Currently, the file tries to import certain elliptic functions and integrals such as elliprc from both scipy and err_func_integrals.py. However, these functions don't exist in scipy nor err_func_integrals.py if the scipy version is low. So directly importing them causes import errors. We can move these imports to within the test functions, so only if we have correct dependencies then we import them.

Related issue number

Fixes #3128

Check code requirements

  • tests added / passed (if needed)
  • Ensure all linting tests pass, see here for how to run them

@RandomY-2 RandomY-2 requested a review from a team as a code owner June 9, 2022 16:16
@qinxuye qinxuye added type: tests mod: tensor to be backported Indicate that the PR need to be backported to stable branch labels Jun 10, 2022
@qinxuye qinxuye added this to the v0.10.0a1 milestone Jun 10, 2022
qinxuye
qinxuye previously approved these changes Jun 10, 2022
Copy link
Collaborator

@qinxuye qinxuye left a comment

Choose a reason for hiding this comment

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

LGTM

@wjsi
Copy link
Member

wjsi commented Jun 10, 2022

I changed some code to make sure the failure of import statement in __init__ does not interfere other imports.

@RandomY-2
Copy link
Contributor Author

Thank you! Sorry for the incomplete fix

Copy link
Member

@wjsi wjsi left a comment

Choose a reason for hiding this comment

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

LGTM

@wjsi wjsi requested a review from qinxuye June 10, 2022 05:37
Copy link
Collaborator

@qinxuye qinxuye left a comment

Choose a reason for hiding this comment

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

LGTM

@qinxuye qinxuye merged commit f82aef3 into mars-project:master Jun 10, 2022
wjsi added a commit to wjsi/mars that referenced this pull request Jun 10, 2022
wjsi added a commit that referenced this pull request Jun 10, 2022
* Update pytest imports for test_special.py (#3129)

Co-authored-by: Wenjun Si <[email protected]>

* Make PyPI user name configurable (#3130)

Co-authored-by: RandomY-2 <[email protected]>
@qinxuye qinxuye added backported already PR has been backported and removed to be backported Indicate that the PR need to be backported to stable branch labels Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] ImportError: cannot import name 'elliprc' from 'mars.tensor.special.ellip_func_integrals'
3 participants