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

Implementing Ellipsoidal Harmonics Functions #2891

Merged
merged 17 commits into from
Apr 18, 2022
Merged

Implementing Ellipsoidal Harmonics Functions #2891

merged 17 commits into from
Apr 18, 2022

Conversation

shantam-8
Copy link
Contributor

@shantam-8 shantam-8 commented Mar 31, 2022

What do these changes do?

The changes are meant to implement the ellipsoidal harmonics functions present in the Scipy library in tensor special.

Related issue number

Fixes #758

Check code requirements

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

@shantam-8 shantam-8 marked this pull request as ready for review March 31, 2022 14:57
@qinxuye
Copy link
Collaborator

qinxuye commented Apr 1, 2022

Could you please add a test to https://github.com/mars-project/mars/blob/master/mars/tensor/special/tests/test_special_execution.py

And you can add a test_quintuple_execution and refer to the the other tests.

@qinxuye qinxuye changed the title Implementing Ellipsoidal Harmonics Functions (#758) Implementing Ellipsoidal Harmonics Functions Apr 1, 2022
@shantam-8
Copy link
Contributor Author

shantam-8 commented Apr 2, 2022

Hello @qinxuye, @hekaisheng, and @wjsi, I hope you all are doing well. I have created the tests but they are currently failing (as seen in the attached picture for ellip_normal). Also, I noticed that the scipy ellipsoidal harmonics functions only take float and/or int as inputs. Could you please tell me how should I go about solving it? Thanks in advance!

image

@qinxuye
Copy link
Collaborator

qinxuye commented Apr 6, 2022

Hello @qinxuye, @hekaisheng, and @wjsi, I hope you all are doing well. I have created the tests but they are currently failing (as seen in the attached picture for ellip_normal). Also, I noticed that the scipy ellipsoidal harmonics functions only take float and/or int as inputs. Could you please tell me how should I go about solving it? Thanks in advance!

image

Yeah, the functions ellip_normal etc cannot accept order argument, one solution is that you can overwrite the execute_cpu method to stop passing order to the argument.

You can refer to the execute_gpu method, the gpu function cannot pass order either.

def _execute_gpu(cls, op, xp, *args, **kw):
if kw.get("out") is not None:
kw["out"] = xp.asarray(kw["out"])
r = cls._get_func(xp)(*args, **kw)
return convert_order(r, op.outputs[0].order.value)

@shantam-8
Copy link
Contributor Author

Hello @qinxuye, I have rewritten the execute_cpu function based on execute_gpu function. This ensures that order is not passed as an argument to the ellip harmonic functions. However, I had to add an isfortran function in innit.py to ensure that the execute_cpu function passes. However, the tests are still failing, as seen in the attached picture. Could you please tell me how to solve that?

image

@qinxuye
Copy link
Collaborator

qinxuye commented Apr 8, 2022

@shantam-8 Let me see what's happening.

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

@qinxuye
Copy link
Collaborator

qinxuye commented Apr 18, 2022

@shantam-8 , @wjsi has addressed the issue for you, basically modified _execute_cpu.

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 00dbf41 into mars-project:master Apr 18, 2022
@qinxuye
Copy link
Collaborator

qinxuye commented Apr 18, 2022

Thanks, look forward to seeing more contributions from you.

@wjsi wjsi added mod: tensor type: feature New feature to be backported Indicate that the PR need to be backported to stable branch labels Apr 18, 2022
@wjsi wjsi added this to PR-In progress in v0.9 Release via automation Apr 18, 2022
@wjsi wjsi added this to In progress in Tensor via automation Apr 18, 2022
@wjsi wjsi added this to the v0.9.0rc3 milestone Apr 18, 2022
wjsi pushed a commit to wjsi/mars that referenced this pull request Apr 18, 2022
@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 Apr 18, 2022
qinxuye pushed a commit to qinxuye/mars that referenced this pull request Apr 22, 2022
@qinxuye qinxuye moved this from PR-In progress to PR-Done in v0.9 Release May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported already PR has been backported mod: tensor type: feature New feature
Projects
Tensor
  
In progress
Development

Successfully merging this pull request may close these issues.

Implement ellipsoidal harmonics functions
3 participants